Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:bool mem_cgroup_oom_synchronize(bool handle)

Type:bool

Parameter:

TypeParameterName
boolhandle
1840  memcg = memcg_in_oom
1845  If Not memcg Then Return false
1848  If Not handle Then Go to cleanup
1851  memcg = memcg
1852  flags = 0
1853  func = memcg_oom_wake_function
1854  private = current process
1855  Initialization list head
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  If locked Then mem_cgroup_oom_notify(memcg)
1865  If locked && Not OOM-Killer disable Then
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  Else
1871  schedule()
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  If locked Then
1877  mem_cgroup_oom_unlock(memcg)
1883  memcg_oom_recover(memcg)
1885  cleanup :
1886  memcg_in_oom = NULL
1887  ss_put - put a css reference*@css: target css* Put a reference obtained via css_get() and css_tryget_online().
1888  Return true
Caller
NameDescribe
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().