Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:unsigned long oom_badness(struct task_struct *p, unsigned long totalpages)

Type:unsigned long

Parameter:

TypeParameterName
struct task_struct *p
unsigned longtotalpages
203  If rn true if the task is not adequate as candidate victim task. Then Return 0
206  p = The process p may have detached its own ->mm while exiting or through* use_mm(), but one or more of its subthreads may still have a valid* pointer. Return p, or any of its subthreads with a valid ->mm, with* task_lock() held.
207  If Not p Then Return 0
215  adj = oom_score_adj
216  If adj == /proc//oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for* pid. || st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from || in_vfork(p) Then
219  task_unlock(p)
220  Return 0
227  points = get_mm_rss(mm) + per-process(per-mm_struct) statistics. + mm_pgtables_bytes(mm) / PAGE_SIZE
229  task_unlock(p)
232  adj *= totalpages / 1000
233  points += adj
239  Return If points > 0 Then points Else 1
Caller
NameDescribe
oom_evaluate_task