Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932335Ab0BOWWN (ORCPT ); Mon, 15 Feb 2010 17:22:13 -0500 Received: from smtp-out.google.com ([216.239.33.17]:44836 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932076Ab0BOWUG (ORCPT ); Mon, 15 Feb 2010 17:20:06 -0500 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=rwt2/BL4aXPPHoiljU05xnu6gA3+eEuKMF1gnyNsdEnyzKjDg3Bf3uvWtmUqW2EgR 5kVlEXAK2RWg8nXOjiA8g== Date: Mon, 15 Feb 2010 14:20:01 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrew Morton cc: Rik van Riel , KAMEZAWA Hiroyuki , Nick Piggin , Andrea Arcangeli , Balbir Singh , Lubos Lunak , KOSAKI Motohiro , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [patch -mm 1/9 v2] oom: filter tasks not sharing the same cpuset In-Reply-To: Message-ID: References: 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 Content-Length: 2106 Lines: 60 Tasks that do not share the same set of allowed nodes with the task that triggered the oom should not be considered as candidates for oom kill. Tasks in other cpusets with a disjoint set of mems would be unfairly penalized otherwise because of oom conditions elsewhere; an extreme example could unfairly kill all other applications on the system if a single task in a user's cpuset sets itself to OOM_DISABLE and then uses more memory than allowed. Killing tasks outside of current's cpuset rarely would free memory for current anyway. Acked-by: Rik van Riel Reviewed-by: KAMEZAWA Hiroyuki Signed-off-by: David Rientjes --- mm/oom_kill.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -35,7 +35,7 @@ static DEFINE_SPINLOCK(zone_scan_lock); /* #define DEBUG */ /* - * Is all threads of the target process nodes overlap ours? + * Do all threads of the target process overlap our allowed nodes? */ static int has_intersects_mems_allowed(struct task_struct *tsk) { @@ -167,14 +167,6 @@ unsigned long badness(struct task_struct *p, unsigned long uptime) points /= 4; /* - * If p's nodes don't overlap ours, it may still help to kill p - * because p may have allocated or otherwise mapped memory on - * this node before. However it will be less likely. - */ - if (!has_intersects_mems_allowed(p)) - points /= 8; - - /* * Adjust the score by oom_adj. */ if (oom_adj) { @@ -266,6 +258,8 @@ static struct task_struct *select_bad_process(unsigned long *ppoints, continue; if (mem && !task_in_mem_cgroup(p, mem)) continue; + if (!has_intersects_mems_allowed(p)) + continue; /* * This task already has access to memory reserves and is -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/