函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Scale the accumulated delay based on how long it has been since we updated* the delay. We only call this when we are adding delay, in case it's been a* while since we added delay, and when we are checking to see if we need to

函数原型:static void blkcg_scale_delay(struct blkcg_gq *blkg, u64 now)

返回类型:void

参数:

类型参数名称
struct blkcg_gq *blkg
u64now
1515  old等于atomic64_read( & delay_start)
1530  如果time_before64(old + NSEC_PER_SEC, now)且atomic64_cmpxchg( & delay_start, old, now)恒等于old
1532  cur等于atomic64_read( & delay_nsec)
1533  sub等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, last_delay, now - old)
1534  cur_use等于atomic_read( & use_delay)
1540  如果cur_use小于last_usesub等于max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, sub, last_delay >> 1)
1550  atomic64_set( & delay_nsec, 0)
1551  last_delay等于0
1552  否则
1554  last_delay等于cursub
1556  last_use等于cur_use
调用者
名称描述
blkcg_maybe_throttle_blkgThis is called when we want to actually walk up the hierarchy and check to* see if we need to throttle, and then actually throttle if there is some* accumulated delay. This should only be called upon return to user space so
blkcg_add_delaylkcg_add_delay - add delay to this blkg*@blkg: blkg of interest*@now: the current time in nanoseconds*@delta: how many nanoseconds of delay to add* Charge @delta to the blkg's current delay accumulation. This is used to