linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mem-hotplug: introduce movablenode option
@ 2016-08-04 11:23 Xishi Qiu
  2016-08-04 11:24 ` [PATCH 2/3] mem-hotplug: fix node spanned pages when we have a movable node Xishi Qiu
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Xishi Qiu @ 2016-08-04 11:23 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Vlastimil Babka,
	Mel Gorman, Andrew Morton, Michal Hocko, David Rientjes,
	Joonsoo Kim, Taku Izumi, 'Kirill A . Shutemov',
	Kamezawa Hiroyuki
  Cc: Linux MM, LKML

This patch introduces a new boot option movablenode.

To support memory hotplug, boot option "movable_node" is needed. And to
support debug memory hotplug, boot option "movable_node" and "movablenode"
are both needed.

e.g. movable_node movablenode=1,2,4

It means node 1,2,4 will be set to movable nodes, the other nodes are
unmovable nodes. Usually movable nodes are parsed from SRAT table which
offered by BIOS, so this boot option is used for debug.

Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
 Documentation/kernel-parameters.txt |  4 ++++
 arch/x86/mm/srat.c                  | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 82b42c9..f8726f8 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2319,6 +2319,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 	movable_node	[KNL,X86] Boot-time switch to enable the effects
 			of CONFIG_MOVABLE_NODE=y. See mm/Kconfig for details.
 
+	movablenode=	[KNL,X86] Boot-time switch to set which node is
+			movable node.
+			Format: <movable nid>,...,<movable nid>
+
 	MTD_Partition=	[MTD]
 			Format: <name>,<region-number>,<size>,<offset>
 
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c
index b5f8218..c4cd81a 100644
--- a/arch/x86/mm/srat.c
+++ b/arch/x86/mm/srat.c
@@ -157,6 +157,38 @@ static inline int save_add_info(void) {return 1;}
 static inline int save_add_info(void) {return 0;}
 #endif
 
+static nodemask_t movablenode_mask;
+
+static void __init parse_movablenode_one(char *p)
+{
+	int node;
+
+	get_option(&p, &node);
+	node_set(node, movablenode_mask);
+}
+
+/*
+ * movablenode=<movable nid>,...,<movable nid> sets which node is movable
+ * node.
+ */
+static int __init parse_movablenode_opt(char *str)
+{
+#ifdef CONFIG_MOVABLE_NODE
+	while (str) {
+		char *k = strchr(str, ',');
+
+		if (k)
+			*k++ = 0;
+		parse_movablenode_one(str);
+		str = k;
+	}
+#else
+	pr_warn("movable_node option not supported\n");
+#endif
+	return 0;
+}
+early_param("movablenode", parse_movablenode_opt);
+
 /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
 int __init
 acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
@@ -205,6 +237,10 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 
 	max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1));
 
+	if (node_isset(node, movablenode_mask) && memblock_mark_hotplug(start, ma->length))
+		pr_warn("SRAT debug: Failed to mark hotplug range [mem %#010Lx-%#010Lx] in memblock\n",
+			(unsigned long long)start, (unsigned long long)end - 1);
+
 	return 0;
 out_err_bad_srat:
 	bad_srat();
-- 
1.8.3.1


--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-08-16 11:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-04 11:23 [PATCH 1/3] mem-hotplug: introduce movablenode option Xishi Qiu
2016-08-04 11:24 ` [PATCH 2/3] mem-hotplug: fix node spanned pages when we have a movable node Xishi Qiu
2016-08-04 11:25 ` [PATCH 1/3] mm: fix set pageblock migratetype in deferred struct page init Xishi Qiu
2016-08-04 11:36   ` Xishi Qiu
2016-08-16  8:41   ` Michal Hocko
2016-08-16  8:56     ` Xishi Qiu
2016-08-16  9:23       ` Michal Hocko
2016-08-16 10:01         ` [PATCH v2] " Xishi Qiu
2016-08-16 10:12         ` [PATCH 1/3] " Vlastimil Babka
2016-08-16 10:20           ` Xishi Qiu
2016-08-16 11:10           ` Michal Hocko
2016-08-11 23:13 ` [PATCH 1/3] mem-hotplug: introduce movablenode option Andrew Morton
2016-08-15  1:40   ` Xishi Qiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).