Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:domain_dirty_limits - calculate thresh and bg_thresh for a wb_domain*@dtc: dirty_throttle_control of interest* Calculate @dtc->thresh and ->bg_thresh considering* vm_dirty_{bytes|ratio} and dirty_background_{bytes|ratio}. The caller

Proto:static void domain_dirty_limits(struct dirty_throttle_control *dtc)

Type:void

Parameter:

TypeParameterName
struct dirty_throttle_control *dtc
395  available_memory = dirtyable
396  gdtc = mdtc_gdtc(dtc)
397  bytes = vm_dirty_bytes starts at 0 (disabled) so that it is a function of* vm_dirty_ratio * the amount of dirtyable memory
398  bg_bytes = dirty_background_bytes starts at 0 (disabled) so that it is a function of* dirty_background_ratio * the amount of dirtyable memory
400  ratio = The generator of dirty data starts writeback at this percentage * PAGE_SIZE / 100
401  bg_ratio = Start background writeback (via writeback threads) at this percentage * PAGE_SIZE / 100
407  If gdtc Then
408  global_avail = dirtyable
417  If bytes Then ratio = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(DIV_ROUND_UP(bytes, global_avail), PAGE_SIZE)
420  If bg_bytes Then bg_ratio = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(DIV_ROUND_UP(bg_bytes, global_avail), PAGE_SIZE)
423  bytes = bg_bytes = 0
426  If bytes Then thresh = DIV_ROUND_UP(bytes, PAGE_SIZE)
428  Else thresh = ratio * available_memory / PAGE_SIZE
431  If bg_bytes Then bg_thresh = DIV_ROUND_UP(bg_bytes, PAGE_SIZE)
433  Else bg_thresh = bg_ratio * available_memory / PAGE_SIZE
436  If bg_thresh >= thresh Then bg_thresh = thresh / 2
438  tsk = current process
439  If flags & Throttle me less: I clean memory || rt_task(tsk) Then
440  bg_thresh += bg_thresh / 4 + dirty_limit / 32
441  thresh += thresh / 4 + dirty_limit / 32
443  dirty threshold = thresh
444  dirty background threshold = bg_thresh
447  If Not gdtc Then trace_global_dirty_state(bg_thresh, thresh)
Caller
NameDescribe
global_dirty_limitsglobal_dirty_limits - background-writeback and dirty-throttling thresholds*@pbackground: out parameter for bg_thresh*@pdirty: out parameter for thresh* Calculate bg_thresh and thresh for global_wb_domain. See* domain_dirty_limits() for details.
balance_dirty_pagesalance_dirty_pages() must be called by processes which are generating dirty* data
wb_over_bg_threshwb_over_bg_thresh - does @wb need to be written back?*@wb: bdi_writeback of interest* Determines whether background writeback should keep writing @wb or it's* clean enough.* Return: %true if writeback should continue.