Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static void blkcg_scale_delay(struct blkcg_gq *blkg, u64 now)

Type:void

Parameter:

TypeParameterName
struct blkcg_gq *blkg
u64now
1515  old = atomic64_read( & delay_start)
1530  If time_before64(old + NSEC_PER_SEC, now) && atomic64_cmpxchg( & delay_start, old, now) == old Then
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  If cur_use < last_use Then sub = 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  Else
1554  last_delay = cur - sub
1556  last_use = cur_use
Caller
NameDescribe
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