Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:oom_evaluate_task

Proto:static int oom_evaluate_task(struct task_struct *task, void *arg)

Type:int

Parameter:

TypeParameterName
struct task_struct *task
void *arg
311  oc = arg
314  If rn true if the task is not adequate as candidate victim task. Then Go to next
318  If Not is_memcg_oom(oc) && Not m_cpuset_eligible() - check task eligiblity for kill*@start: task struct of which task to consider*@oc: pointer to struct oom_control* Task eligibility is determined by whether or not a candidate task, @tsk,* shares the same mempolicy nodes as current if Then Go to next
327  If Not rder == -1 means the oom kill is required by sysrq, otherwise only* for display purposes. && tsk_is_oom_victim(task) Then
328  If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then Go to next
330  Go to abort
337  If oom_task_origin(task) Then
338  points = ULONG_MAX
339  Go to select
342  points = m_badness - heuristic function to determine which candidate task to kill*@p: task struct of which task we should calculate*@totalpages: total present RAM allowed for page allocation* The heuristic for determining which task to kill is made to be as simple
343  If Not points || points < chosen_points Then Go to next
346  select :
347  If chosen Then put_task_struct(chosen)
349  get_task_struct(task)
350  chosen = task
351  chosen_points = points
352  :
353  Return 0
354  abort :
355  If chosen Then put_task_struct(chosen)
357  chosen = (void * ) - 1UL
358  Return 1
Caller
NameDescribe
select_bad_processSimple selection loop. We choose the process with the highest number of* 'points'. In case scan was aborted, oc->chosen is set to -1.