summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2006-09-25 23:31:32 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 08:48:49 -0700
commit5081dde33f7a61d28d9b185cc386f12cb837c7a4 (patch)
treed2e6f39db4005229580f571137a833c1dabfc38b /mm
parentaf5b912435de32fbede08cee949429823ed49781 (diff)
downloadop-kernel-dev-5081dde33f7a61d28d9b185cc386f12cb837c7a4.zip
op-kernel-dev-5081dde33f7a61d28d9b185cc386f12cb837c7a4.tar.gz
[PATCH] oom: kthread infinite loop fix
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/oom_kill.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f1aba7e..12cd473 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -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;
OpenPOWER on IntegriCloud