On Sun, 6 Jun 2010 15:34:00 -0700 (PDT) David Rientjes <rientjes@xxxxxxxxxx> wrote: > From: Oleg Nesterov <oleg@xxxxxxxxxx> > > select_bad_process() thinks a kernel thread can't have ->mm != NULL, this > is not true due to use_mm(). > > Change the code to check PF_KTHREAD. > > Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> > Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx> > Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> > --- > mm/oom_kill.c | 9 +++------ > 1 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -256,14 +256,11 @@ static struct task_struct *select_bad_process(unsigned long *ppoints, > for_each_process(p) { > unsigned long points; > > - /* > - * skip kernel threads and tasks which have already released > - * their mm. > - */ > + /* skip tasks that have already released their mm */ > if (!p->mm) > continue; > - /* skip the init task */ > - if (is_global_init(p)) > + /* skip the init task and kthreads */ > + if (is_global_init(p) || (p->flags & PF_KTHREAD)) > continue; > if (mem && !task_in_mem_cgroup(p, mem)) > continue; Applied, thanks. A minor bugfix. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>