函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mem_cgroup_oom_synchronize - complete memcg OOM handling*@handle: actually kill/wait or just clean up the OOM state* This has to be called at the end of a page fault if the memcg OOM* handler was enabled

函数原型:bool mem_cgroup_oom_synchronize(bool handle)

返回类型:bool

参数:

类型参数名称
boolhandle
1840  memcg等于memcg_in_oom
1845  如果非memcg则返回:false
1848  如果非handle则转到:cleanup
1851  memcg等于memcg
1852  flags等于0
1853  func等于memcg_oom_wake_function
1854  private等于当前进程
1855  初始化链表头
1857  Note: we use "set_current_state()" _after_ the wait-queue add,* because we need a memory barrier there on SMP, so that any* wake-function that tests for the wait-queue being active* will be guaranteed to see waitqueue addition _or_ subsequent
1858  mem_cgroup_mark_under_oom(memcg)
1860  locked等于Check OOM-Killer is already running under our hierarchy.* If someone is running, return false.
1862  如果lockedmem_cgroup_oom_notify(memcg)
1865  如果locked且非 OOM-Killer disable
1866  mem_cgroup_unmark_under_oom(memcg)
1867  sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
1868  mem_cgroup_out_of_memory(memcg, memcg_oom_gfp_mask, memcg_oom_order)
1870  否则
1871  进程调度
1872  mem_cgroup_unmark_under_oom(memcg)
1873  sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
1876  如果locked
1877  mem_cgroup_oom_unlock(memcg)
1883  memcg_oom_recover(memcg)
1885  cleanup :
1886  memcg_in_oom = NULL
1887  设置一个css引用
1888  返回:true
调用者
名称描述
handle_mm_faultBy the time we get here, we already hold the mm semaphore* The mmap_sem may have been released depending on flags and our* return value. See filemap_fault() and __lock_page_or_retry().
pagefault_out_of_memoryThe pagefault handler calls here because it is out of memory, so kill a* memory-hogging task. If oom_lock is held by somebody else, a parallel oom* killing is already in progress so do nothing.