函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Returns 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

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

返回类型:bool

参数:

类型参数名称
struct throtl_grp *tg
struct bio *bio
unsigned long *wait
988  rw等于Return the data direction, READ or WRITE.(bio)
989  bps_wait等于0, iops_wait等于0, max_wait等于0
997  BUG_ON( number of queued bios [rw] && bio != hrotl_peek_queued - peek the first bio on a qnode list*@queued: the qnode list to peek)
1001  如果tg_bps_limit(tg, rw)恒等于U64_MAXtg_iops_limit(tg, rw)恒等于UINT_MAX
1003  如果waitwait等于0
1005  返回:true
1015  如果Determine if previously allocated or extended slice is complete or not 且非 number of queued bios [rw]则throtl_start_new_slice(tg, rw)
1017  否则
1018  如果time_before(slice_end[rw], jiffies + throtl_slice)则throtl_extend_slice(tg, rw, jiffies + throtl_slice)
1024  如果tg_with_in_bps_limit(tg, bio, & bps_wait)且tg_with_in_iops_limit(tg, bio, & iops_wait)则
1026  如果waitwait等于0
1028  返回:true
1031  max_wait等于两数取大(bps_wait, iops_wait)
1033  如果waitwait等于max_wait
1036  如果time_before(slice_end[rw], jiffies + max_wait)则throtl_extend_slice(tg, rw, jiffies + max_wait)
1039  返回:false
调用者
名称描述
tg_update_disptime
throtl_dispatch_tg
blk_throtl_bio