From 74ab7f1d3f22ccb02f8b14f1f2375416b1ab0adb Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Mon, 9 Aug 2010 17:18:46 -0700 Subject: [PATCH] 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 Signed-off-by: David Rientjes Acked-by: KOSAKI Motohiro Cc: Balbir Singh Cc: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/oom_kill.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 5285da9a9c1..ef4ed4ae6f6 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -323,7 +323,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints, /** * dump_tasks - dump current memory state of all system tasks - * @mem: target memory controller + * @mem: current's memory controller, if constrained * * Dumps the current memory state of all system tasks, excluding kernel threads. * 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) printk(KERN_INFO "[ pid ] uid tgid total_vm rss cpu oom_adj " "name\n"); for_each_process(p) { - /* - * We don't have is_global_init() check here, because the old - * code do that. printing init process is not big matter. But - * we don't hope to make unnecessary compatibility breaking. - */ if (p->flags & PF_KTHREAD) continue; if (mem && !task_in_mem_cgroup(p, mem)) @@ -355,8 +350,8 @@ static void dump_tasks(const struct mem_cgroup *mem) task = find_lock_task_mm(p); if (!task) { /* - * Probably oom vs task-exiting race was happen and ->mm - * have been detached. thus there's no need to report + * This is a kthread or all of p's threads have already + * detached their mm's. There's no need to report * them; they can't be oom killed anyway. */ continue; -- 2.11.4.GIT