函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Trim the used slices and adjust slice start accordingly

函数原型:static inline void throtl_trim_slice(struct throtl_grp *tg, bool rw)

返回类型:void

参数:

类型参数名称
struct throtl_grp *tg
boolrw
842  BUG_ON(time_before(slice_end[rw], When did we start a new slice [rw]))
849  如果Determine if previously allocated or extended slice is complete or not 则返回
860  throtl_set_slice_end(tg, rw, jiffies + throtl_slice)
862  time_elapsed等于jiffies When did we start a new slice [rw]
864  nr_slices等于time_elapsedthrotl_slice
866  如果非nr_slices则返回
868  tmp等于tg_bps_limit(tg, rw)乘throtl_slicenr_slices
869  do_div() is NOT a C function(tmp, HZ)
870  bytes_trim等于tmp
872  io_trim等于tg_iops_limit(tg, rw)乘throtl_slicenr_slicesHZ
875  如果非bytes_trim且非io_trim则返回
878  如果 Number of bytes disptached in current slice [rw]大于等于bytes_trim Number of bytes disptached in current slice [rw]减等于bytes_trim
880  否则 Number of bytes disptached in current slice [rw]等于0
883  如果 Number of bio's dispatched in current slice [rw]大于等于io_trim Number of bio's dispatched in current slice [rw]减等于io_trim
885  否则 Number of bio's dispatched in current slice [rw]等于0
888  When did we start a new slice [rw]加等于nr_slicesthrotl_slice
890  hrotl_log - log debug message via blktrace*@sq: the service_queue being reported*@fmt: printf format string*@args: printf args* The messages are prefixed with "throtl BLKG_NAME" if @sq belongs to a* throtl_grp; otherwise, just "throtl".( & this group's service queue , "[%c] trim slice nr=%lu bytes=%llu io=%lu start=%lu end=%lu jiffies=%lu", rw == generic data direction definitions ? 'R' : 'W', nr_slices, bytes_trim, io_trim, When did we start a new slice [rw], slice_end[rw], jiffies)
调用者
名称描述
tg_dispatch_one_bio
blk_throtl_bio