Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\oom_kill.c Create Date:2022-07-28 14:06:24
Last Modify:2022-05-23 13:16:41 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Checks whether the given task is dying or exiting and likely to* release its address space. This means that all threads and processes* sharing the same mm have to be killed or exiting.* Caller has to make sure that task->mm is stable (hold task_lock or

Proto:static bool task_will_free_mem(struct task_struct *task)

Type:bool

Parameter:

TypeParameterName
struct task_struct *task
811  mm = mm
813  bool ret = true
820  If Not mm Then Return false
823  If Not __task_will_free_mem(task) Then Return false
830  If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then Return false
833  If atomic_read( & *@mm_users: The number of users including userspace. * Use mmget()/mmget_not_zero()/mmput() to modify. When this * drops to 0 (i.e. when the task exits and there are no other * temporary reference holders), we also release a reference on *@mm_count (which ) <= 1 Then Return true
841  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
843  If Not ask->mm can be NULL if the task is the exited group leader. So to* determine whether the task is using a particular mm, we examine all the* task's threads: if one of those is using this mm then this task was also* using it. Then Continue
845  If same_thread_group(task, p) Then Continue
847  ret = __task_will_free_mem(p)
848  If Not ret Then Break
851  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
853  Return ret
Caller
NameDescribe
oom_kill_process
out_of_memory_of_memory - kill the "best" process when we run out of memory*@oc: pointer to struct oom_control* If we run out of memory, we have the choice between either* killing a random task (bad), letting the system crash (worse)