This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Sun May 12 14:36:55 2024 >From spaans Tue May 10 14:15:56 2016 Envelope-to: lkml@grols.ch Delivery-date: Tue, 10 May 2016 14:01:07 +0200 Received: from srv.grols.ch [2a00:d10:4002:1::101] by squeeze.vs19.net with IMAP (fetchmail-6.3.21) for (single-drop); Tue, 10 May 2016 14:15:56 +0200 (CEST) Received: from vger.kernel.org ([209.132.180.67]) by home.grols.ch with esmtp (Exim 4.87) (envelope-from ) id 1b06La-0003uM-PT for lkml@grols.ch; Tue, 10 May 2016 14:01:07 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751441AbcEJMAv (ORCPT ); Tue, 10 May 2016 08:00:51 -0400 Received: from smtpoutz300.laposte.net ([178.22.154.200]:41199 "EHLO smtp.laposte.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751054AbcEJMAt (ORCPT ); Tue, 10 May 2016 08:00:49 -0400 Received: from smtp.laposte.net (localhost [127.0.0.1]) by lpn-prd-vrout012 (Postfix) with ESMTP id ED1838C9E4 for ; Tue, 10 May 2016 14:00:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=mail1; t=1462881647; bh=U1D0Xq+AzuFSbzsnmwQZr3TCun5KjXTlbSR8eK71nak=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=jxnbP13o9Jbg1nonst2MT5VJI5EspPiyQx6sBPdIgsA0FolS6s9ZaYmiR7qnVXBdD 3lB75TCMb91w Received: from lpn-prd-vrin001 (lpn-prd-vrin001.laposte [10.128.63.2]) by lpn-prd-vrout012 (Postfix) with ESMTP id E871D8C658 for ; Tue, 10 May 2016 14:00:47 +0200 (CEST) Received: from lpn-prd-vrin001 (localhost [127.0.0.1]) by lpn-prd-vrin001 (Postfix) with ESMTP id D4567366995 for ; Tue, 10 May 2016 14:00:47 +0200 (CEST) Received: from [172.27.0.214] (ovpn12414.celeste.fr [83.142.147.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lpn-prd-vrin001 (Postfix) with ESMTPSA id 7D8CE366979; Tue, 10 May 2016 14:00:47 +0200 (CEST) Message-Id: <5731CD6F.9070101@laposte.net> Date: Tue, 10 May 2016 14:00:47 +0200 From: Sebastian Frias User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 Mime-Version: 1.0 To: Andy Whitcroft , Joe Perches Cc: mason , LKML Subject: Fwd: [PATCH] mm: add config option to select the initial overcommit mode References: <5731CC6E.3080807@laposte.net> In-Reply-To: <5731CC6E.3080807@laposte.net> X-Forwarded-Message-Id: <5731CC6E.3080807@laposte.net> Content-Type: multipart/mixed; boundary="------------080000040907030100070201" X-VR-SrcIP: 83.142.147.193 X-VR-FullState: 0 X-VR-Score: 0 X-VR-Cause-1: gggruggvucftvghtrhhoucdtuddrfeekledrudeggdegjecutefuodetggdotefrodftvfcurfhrohhf X-VR-Cause-2: ihhlvgemucfntefrqffuvffgnecuuegrihhlohhuthemucehtddtnecunecujfgurhepkfffhfgfggfv X-VR-Cause-3: ufhfjggtsehmtdgrrgdtfeejnecuhfhrohhmpefuvggsrghsthhirghnucfhrhhirghsuceoshhfkeeg X-VR-Cause-4: sehlrghpohhsthgvrdhnvghtqeenucfkphepkeefrddugedvrddugeejrdduleefnecurfgrrhgrmhep X-VR-Cause-5: mhhouggvpehsmhhtphhouhhtpdhhvghloheplgdujedvrddvjedrtddrvddugegnpdhinhgvthepkeef X-VR-Cause-6: rddugedvrddugeejrdduleefpdhmrghilhhfrhhomhepshhfkeegsehlrghpohhsthgvrdhnvghtpdhr X-VR-Cause-7: tghpthhtoheprghpfiestggrnhhonhhitggrlhdrtghomh X-VR-AvState: No X-VR-State: 0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-Id: X-Mailing-List: linux-kernel@vger.kernel.org Received-SPF: none client-ip=209.132.180.67; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org X-Spam-Score: 8.2 X-Spam-Score-Bar: ++++++++ X-Spam-Action: add header X-Spam-Report: Action: add header Symbol: BAYES_SPAM(3.99) Symbol: FORGED_RECIPIENTS(2.00) Symbol: BROKEN_HEADERS(1.00) Symbol: FORGED_SENDER(0.30) Symbol: MIME_GOOD(-0.10) Symbol: R_DKIM_REJECT(1.00) Message-ID: 5731CD6F.9070101@laposte.net This is a multi-part message in MIME format. --------------080000040907030100070201 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, Using checkpatch.pl on the forwarded patch results in: WARNING: please write a paragraph that describes the config symbol fully #57: FILE: mm/Kconfig:451: + config OVERCOMMIT_GUESS WARNING: please write a paragraph that describes the config symbol fully #64: FILE: mm/Kconfig:458: + config OVERCOMMIT_ALWAYS but there is a 'help' section for those 'config' sections. NOTE: I followed the same indentation than the code laying just above the place where I inserted mine. I think it is a false positive, what do you think? Best regards, Sebastian --------------080000040907030100070201 Content-Type: message/rfc822; name="[PATCH] mm: add config option to select the initial overcommit mode.eml" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="[PATCH] mm: add config option to select the initial overcomm"; filename*1="it mode.eml" Message-ID: <5731CC6E.3080807@laposte.net> Date: Tue, 10 May 2016 13:56:30 +0200 From: Sebastian Frias User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: linux-mm@kvack.org, Andrew Morton , Michal Hocko , Linus Torvalds CC: LKML , mason Subject: [PATCH] mm: add config option to select the initial overcommit mode Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Currently the initial value of the overcommit mode is OVERCOMMIT_GUESS. However, on embedded systems it is usually better to disable overcommit to avoid waking up the OOM-killer and its well known undesirable side-effects. This config option allows to setup the initial overcommit mode to any of the 3 available values, OVERCOMMIT_GUESS (which remains as default), OVERCOMMIT_ALWAYS and OVERCOMMIT_NEVER. The overcommit mode can still be changed thru sysctl after the system boots up. This config option depends on CONFIG_EXPERT. This patch does not introduces functional changes. Signed-off-by: Sebastian Frias --- NOTE: I understand that the overcommit mode can be changed dynamically thru sysctl, but on embedded systems, where we know in advance that overcommit will be disabled, there's no reason to postpone such setting. I would also be interested in knowing if you guys think this option should disable sysctl access for overcommit mode, essentially hardcoding the overcommit mode when this option is used. NOTE2: I tried to track down the history of overcommit but back then there were no single patches apparently and the patch that appears to have introduced the first overcommit mode (OVERCOMMIT_ALWAYS) is commit 9334eab8a36f ("Import 2.1.27"). OVERCOMMIT_NEVER was introduced with commit 502bff0685b2 ("[PATCH] strict overcommit"). My understanding is that prior to commit 9334eab8a36f ("Import 2.1.27") there was no overcommit, is that correct? NOTE3: checkpatch.pl is warning about missing description for the config symbols ("please write a paragraph that describes the config symbol fully") but my understanding is that that is a false positive (or the warning message not clear enough for me to understand it) considering that I have added 'help' sections for each 'config' section. --- mm/Kconfig | 32 ++++++++++++++++++++++++++++++++ mm/util.c | 8 +++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/mm/Kconfig b/mm/Kconfig index abb7dcf..6dad57d 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -439,6 +439,38 @@ choice benefit. endchoice +choice + prompt "Overcommit Mode" + default OVERCOMMIT_GUESS + depends on EXPERT + help + Selects the initial value for Overcommit mode. + + NOTE: The overcommit mode can be changed dynamically through sysctl. + + config OVERCOMMIT_GUESS + bool "Guess" + help + Selecting this option forces the initial value of overcommit mode to + "Guess" overcommits. This is the default value. + See Documentation/vm/overcommit-accounting for more information. + + config OVERCOMMIT_ALWAYS + bool "Always" + help + Selecting this option forces the initial value of overcommit mode to + "Always" overcommit. + See Documentation/vm/overcommit-accounting for more information. + + config OVERCOMMIT_NEVER + bool "Never" + help + Selecting this option forces the initial value of overcommit mode to + "Never" overcommit. + See Documentation/vm/overcommit-accounting for more information. + +endchoice + # # UP and nommu archs use km based percpu allocator # diff --git a/mm/util.c b/mm/util.c index 917e0e3..fd098bb 100644 --- a/mm/util.c +++ b/mm/util.c @@ -418,7 +418,13 @@ int __page_mapcount(struct page *page) } EXPORT_SYMBOL_GPL(__page_mapcount); -int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_GUESS; +#if defined(CONFIG_OVERCOMMIT_NEVER) +int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_NEVER; +#elif defined(CONFIG_OVERCOMMIT_ALWAYS) +int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_ALWAYS; +#else +int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_GUESS; +#endif int sysctl_overcommit_ratio __read_mostly = 50; unsigned long sysctl_overcommit_kbytes __read_mostly; int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; -- 2.1.4 --------------080000040907030100070201--