函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:void mem_cgroup_handle_over_high(void)

返回类型:void

参数:

2308  nr_pages等于memcg_nr_pages_over_high
2311  如果此条件成立可能性大(为编译器优化)(!nr_pages)则返回
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  如果usage小于等于high则转到:out
2340  clamped_high等于两数取大(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等于overageoverageHZ右移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 theMEMCG_DELAY_SCALING_SHIFT
2356  penalty_jiffies等于penalty_jiffiesnr_pagessize 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等于两数取小(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  如果penalty_jiffies小于等于HZ除100则转到: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  设置一个css引用