diff options
author | Michal Hocko <mhocko@suse.com> | 2017-07-06 18:41:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-06 19:24:35 -0400 |
commit | f70029bbaacbfa8f082d2b4988717cba4e269f17 (patch) | |
tree | da4860c5227a317637194b6ca9ee4c6becfddb53 | |
parent | 57c0a17238e22395428248c53f8e390c051c88b8 (diff) |
mm, memory_hotplug: drop CONFIG_MOVABLE_NODE
Commit 20b2f52b73fe ("numa: add CONFIG_MOVABLE_NODE for
movable-dedicated node") has introduced CONFIG_MOVABLE_NODE without a
good explanation on why it is actually useful.
It makes a lot of sense to make movable node semantic opt in but we
already have that because the feature has to be explicitly enabled on
the kernel command line. A config option on top only makes the
configuration space larger without a good reason. It also adds an
additional ifdefery that pollutes the code.
Just drop the config option and make it de-facto always enabled. This
shouldn't introduce any change to the semantic.
Link: http://lkml.kernel.org/r/20170529114141.536-3-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Reza Arbab <arbab@linux.vnet.ibm.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Yasuaki Ishimatsu <yasu.isimatu@gmail.com>
Cc: Xishi Qiu <qiuxishi@huawei.com>
Cc: Kani Toshimitsu <toshi.kani@hpe.com>
Cc: Chen Yucong <slaoub@gmail.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | Documentation/admin-guide/kernel-parameters.txt | 7 | ||||
-rw-r--r-- | drivers/base/node.c | 4 | ||||
-rw-r--r-- | include/linux/memblock.h | 18 | ||||
-rw-r--r-- | include/linux/nodemask.h | 4 | ||||
-rw-r--r-- | mm/Kconfig | 26 | ||||
-rw-r--r-- | mm/memblock.c | 2 | ||||
-rw-r--r-- | mm/memory_hotplug.c | 4 | ||||
-rw-r--r-- | mm/page_alloc.c | 2 |
8 files changed, 5 insertions, 62 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 34ae9663aefd..dd7abbea8188 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -2303,8 +2303,11 @@ | |||
2303 | that the amount of memory usable for all allocations | 2303 | that the amount of memory usable for all allocations |
2304 | is not too small. | 2304 | is not too small. |
2305 | 2305 | ||
2306 | movable_node [KNL] Boot-time switch to enable the effects | 2306 | movable_node [KNL] Boot-time switch to make hotplugable memory |
2307 | of CONFIG_MOVABLE_NODE=y. See mm/Kconfig for details. | 2307 | NUMA nodes to be movable. This means that the memory |
2308 | of such nodes will be usable only for movable | ||
2309 | allocations which rules out almost all kernel | ||
2310 | allocations. Use with caution! | ||
2308 | 2311 | ||
2309 | MTD_Partition= [MTD] | 2312 | MTD_Partition= [MTD] |
2310 | Format: <name>,<region-number>,<size>,<offset> | 2313 | Format: <name>,<region-number>,<size>,<offset> |
diff --git a/drivers/base/node.c b/drivers/base/node.c index 6b1ee371ee97..73d39bc58c42 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -639,9 +639,7 @@ static struct node_attr node_state_attr[] = { | |||
639 | #ifdef CONFIG_HIGHMEM | 639 | #ifdef CONFIG_HIGHMEM |
640 | [N_HIGH_MEMORY] = _NODE_ATTR(has_high_memory, N_HIGH_MEMORY), | 640 | [N_HIGH_MEMORY] = _NODE_ATTR(has_high_memory, N_HIGH_MEMORY), |
641 | #endif | 641 | #endif |
642 | #ifdef CONFIG_MOVABLE_NODE | ||
643 | [N_MEMORY] = _NODE_ATTR(has_memory, N_MEMORY), | 642 | [N_MEMORY] = _NODE_ATTR(has_memory, N_MEMORY), |
644 | #endif | ||
645 | [N_CPU] = _NODE_ATTR(has_cpu, N_CPU), | 643 | [N_CPU] = _NODE_ATTR(has_cpu, N_CPU), |
646 | }; | 644 | }; |
647 | 645 | ||
@@ -652,9 +650,7 @@ static struct attribute *node_state_attrs[] = { | |||
652 | #ifdef CONFIG_HIGHMEM | 650 | #ifdef CONFIG_HIGHMEM |
653 | &node_state_attr[N_HIGH_MEMORY].attr.attr, | 651 | &node_state_attr[N_HIGH_MEMORY].attr.attr, |
654 | #endif | 652 | #endif |
655 | #ifdef CONFIG_MOVABLE_NODE | ||
656 | &node_state_attr[N_MEMORY].attr.attr, | 653 | &node_state_attr[N_MEMORY].attr.attr, |
657 | #endif | ||
658 | &node_state_attr[N_CPU].attr.attr, | 654 | &node_state_attr[N_CPU].attr.attr, |
659 | NULL | 655 | NULL |
660 | }; | 656 | }; |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 8098695e5d8d..1199e605d676 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -57,10 +57,8 @@ struct memblock { | |||
57 | 57 | ||
58 | extern struct memblock memblock; | 58 | extern struct memblock memblock; |
59 | extern int memblock_debug; | 59 | extern int memblock_debug; |
60 | #ifdef CONFIG_MOVABLE_NODE | ||
61 | /* If movable_node boot option specified */ | 60 | /* If movable_node boot option specified */ |
62 | extern bool movable_node_enabled; | 61 | extern bool movable_node_enabled; |
63 | #endif /* CONFIG_MOVABLE_NODE */ | ||
64 | 62 | ||
65 | #ifdef CONFIG_ARCH_DISCARD_MEMBLOCK | 63 | #ifdef CONFIG_ARCH_DISCARD_MEMBLOCK |
66 | #define __init_memblock __meminit | 64 | #define __init_memblock __meminit |
@@ -169,7 +167,6 @@ void __next_reserved_mem_region(u64 *idx, phys_addr_t *out_start, | |||
169 | i != (u64)ULLONG_MAX; \ | 167 | i != (u64)ULLONG_MAX; \ |
170 | __next_reserved_mem_region(&i, p_start, p_end)) | 168 | __next_reserved_mem_region(&i, p_start, p_end)) |
171 | 169 | ||
172 | #ifdef CONFIG_MOVABLE_NODE | ||
173 | static inline bool memblock_is_hotpluggable(struct memblock_region *m) | 170 | static inline bool memblock_is_hotpluggable(struct memblock_region *m) |
174 | { | 171 | { |
175 | return m->flags & MEMBLOCK_HOTPLUG; | 172 | return m->flags & MEMBLOCK_HOTPLUG; |
@@ -179,16 +176,6 @@ static inline bool __init_memblock movable_node_is_enabled(void) | |||
179 | { | 176 | { |
180 | return movable_node_enabled; | 177 | return movable_node_enabled; |
181 | } | 178 | } |
182 | #else | ||
183 | static inline bool memblock_is_hotpluggable(struct memblock_region *m) | ||
184 | { | ||
185 | return false; | ||
186 | } | ||
187 | static inline bool movable_node_is_enabled(void) | ||
188 | { | ||
189 | return false; | ||
190 | } | ||
191 | #endif | ||
192 | 179 | ||
193 | static inline bool memblock_is_mirror(struct memblock_region *m) | 180 | static inline bool memblock_is_mirror(struct memblock_region *m) |
194 | { | 181 | { |
@@ -296,7 +283,6 @@ phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid) | |||
296 | 283 | ||
297 | phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align); | 284 | phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align); |
298 | 285 | ||
299 | #ifdef CONFIG_MOVABLE_NODE | ||
300 | /* | 286 | /* |
301 | * Set the allocation direction to bottom-up or top-down. | 287 | * Set the allocation direction to bottom-up or top-down. |
302 | */ | 288 | */ |
@@ -314,10 +300,6 @@ static inline bool memblock_bottom_up(void) | |||
314 | { | 300 | { |
315 | return memblock.bottom_up; | 301 | return memblock.bottom_up; |
316 | } | 302 | } |
317 | #else | ||
318 | static inline void __init memblock_set_bottom_up(bool enable) {} | ||
319 | static inline bool memblock_bottom_up(void) { return false; } | ||
320 | #endif | ||
321 | 303 | ||
322 | /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ | 304 | /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ |
323 | #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) | 305 | #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index f746e44d4046..cf0b91c3ec12 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -387,11 +387,7 @@ enum node_states { | |||
387 | #else | 387 | #else |
388 | N_HIGH_MEMORY = N_NORMAL_MEMORY, | 388 | N_HIGH_MEMORY = N_NORMAL_MEMORY, |
389 | #endif | 389 | #endif |
390 | #ifdef CONFIG_MOVABLE_NODE | ||
391 | N_MEMORY, /* The node has memory(regular, high, movable) */ | 390 | N_MEMORY, /* The node has memory(regular, high, movable) */ |
392 | #else | ||
393 | N_MEMORY = N_HIGH_MEMORY, | ||
394 | #endif | ||
395 | N_CPU, /* The node has one or more cpus */ | 391 | N_CPU, /* The node has one or more cpus */ |
396 | NR_NODE_STATES | 392 | NR_NODE_STATES |
397 | }; | 393 | }; |
diff --git a/mm/Kconfig b/mm/Kconfig index 9870baafb096..857f6ef368d4 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
@@ -149,32 +149,6 @@ config NO_BOOTMEM | |||
149 | config MEMORY_ISOLATION | 149 | config MEMORY_ISOLATION |
150 | bool | 150 | bool |
151 | 151 | ||
152 | config MOVABLE_NODE | ||
153 | bool "Enable to assign a node which has only movable memory" | ||
154 | depends on HAVE_MEMBLOCK | ||
155 | depends on NO_BOOTMEM | ||
156 | depends on X86_64 || OF_EARLY_FLATTREE || MEMORY_HOTPLUG | ||
157 | depends on NUMA | ||
158 | default n | ||
159 | help | ||
160 | Allow a node to have only movable memory. Pages used by the kernel, | ||
161 | such as direct mapping pages cannot be migrated. So the corresponding | ||
162 | memory device cannot be hotplugged. This option allows the following | ||
163 | two things: | ||
164 | - When the system is booting, node full of hotpluggable memory can | ||
165 | be arranged to have only movable memory so that the whole node can | ||
166 | be hot-removed. (need movable_node boot option specified). | ||
167 | - After the system is up, the option allows users to online all the | ||
168 | memory of a node as movable memory so that the whole node can be | ||
169 | hot-removed. | ||
170 | |||
171 | Users who don't use the memory hotplug feature are fine with this | ||
172 | option on since they don't specify movable_node boot option or they | ||
173 | don't online memory as movable. | ||
174 | |||
175 | Say Y here if you want to hotplug a whole node. | ||
176 | Say N here if you want kernel to use memory on all nodes evenly. | ||
177 | |||
178 | # | 152 | # |
179 | # Only be set on architectures that have completely implemented memory hotplug | 153 | # Only be set on architectures that have completely implemented memory hotplug |
180 | # feature. If you are not sure, don't touch it. | 154 | # feature. If you are not sure, don't touch it. |
diff --git a/mm/memblock.c b/mm/memblock.c index 7b8a5db76a2f..41eaeebb03dc 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -54,9 +54,7 @@ struct memblock memblock __initdata_memblock = { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | int memblock_debug __initdata_memblock; | 56 | int memblock_debug __initdata_memblock; |
57 | #ifdef CONFIG_MOVABLE_NODE | ||
58 | bool movable_node_enabled __initdata_memblock = false; | 57 | bool movable_node_enabled __initdata_memblock = false; |
59 | #endif | ||
60 | static bool system_has_some_mirror __initdata_memblock = false; | 58 | static bool system_has_some_mirror __initdata_memblock = false; |
61 | static int memblock_can_resize __initdata_memblock; | 59 | static int memblock_can_resize __initdata_memblock; |
62 | static int memblock_memory_in_slab __initdata_memblock = 0; | 60 | static int memblock_memory_in_slab __initdata_memblock = 0; |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 937319899e61..0dc8cf0a59d7 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -1572,11 +1572,7 @@ check_pages_isolated(unsigned long start_pfn, unsigned long end_pfn) | |||
1572 | 1572 | ||
1573 | static int __init cmdline_parse_movable_node(char *p) | 1573 | static int __init cmdline_parse_movable_node(char *p) |
1574 | { | 1574 | { |
1575 | #ifdef CONFIG_MOVABLE_NODE | ||
1576 | movable_node_enabled = true; | 1575 | movable_node_enabled = true; |
1577 | #else | ||
1578 | pr_warn("movable_node option not supported\n"); | ||
1579 | #endif | ||
1580 | return 0; | 1576 | return 0; |
1581 | } | 1577 | } |
1582 | early_param("movable_node", cmdline_parse_movable_node); | 1578 | early_param("movable_node", cmdline_parse_movable_node); |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a35add8d7c0b..bd65b60939b6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -113,9 +113,7 @@ nodemask_t node_states[NR_NODE_STATES] __read_mostly = { | |||
113 | #ifdef CONFIG_HIGHMEM | 113 | #ifdef CONFIG_HIGHMEM |
114 | [N_HIGH_MEMORY] = { { [0] = 1UL } }, | 114 | [N_HIGH_MEMORY] = { { [0] = 1UL } }, |
115 | #endif | 115 | #endif |
116 | #ifdef CONFIG_MOVABLE_NODE | ||
117 | [N_MEMORY] = { { [0] = 1UL } }, | 116 | [N_MEMORY] = { { [0] = 1UL } }, |
118 | #endif | ||
119 | [N_CPU] = { { [0] = 1UL } }, | 117 | [N_CPU] = { { [0] = 1UL } }, |
120 | #endif /* NUMA */ | 118 | #endif /* NUMA */ |
121 | }; | 119 | }; |