Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Trim the used slices and adjust slice start accordingly

Proto:static inline void throtl_trim_slice(struct throtl_grp *tg, bool rw)

Type:void

Parameter:

TypeParameterName
struct throtl_grp *tg
boolrw
842  BUG_ON(time_before(slice_end[rw], When did we start a new slice [rw]))
849  If Determine if previously allocated or extended slice is complete or not Then Return
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_elapsed / throtl_slice
866  If Not nr_slices Then Return
868  tmp = tg_bps_limit(tg, rw) * throtl_slice * nr_slices
869  do_div() is NOT a C function(tmp, HZ)
870  bytes_trim = tmp
872  io_trim = tg_iops_limit(tg, rw) * throtl_slice * nr_slices / HZ
875  If Not bytes_trim && Not io_trim Then Return
878  If Number of bytes disptached in current slice [rw] >= bytes_trim Then Number of bytes disptached in current slice [rw] -= bytes_trim
880  Else Number of bytes disptached in current slice [rw] = 0
883  If Number of bio's dispatched in current slice [rw] >= io_trim Then Number of bio's dispatched in current slice [rw] -= io_trim
885  Else Number of bio's dispatched in current slice [rw] = 0
888  When did we start a new slice [rw] += nr_slices * throtl_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)
Caller
NameDescribe
tg_dispatch_one_bio
blk_throtl_bio