From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754384Ab0DBTyX (ORCPT ); Fri, 2 Apr 2010 15:54:23 -0400 Received: from smtp-out.google.com ([216.239.44.51]:15840 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753783Ab0DBTyQ (ORCPT ); Fri, 2 Apr 2010 15:54:16 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id: references:user-agent:mime-version:content-type:x-system-of-record; b=LpW82mGPCVgkaxEhfXbxeQzvv6IX51CnwrOB78O252tVLv316MMTUWA+t+VBcaAw7 a5GYAZZYaiKM0/Z5uPOyQ== Date: Fri, 2 Apr 2010 12:54:10 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Oleg Nesterov , Andrew Morton cc: anfei , KOSAKI Motohiro , nishimura@mxp.nes.nec.co.jp, KAMEZAWA Hiroyuki , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [patch -mm] oom: exclude tasks with badness score of 0 from being selected In-Reply-To: Message-ID: References: <20100330154659.GA12416@redhat.com> <20100331175836.GA11635@redhat.com> <20100331204718.GD11635@redhat.com> <20100401135927.GA12460@redhat.com> <20100402111406.GA4432@redhat.com> <20100402191414.GA982@redhat.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: David Rientjes --- mm/oom_kill.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -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) { chosen = p; *ppoints = points; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with ESMTP id A0A8A6B01EF for ; Fri, 2 Apr 2010 15:54:18 -0400 (EDT) Received: from wpaz24.hot.corp.google.com (wpaz24.hot.corp.google.com [172.24.198.88]) by smtp-out.google.com with ESMTP id o32JsFfb000809 for ; Fri, 2 Apr 2010 12:54:15 -0700 Received: from pwi9 (pwi9.prod.google.com [10.241.219.9]) by wpaz24.hot.corp.google.com with ESMTP id o32JsDoo030392 for ; Fri, 2 Apr 2010 12:54:14 -0700 Received: by pwi9 with SMTP id 9so1851874pwi.27 for ; Fri, 02 Apr 2010 12:54:13 -0700 (PDT) Date: Fri, 2 Apr 2010 12:54:10 -0700 (PDT) From: David Rientjes Subject: [patch -mm] oom: exclude tasks with badness score of 0 from being selected In-Reply-To: Message-ID: References: <20100330154659.GA12416@redhat.com> <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 Sender: owner-linux-mm@kvack.org To: Oleg Nesterov , Andrew Morton Cc: anfei , KOSAKI Motohiro , nishimura@mxp.nes.nec.co.jp, KAMEZAWA Hiroyuki , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org List-ID: 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. Signed-off-by: David Rientjes --- mm/oom_kill.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -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) { chosen = p; *ppoints = points; -- 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