函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-throttle.c Create Date:2022-07-27 19:18:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:tg_with_in_bps_limit

函数原型:static bool tg_with_in_bps_limit(struct throtl_grp *tg, struct bio *bio, unsigned long *wait)

返回类型:bool

参数:

类型参数名称
struct throtl_grp *tg
struct bio *bio
unsigned long *wait
941  rw等于Return the data direction, READ or WRITE.(bio)
944  bio_size等于throtl_bio_data_size(bio)
946  jiffy_elapsed等于jiffy_elapsed_rnd等于jiffies When did we start a new slice [rw]
949  如果非jiffy_elapsedjiffy_elapsed_rnd等于throtl_slice
952  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_rnd, throtl_slice)
954  tmp等于tg_bps_limit(tg, rw)乘jiffy_elapsed_rnd
955  do_div() is NOT a C function(tmp, HZ)
956  bytes_allowed等于tmp
958  如果 Number of bytes disptached in current slice [rw]加bio_size小于等于bytes_allowed
959  如果waitwait等于0
961  返回:true
965  extra_bytes等于 Number of bytes disptached in current slice [rw]加bio_sizebytes_allowed
966  jiffy_wait等于div64_u64 - unsigned 64bit divide with 64bit divisor*@dividend: 64bit dividend*@divisor: 64bit divisor* This implementation is a modified version of the algorithm proposed* by the book 'Hacker's Delight'. The original source and full proof
968  如果非jiffy_waitjiffy_wait等于1
975  jiffy_wait等于jiffy_waitjiffy_elapsed_rndjiffy_elapsed
976  如果waitwait等于jiffy_wait
978  返回:false
调用者
名称描述
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