]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
memory-hotplug: introduce CONFIG_HAVE_BOOTMEM_INFO_NODE and revert register_page_boot...
authorLin Feng <linfeng@cn.fujitsu.com>
Thu, 7 Feb 2013 01:26:25 +0000 (12:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:46:24 +0000 (16:46 +1100)
It's implemented by adding a new Kconfig option named
CONFIG_HAVE_BOOTMEM_INFO_NODE, which will be automatically selected by
memory-hotplug feature fully supported archs(currently only on x86_64).

Signed-off-by: Lin Feng <linfeng@cn.fujitsu.com>
Reported-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/mm/init_64.c
include/linux/memory_hotplug.h
mm/Kconfig
mm/memory_hotplug.c

index 5d3e8fa2801a2f46809a944533c12fb4994b055c..f17aa76dc1ae2d435b3e889522250f6c771bc1b3 100644 (file)
@@ -1034,7 +1034,7 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
        return 0;
 }
 
-#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
+#if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HAVE_BOOTMEM_INFO_NODE)
 void register_page_bootmem_memmap(unsigned long section_nr,
                                  struct page *start_page, unsigned long size)
 {
index 2441f36b7ccc85caaee6dbf2732d44de6c2c8e19..4d523fe75ba19355048c614bfeb442c445261f0c 100644 (file)
@@ -174,7 +174,13 @@ static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
 #endif /* CONFIG_NUMA */
 #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */
 
+#ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE
 extern void register_page_bootmem_info_node(struct pglist_data *pgdat);
+#else
+static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
+{
+}
+#endif
 extern void put_page_bootmem(struct page *page);
 extern void get_page_bootmem(unsigned long ingo, struct page *page,
                             unsigned long type);
index 308fdcaeed7780c27d0c03fd5710b14ab190dff8..a394ab027451a68d4fcd44a28d6afa14e0b03ec1 100644 (file)
@@ -162,10 +162,18 @@ config MOVABLE_NODE
          Say Y here if you want to hotplug a whole node.
          Say N here if you want kernel to use memory on all nodes evenly.
 
+#
+# Only be set on architectures that have completely implemented memory hotplug
+# feature. If you are not sure, don't touch it.
+#
+config HAVE_BOOTMEM_INFO_NODE
+       def_bool n
+
 # eventually, we can have this option just 'select SPARSEMEM'
 config MEMORY_HOTPLUG
        bool "Allow for memory hot-add"
        select MEMORY_ISOLATION
+       select HAVE_BOOTMEM_INFO_NODE if X86_64
        depends on SPARSEMEM || X86_64_ACPI_NUMA
        depends on HOTPLUG && ARCH_ENABLE_MEMORY_HOTPLUG
        depends on (IA64 || X86 || PPC_BOOK3S_64 || SUPERH || S390)
index e09282de48573913e08413f3e6c13475312fcc8f..a15f082668a2787ec285951f468d35a31dd10983 100644 (file)
@@ -188,6 +188,7 @@ static void register_page_bootmem_info_section(unsigned long start_pfn)
 }
 #endif
 
+#ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE
 void register_page_bootmem_info_node(struct pglist_data *pgdat)
 {
        unsigned long i, pfn, end_pfn, nr_pages;
@@ -229,6 +230,7 @@ void register_page_bootmem_info_node(struct pglist_data *pgdat)
                        register_page_bootmem_info_section(pfn);
        }
 }
+#endif
 
 static void grow_zone_span(struct zone *zone, unsigned long start_pfn,
                           unsigned long end_pfn)