Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page-writeback.c Create Date:2022-07-28 14:10:05
Last Modify:2022-05-23 13:25:58 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Maintain wb->dirty_ratelimit, the base dirty throttle rate.* Normal wb tasks will be curbed at or below it in long term.* Obviously it should be around (write_bw / N) when there are N dd tasks.

Proto:static void wb_update_dirty_ratelimit(struct dirty_throttle_control *dtc, unsigned long dirtied, unsigned long elapsed)

Type:void

Parameter:

TypeParameterName
struct dirty_throttle_control *dtc
unsigned longdirtied
unsigned longelapsed
1191  wb = wb
1192  dirty = le_dirty + write + nfs
1193  freerun = dirty_freerun_ceiling(dirty threshold , dirty background threshold )
1194  limit = hard_dirty_limit(dtc_dom(dtc), dirty threshold )
1195  setpoint = (freerun + limit) / 2
1196  write_bw = urther smoothed write bw, > 0
1197  dirty_ratelimit = The base dirty throttle rate, re-calculated on every 200ms.* All the bdi tasks' dirty rate will be curbed under it.*@dirty_ratelimit tracks the estimated @balanced_dirty_ratelimit* in small steps and is much more smooth/stable than the latter.
1209  dirty_rate = (dirtied - dirtied_stamp) * HZ / elapsed
1214  task_ratelimit = dirty_ratelimit * pos_ratio >> RATELIMIT_CALC_SHIFT
1216  task_ratelimit++
1248  balanced_dirty_ratelimit = div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
1253  If Value for the false possibility is greater at compile time(balanced_dirty_ratelimit > write_bw) Then balanced_dirty_ratelimit = write_bw
1290  step = 0
1303  If Value for the false possibility is greater at compile time(capabilities & BDI_CAP_STRICTLIMIT) Then
1304  dirty = per-wb counterparts
1305  If per-wb counterparts < 8 Then setpoint = per-wb counterparts + 1
1307  Else setpoint = (wb_thresh + wb_bg_thresh) / 2
1311  If dirty < setpoint Then
1312  x = min3 - return minimum of three values*@x: first value*@y: second value*@z: third value(balanced_dirty_ratelimit, balanced_dirty_ratelimit, task_ratelimit)
1314  If dirty_ratelimit < x Then step = x - dirty_ratelimit
1316  Else
1317  x = max3 - return maximum of three values*@x: first value*@y: second value*@z: third value(balanced_dirty_ratelimit, balanced_dirty_ratelimit, task_ratelimit)
1319  If dirty_ratelimit > x Then step = dirty_ratelimit - x
1328  shift = dirty_ratelimit / ( 2 * step + 1)
1329  If shift < BITS_PER_LONG Then step = DIV_ROUND_UP(step >> shift, 8)
1331  Else step = 0
1334  If dirty_ratelimit < balanced_dirty_ratelimit Then dirty_ratelimit += step
1336  Else dirty_ratelimit -= step
1339  The base dirty throttle rate, re-calculated on every 200ms.* All the bdi tasks' dirty rate will be curbed under it.*@dirty_ratelimit tracks the estimated @balanced_dirty_ratelimit* in small steps and is much more smooth/stable than the latter. = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(dirty_ratelimit, 1UL)
1340  balanced_dirty_ratelimit = balanced_dirty_ratelimit
1342  trace_bdi_dirty_ratelimit(wb, dirty_rate, task_ratelimit)
Caller
NameDescribe
__wb_update_bandwidth