From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754668Ab0DBVHP (ORCPT ); Fri, 2 Apr 2010 17:07:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1025 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754185Ab0DBVHI (ORCPT ); Fri, 2 Apr 2010 17:07:08 -0400 Date: Fri, 2 Apr 2010 23:04:59 +0200 From: Oleg Nesterov To: David Rientjes Cc: Andrew Morton , anfei , KOSAKI Motohiro , nishimura@mxp.nes.nec.co.jp, KAMEZAWA Hiroyuki , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [patch -mm] oom: exclude tasks with badness score of 0 from being selected Message-ID: <20100402210459.GA5112@redhat.com> References: <20100331175836.GA11635@redhat.com> <20100331204718.GD11635@redhat.com> <20100401135927.GA12460@redhat.com> <20100402111406.GA4432@redhat.com> <20100402191414.GA982@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/02, David Rientjes wrote: > > An oom_badness() score of 0 means "never kill" according to > Documentation/filesystems/proc.txt, so explicitly exclude it from being > selected for kill. These tasks have either detached their p->mm or are > set to OOM_DISABLE. Agreed, but > @@ -336,6 +336,8 @@ static struct task_struct *select_bad_process(unsigned int *ppoints, > continue; > > points = oom_badness(p, totalpages); > + if (!points) > + continue; > if (points > *ppoints || !chosen) { then "|| !chosen" can be killed. with this patch !chosen <=> !*ppoints, and since points > 0 if (points > *ppoints) { is enough. Oleg.