Skip to content

Commit 8a7ff02

Browse files
rientjestorvalds
authored andcommitted
mm, oom: dump stack of victim when reaping failed
When a process cannot be oom reaped, for whatever reason, currently the list of locks that are held is currently dumped to the kernel log. Much more interesting is the stack trace of the victim that cannot be reaped. If the stack trace is dumped, we have the ability to find related occurrences in the same kernel code and hopefully solve the issue that is making it wedged. Dump the stack trace when a process fails to be oom reaped. Link: http://lkml.kernel.org/r/alpine.DEB.2.21.2001141519280.200484@chino.kir.corp.google.com Signed-off-by: David Rientjes <rientjes@google.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a090d71 commit 8a7ff02

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎mm/oom_kill.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/sched/mm.h>
2727
#include <linux/sched/coredump.h>
2828
#include <linux/sched/task.h>
29+
#include <linux/sched/debug.h>
2930
#include <linux/swap.h>
3031
#include <linux/timex.h>
3132
#include <linux/jiffies.h>
@@ -620,6 +621,7 @@ static void oom_reap_task(struct task_struct *tsk)
620621

621622
pr_info("oom_reaper: unable to reap pid:%d (%s)\n",
622623
task_pid_nr(tsk), tsk->comm);
624+
sched_show_task(tsk);
623625
debug_show_all_locks();
624626

625627
done:

0 commit comments

Comments
 (0)