diff options
-rw-r--r-- | drivers/base/node.c | 6 | ||||
-rw-r--r-- | include/linux/nodemask.h | 4 | ||||
-rw-r--r-- | mm/Kconfig | 8 | ||||
-rw-r--r-- | mm/page_alloc.c | 3 |
4 files changed, 21 insertions, 0 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index 49dbe7dc9ada..fac124a7e1c5 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -644,6 +644,9 @@ static struct node_attr node_state_attr[] = { | |||
644 | #ifdef CONFIG_HIGHMEM | 644 | #ifdef CONFIG_HIGHMEM |
645 | [N_HIGH_MEMORY] = _NODE_ATTR(has_high_memory, N_HIGH_MEMORY), | 645 | [N_HIGH_MEMORY] = _NODE_ATTR(has_high_memory, N_HIGH_MEMORY), |
646 | #endif | 646 | #endif |
647 | #ifdef CONFIG_MOVABLE_NODE | ||
648 | [N_MEMORY] = _NODE_ATTR(has_memory, N_MEMORY), | ||
649 | #endif | ||
647 | [N_CPU] = _NODE_ATTR(has_cpu, N_CPU), | 650 | [N_CPU] = _NODE_ATTR(has_cpu, N_CPU), |
648 | }; | 651 | }; |
649 | 652 | ||
@@ -654,6 +657,9 @@ static struct attribute *node_state_attrs[] = { | |||
654 | #ifdef CONFIG_HIGHMEM | 657 | #ifdef CONFIG_HIGHMEM |
655 | &node_state_attr[N_HIGH_MEMORY].attr.attr, | 658 | &node_state_attr[N_HIGH_MEMORY].attr.attr, |
656 | #endif | 659 | #endif |
660 | #ifdef CONFIG_MOVABLE_NODE | ||
661 | &node_state_attr[N_MEMORY].attr.attr, | ||
662 | #endif | ||
657 | &node_state_attr[N_CPU].attr.attr, | 663 | &node_state_attr[N_CPU].attr.attr, |
658 | NULL | 664 | NULL |
659 | }; | 665 | }; |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index c6ebdc97a428..4e2cbfa640b7 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -380,7 +380,11 @@ enum node_states { | |||
380 | #else | 380 | #else |
381 | N_HIGH_MEMORY = N_NORMAL_MEMORY, | 381 | N_HIGH_MEMORY = N_NORMAL_MEMORY, |
382 | #endif | 382 | #endif |
383 | #ifdef CONFIG_MOVABLE_NODE | ||
384 | N_MEMORY, /* The node has memory(regular, high, movable) */ | ||
385 | #else | ||
383 | N_MEMORY = N_HIGH_MEMORY, | 386 | N_MEMORY = N_HIGH_MEMORY, |
387 | #endif | ||
384 | N_CPU, /* The node has one or more cpus */ | 388 | N_CPU, /* The node has one or more cpus */ |
385 | NR_NODE_STATES | 389 | NR_NODE_STATES |
386 | }; | 390 | }; |
diff --git a/mm/Kconfig b/mm/Kconfig index e6651c5de14f..1680a0123a13 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
@@ -143,6 +143,14 @@ config NO_BOOTMEM | |||
143 | config MEMORY_ISOLATION | 143 | config MEMORY_ISOLATION |
144 | boolean | 144 | boolean |
145 | 145 | ||
146 | config MOVABLE_NODE | ||
147 | boolean "Enable to assign a node which has only movable memory" | ||
148 | depends on HAVE_MEMBLOCK | ||
149 | depends on NO_BOOTMEM | ||
150 | depends on X86_64 | ||
151 | depends on NUMA | ||
152 | default y | ||
153 | |||
146 | # eventually, we can have this option just 'select SPARSEMEM' | 154 | # eventually, we can have this option just 'select SPARSEMEM' |
147 | config MEMORY_HOTPLUG | 155 | config MEMORY_HOTPLUG |
148 | bool "Allow for memory hot-add" | 156 | bool "Allow for memory hot-add" |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 35727168896b..2bf0d43d646b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -90,6 +90,9 @@ nodemask_t node_states[NR_NODE_STATES] __read_mostly = { | |||
90 | #ifdef CONFIG_HIGHMEM | 90 | #ifdef CONFIG_HIGHMEM |
91 | [N_HIGH_MEMORY] = { { [0] = 1UL } }, | 91 | [N_HIGH_MEMORY] = { { [0] = 1UL } }, |
92 | #endif | 92 | #endif |
93 | #ifdef CONFIG_MOVABLE_NODE | ||
94 | [N_MEMORY] = { { [0] = 1UL } }, | ||
95 | #endif | ||
93 | [N_CPU] = { { [0] = 1UL } }, | 96 | [N_CPU] = { { [0] = 1UL } }, |
94 | #endif /* NUMA */ | 97 | #endif /* NUMA */ |
95 | }; | 98 | }; |