Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1372528

[PATCH 2/2] memory_hotplug: introduce memhp_default_state= command line parameter

From Vitaly Kuznetsov <vkuznets@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 2/2] memory_hotplug: introduce memhp_default_state= command line parameter
Date 2016-04-06 15:50 +0200
Message-ID <rkW0h-4AR-1@gated-at.bofh.it> (permalink)
References <rkW0h-4AR-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE specifies the default value for the
memory hotplug onlining policy. Add a command line parameter to make it
possible to override the default. It may come handy for debug and testing
purposes.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 Documentation/kernel-parameters.txt |  8 ++++++++
 mm/memory_hotplug.c                 | 11 +++++++++++
 2 files changed, 19 insertions(+)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index ecc74fa..b05ee2f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2141,6 +2141,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			[KNL,SH] Allow user to override the default size for
 			per-device physically contiguous DMA buffers.
 
+        memhp_default_state=online/offline
+			[KNL] Set the initial state for the memory hotplug
+			onlining policy. If not specified, the default value is
+			set according to the
+			CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE kernel config
+			option.
+			See Documentation/memory-hotplug.txt.
+
 	memmap=exactmap	[KNL,X86] Enable setting of an exact
 			E820 memory map, as specified by the user.
 			Such memmap=exactmap lines can be constructed based on
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 072e0a1..179f3af 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -85,6 +85,17 @@ bool memhp_auto_online = true;
 #endif
 EXPORT_SYMBOL_GPL(memhp_auto_online);
 
+static int __init setup_memhp_default_state(char *str)
+{
+	if (!strcmp(str, "online"))
+		memhp_auto_online = true;
+	else if (!strcmp(str, "offline"))
+		memhp_auto_online = false;
+
+	return 1;
+}
+__setup("memhp_default_state=", setup_memhp_default_state);
+
 void get_online_mems(void)
 {
 	might_sleep();
-- 
2.5.5

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/2] memory_hotplug: introduce memhp_default_state= command line parameter Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-04-06 15:50 +0200

csiph-web