Skip to content

Commit 74ab7f1

Browse files
rientjestorvalds
authored andcommitted
oom: improve commentary in dump_tasks()
The comments in dump_tasks() should be updated to be more clear about why tasks are filtered and how they are filtered by its argument. An unnecessary comment concerning a check for is_global_init() is removed since it isn't of importance. Suggested-by: Andrew Morton <[email protected]> Signed-off-by: David Rientjes <[email protected]> Acked-by: KOSAKI Motohiro <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent c55db95 commit 74ab7f1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

mm/oom_kill.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints,
323323

324324
/**
325325
* dump_tasks - dump current memory state of all system tasks
326-
* @mem: target memory controller
326+
* @mem: current's memory controller, if constrained
327327
*
328328
* Dumps the current memory state of all system tasks, excluding kernel threads.
329329
* State information includes task's pid, uid, tgid, vm size, rss, cpu, oom_adj
@@ -342,11 +342,6 @@ static void dump_tasks(const struct mem_cgroup *mem)
342342
printk(KERN_INFO "[ pid ] uid tgid total_vm rss cpu oom_adj "
343343
"name\n");
344344
for_each_process(p) {
345-
/*
346-
* We don't have is_global_init() check here, because the old
347-
* code do that. printing init process is not big matter. But
348-
* we don't hope to make unnecessary compatibility breaking.
349-
*/
350345
if (p->flags & PF_KTHREAD)
351346
continue;
352347
if (mem && !task_in_mem_cgroup(p, mem))
@@ -355,8 +350,8 @@ static void dump_tasks(const struct mem_cgroup *mem)
355350
task = find_lock_task_mm(p);
356351
if (!task) {
357352
/*
358-
* Probably oom vs task-exiting race was happen and ->mm
359-
* have been detached. thus there's no need to report
353+
* This is a kthread or all of p's threads have already
354+
* detached their mm's. There's no need to report
360355
* them; they can't be oom killed anyway.
361356
*/
362357
continue;

0 commit comments

Comments
 (0)