Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-iocost.c Create Date:2022-07-28 17:48:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:calc_vtime_cost_builtin

Proto:static void calc_vtime_cost_builtin(struct bio *bio, struct ioc_gq *iocg, bool is_merge, u64 *costp)

Type:void

Parameter:

TypeParameterName
struct bio *bio
struct ioc_gq *iocg
boolis_merge
u64 *costp
1633  ioc = ioc
1635  pages = max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, bio_sectors(bio) >> IOC_SECT_TO_PAGE_SHIFT, 1)
1636  seek_pages = 0
1637  cost = 0
1640  Case bio_op(bio) == REQ_OP_READ
1641  coef_seqio = lcoefs[LCOEF_RSEQIO]
1642  coef_randio = lcoefs[LCOEF_RRANDIO]
1643  coef_page = lcoefs[LCOEF_RPAGE]
1644  Break
1645  Case bio_op(bio) == REQ_OP_WRITE
1646  coef_seqio = lcoefs[LCOEF_WSEQIO]
1647  coef_randio = lcoefs[LCOEF_WRANDIO]
1648  coef_page = lcoefs[LCOEF_WPAGE]
1649  Break
1650  Default
1651  Go to out
1654  If to detect randio Then
1655  seek_pages = abs - return absolute value of an argument*@x: the value. If it is unsigned type, it is converted to signed type first.* char is treated as if it was signed (regardless of whether it really is)* but the macro's return type is preserved as char.( device address in 512 byte sectors - to detect randio )
1656  seek_pages >>= IOC_SECT_TO_PAGE_SHIFT
1659  If Not is_merge Then
1660  If seek_pages > LCOEF_RANDIO_PAGES Then
1661  cost += coef_randio
1662  Else
1663  cost += coef_seqio
1666  cost += pages * coef_page
1667  out :
1668  costp = cost
Caller
NameDescribe
calc_vtime_cost