Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932302Ab0BOWUW (ORCPT ); Mon, 15 Feb 2010 17:20:22 -0500 Received: from smtp-out.google.com ([216.239.33.17]:44897 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932268Ab0BOWUQ (ORCPT ); Mon, 15 Feb 2010 17:20:16 -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=e0vZYW4lHhtL+DqRv0G5b7NB+3Iphj6YjVP8RL6yEkCPknYRepO/4x+MYf6VrYo6Q 9sxt/3HEUvFC7t4RNqisw== Date: Mon, 15 Feb 2010 14:20:09 -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 4/9 v2] oom: remove compulsory panic_on_oom mode 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: 2876 Lines: 70 If /proc/sys/vm/panic_on_oom is set to 2, the kernel will panic regardless of whether the memory allocation is constrained by either a mempolicy or cpuset. Since mempolicy-constrained out of memory conditions now iterate through the tasklist and select a task to kill, it is possible to panic the machine if all tasks sharing the same mempolicy nodes (including those with default policy, they may allocate anywhere) or cpuset mems have /proc/pid/oom_adj values of OOM_DISABLE. This is functionally equivalent to the compulsory panic_on_oom setting of 2, so the mode is removed. Signed-off-by: David Rientjes --- Documentation/sysctl/vm.txt | 20 ++++---------------- mm/oom_kill.c | 5 ----- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt @@ -559,25 +559,13 @@ swap-intensive. panic_on_oom -This enables or disables panic on out-of-memory feature. +If this is set to zero, the oom killer will be invoked when the kernel is out of +memory and direct reclaim cannot free any pages. It will select a memory- +hogging task that frees up a large amount of memory to kill. -If this is set to 0, the kernel will kill some rogue process, -called oom_killer. Usually, oom_killer can kill rogue processes and -system will survive. - -If this is set to 1, the kernel panics when out-of-memory happens. -However, if a process limits using nodes by mempolicy/cpusets, -and those nodes become memory exhaustion status, one process -may be killed by oom-killer. No panic occurs in this case. -Because other nodes' memory may be free. This means system total status -may be not fatal yet. - -If this is set to 2, the kernel panics compulsorily even on the -above-mentioned. +If this is set to non-zero, the machine will panic when out of memory. The default value is 0. -1 and 2 are for failover of clustering. Please select either -according to your policy of failover. ============================================================= diff --git a/mm/oom_kill.c b/mm/oom_kill.c --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -672,11 +672,6 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, /* Got some memory back in the last second. */ return; - if (sysctl_panic_on_oom == 2) { - dump_header(NULL, gfp_mask, order, NULL); - panic("out of memory. Compulsory panic_on_oom is selected.\n"); - } - /* * Check if there were limitations on the allocation (only relevant for * NUMA) that may require different handling. -- 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/