Skip to content

Commit

Permalink
[PATCH] oom: kthread infinite loop fix
Browse files Browse the repository at this point in the history
Skip kernel threads, rather than having them return 0 from badness.
Theoretically, badness might truncate all results to 0, thus a kernel thread
might be picked first, causing an infinite loop.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Sep 26, 2006
1 parent af5b912 commit 5081dde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
unsigned long points;
int releasing;

/* skip kernel threads */
if (!p->mm)
continue;
/* skip the init task with pid == 1 */
if (p->pid == 1)
continue;
Expand Down

0 comments on commit 5081dde

Please sign in to comment.