aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2010-08-09 20:18:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 23:44:56 -0400
commitc81fac5cb8c92b8b4795ac250a46c7514d1fce06 (patch)
tree2f2577d6813d0472b23359bcda8223edf0d7b396 /mm/oom_kill.c
parent74ab7f1d3f22ccb02f8b14f1f2375416b1ab0adb (diff)
oom: dump_tasks use find_lock_task_mm too fix
When find_lock_task_mm() returns a thread other than p in dump_tasks(), its name should be displayed instead. This is the thread that will be targeted by the oom killer, not its mm-less parent. This also allows us to safely dereference task->comm without needing get_task_comm(). While we're here, remove the cast on task_cpu(task) as Andrew suggested. Signed-off-by: David Rientjes <rientjes@google.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index ef4ed4ae6f64..907e2c0ad7a6 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -357,10 +357,10 @@ static void dump_tasks(const struct mem_cgroup *mem)
357 continue; 357 continue;
358 } 358 }
359 359
360 printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3d %3d %s\n", 360 printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3u %3d %s\n",
361 task->pid, __task_cred(task)->uid, task->tgid, 361 task->pid, __task_cred(task)->uid, task->tgid,
362 task->mm->total_vm, get_mm_rss(task->mm), 362 task->mm->total_vm, get_mm_rss(task->mm),
363 (int)task_cpu(task), task->signal->oom_adj, p->comm); 363 task_cpu(task), task->signal->oom_adj, task->comm);
364 task_unlock(task); 364 task_unlock(task);
365 } 365 }
366} 366}