Skip to content

Commit f70029b

Browse files
Michal Hockotorvalds
authored andcommitted
mm, memory_hotplug: drop CONFIG_MOVABLE_NODE
Commit 20b2f52 ("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>
1 parent 57c0a17 commit f70029b

8 files changed

Lines changed: 5 additions & 62 deletions

File tree

‎Documentation/admin-guide/kernel-parameters.txt‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,8 +2303,11 @@
23032303
that the amount of memory usable for all allocations
23042304
is not too small.
23052305

2306-
movable_node [KNL] Boot-time switch to enable the effects
2307-
of CONFIG_MOVABLE_NODE=y. See mm/Kconfig for details.
2306+
movable_node [KNL] Boot-time switch to make hotplugable memory
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!
23082311

23092312
MTD_Partition= [MTD]
23102313
Format: <name>,<region-number>,<size>,<offset>

‎drivers/base/node.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,7 @@ static struct node_attr node_state_attr[] = {
639639
#ifdef CONFIG_HIGHMEM
640640
[N_HIGH_MEMORY] = _NODE_ATTR(has_high_memory, N_HIGH_MEMORY),
641641
#endif
642-
#ifdef CONFIG_MOVABLE_NODE
643642
[N_MEMORY] = _NODE_ATTR(has_memory, N_MEMORY),
644-
#endif
645643
[N_CPU] = _NODE_ATTR(has_cpu, N_CPU),
646644
};
647645

@@ -652,9 +650,7 @@ static struct attribute *node_state_attrs[] = {
652650
#ifdef CONFIG_HIGHMEM
653651
&node_state_attr[N_HIGH_MEMORY].attr.attr,
654652
#endif
655-
#ifdef CONFIG_MOVABLE_NODE
656653
&node_state_attr[N_MEMORY].attr.attr,
657-
#endif
658654
&node_state_attr[N_CPU].attr.attr,
659655
NULL
660656
};

‎include/linux/memblock.h‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ struct memblock {
5757

5858
extern struct memblock memblock;
5959
extern int memblock_debug;
60-
#ifdef CONFIG_MOVABLE_NODE
6160
/* If movable_node boot option specified */
6261
extern bool movable_node_enabled;
63-
#endif /* CONFIG_MOVABLE_NODE */
6462

6563
#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
6664
#define __init_memblock __meminit
@@ -169,7 +167,6 @@ void __next_reserved_mem_region(u64 *idx, phys_addr_t *out_start,
169167
i != (u64)ULLONG_MAX; \
170168
__next_reserved_mem_region(&i, p_start, p_end))
171169

172-
#ifdef CONFIG_MOVABLE_NODE
173170
static inline bool memblock_is_hotpluggable(struct memblock_region *m)
174171
{
175172
return m->flags & MEMBLOCK_HOTPLUG;
@@ -179,16 +176,6 @@ static inline bool __init_memblock movable_node_is_enabled(void)
179176
{
180177
return movable_node_enabled;
181178
}
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
192179

193180
static inline bool memblock_is_mirror(struct memblock_region *m)
194181
{
@@ -296,7 +283,6 @@ phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid)
296283

297284
phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
298285

299-
#ifdef CONFIG_MOVABLE_NODE
300286
/*
301287
* Set the allocation direction to bottom-up or top-down.
302288
*/
@@ -314,10 +300,6 @@ static inline bool memblock_bottom_up(void)
314300
{
315301
return memblock.bottom_up;
316302
}
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
321303

322304
/* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
323305
#define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)

‎include/linux/nodemask.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,7 @@ enum node_states {
387387
#else
388388
N_HIGH_MEMORY = N_NORMAL_MEMORY,
389389
#endif
390-
#ifdef CONFIG_MOVABLE_NODE
391390
N_MEMORY, /* The node has memory(regular, high, movable) */
392-
#else
393-
N_MEMORY = N_HIGH_MEMORY,
394-
#endif
395391
N_CPU, /* The node has one or more cpus */
396392
NR_NODE_STATES
397393
};

‎mm/Kconfig‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -149,32 +149,6 @@ config NO_BOOTMEM
149149
config MEMORY_ISOLATION
150150
bool
151151

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-
178152
#
179153
# Only be set on architectures that have completely implemented memory hotplug
180154
# feature. If you are not sure, don't touch it.

‎mm/memblock.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ struct memblock memblock __initdata_memblock = {
5454
};
5555

5656
int memblock_debug __initdata_memblock;
57-
#ifdef CONFIG_MOVABLE_NODE
5857
bool movable_node_enabled __initdata_memblock = false;
59-
#endif
6058
static bool system_has_some_mirror __initdata_memblock = false;
6159
static int memblock_can_resize __initdata_memblock;
6260
static int memblock_memory_in_slab __initdata_memblock = 0;

‎mm/memory_hotplug.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,11 +1572,7 @@ check_pages_isolated(unsigned long start_pfn, unsigned long end_pfn)
15721572

15731573
static int __init cmdline_parse_movable_node(char *p)
15741574
{
1575-
#ifdef CONFIG_MOVABLE_NODE
15761575
movable_node_enabled = true;
1577-
#else
1578-
pr_warn("movable_node option not supported\n");
1579-
#endif
15801576
return 0;
15811577
}
15821578
early_param("movable_node", cmdline_parse_movable_node);

‎mm/page_alloc.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ nodemask_t node_states[NR_NODE_STATES] __read_mostly = {
113113
#ifdef CONFIG_HIGHMEM
114114
[N_HIGH_MEMORY] = { { [0] = 1UL } },
115115
#endif
116-
#ifdef CONFIG_MOVABLE_NODE
117116
[N_MEMORY] = { { [0] = 1UL } },
118-
#endif
119117
[N_CPU] = { { [0] = 1UL } },
120118
#endif /* NUMA */
121119
};

0 commit comments

Comments
 (0)