Commit 74ab7f1d authored by David Rientjes's avatar David Rientjes Committed by Linus Torvalds
Browse files

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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c55db957
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -323,7 +323,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints,


/**
/**
 * dump_tasks - dump current memory state of all system tasks
 * 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.
 * 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
 * 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 "
	printk(KERN_INFO "[ pid ]   uid  tgid total_vm      rss cpu oom_adj "
	       "name\n");
	       "name\n");
	for_each_process(p) {
	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)
		if (p->flags & PF_KTHREAD)
			continue;
			continue;
		if (mem && !task_in_mem_cgroup(p, mem))
		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);
		task = find_lock_task_mm(p);
		if (!task) {
		if (!task) {
			/*
			/*
			 * Probably oom vs task-exiting race was happen and ->mm
			 * This is a kthread or all of p's threads have already
			 * have been detached. thus there's no need to report
			 * detached their mm's.  There's no need to report
			 * them; they can't be oom killed anyway.
			 * them; they can't be oom killed anyway.
			 */
			 */
			continue;
			continue;