Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:tg_with_in_iops_limit

Proto:static bool tg_with_in_iops_limit(struct throtl_grp *tg, struct bio *bio, unsigned long *wait)

Type:bool

Parameter:

TypeParameterName
struct throtl_grp *tg
struct bio *bio
unsigned long *wait
899  rw = Return the data direction, READ or WRITE.(bio)
904  jiffy_elapsed = jiffies - When did we start a new slice [rw]
907  jiffy_elapsed_rnd = undup - round up to the next specified multiple*@x: the value to up*@y: multiple to round up to* Rounds @x up to next multiple of @y. If @y will always be a power* of 2, consider using the faster round_up().(jiffy_elapsed + 1, throtl_slice)
916  tmp = tg_iops_limit(tg, rw) * jiffy_elapsed_rnd
917  do_div() is NOT a C function(tmp, HZ)
919  If tmp > UINT_MAX Then io_allowed = UINT_MAX
921  Else io_allowed = tmp
924  If Number of bio's dispatched in current slice [rw] + 1 <= io_allowed Then
925  If wait Then wait = 0
927  Return true
931  jiffy_wait = jiffy_elapsed_rnd - jiffy_elapsed
933  If wait Then wait = jiffy_wait
935  Return false
Caller
NameDescribe
tg_may_dispatchReturns whether one can dispatch a bio or not. Also returns approx number* of jiffies to wait before this bio is with-in IO rate and can be dispatched