Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memcontrol.c Create Date:2022-07-28 16:10:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Scheduled by try_charge() to be executed from the userland return path* and reclaims memory over the high limit.

Proto:void mem_cgroup_handle_over_high(void)

Type:void

Parameter:Nothing

2308  nr_pages = memcg_nr_pages_over_high
2311  If Value is more likely to compile time(!nr_pages) Then Return
2314  memcg = get_mem_cgroup_from_mm: Obtain a reference on given mm_struct's memcg.*@mm: mm from which memcg should be extracted. It can be NULL.* Obtain a reference on mm->memcg and returns it if successful. Otherwise* root_mem_cgroup is returned
2315  reclaim_high(memcg, nr_pages, GFP_KERNEL)
2316  memcg_nr_pages_over_high = 0
2330  usage = page_counter_read( & Accounted resources )
2331  high = READ_ONCE( Upper bound of normal memory consumption range )
2333  If usage <= high Then Go to out
2340  clamped_high = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(high, 1UL)
2342  overage = 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
2345  penalty_jiffies = overage * overage * HZ >> When calculating the delay, we use these either side of the exponentiation to* maintain precision and scale to a reasonable number of jiffies (see the table* below.* - MEMCG_DELAY_PRECISION_SHIFT: Extra precision bits while translating the + MEMCG_DELAY_SCALING_SHIFT
2356  penalty_jiffies = penalty_jiffies * nr_pages / size of first charge trial. "32" comes from vmscan.c's magic value.* TODO: maybe necessary to use big numbers in big irons.
2363  penalty_jiffies = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(penalty_jiffies, Clamp the maximum sleep time per allocation batch to 2 seconds. This is* enough to still cause a significant slowdown in most cases, while still* allowing diagnostics and tracing to proceed without becoming stuck.)
2371  If penalty_jiffies <= HZ / 100 Then Go to out
2379  psi_memstall_enter - mark the beginning of a memory stall section*@flags: flags to handle nested sections* Marks the calling task as being stalled due to a lack of memory,* such as waiting for a refault or performing reclaim.
2380  schedule_timeout_killable(penalty_jiffies)
2381  psi_memstall_leave - mark the end of an memory stall section*@flags: flags to handle nested memdelay sections* Marks the calling task as no longer stalled due to lack of memory.
2383  out :
2384  ss_put - put a css reference*@css: target css* Put a reference obtained via css_get() and css_tryget_online().