From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail138.messagelabs.com (mail138.messagelabs.com [216.82.249.35]) by kanga.kvack.org (Postfix) with ESMTP id 1FDEF6B01D6 for ; Tue, 8 Jun 2010 15:33:31 -0400 (EDT) Date: Tue, 8 Jun 2010 12:33:20 -0700 From: Andrew Morton Subject: Re: [patch 01/18] oom: check PF_KTHREAD instead of !mm to skip kthreads Message-Id: <20100608123320.11e501a4.akpm@linux-foundation.org> In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: David Rientjes Cc: Rik van Riel , Nick Piggin , Oleg Nesterov , Balbir Singh , KAMEZAWA Hiroyuki , KOSAKI Motohiro , linux-mm@kvack.org List-ID: On Sun, 6 Jun 2010 15:34:00 -0700 (PDT) David Rientjes wrote: > From: Oleg Nesterov > > 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 > Signed-off-by: Oleg Nesterov > Signed-off-by: David Rientjes > --- > 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@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org