]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/page_alloc.c
[PATCH] sparsemem base: simple NUMA remap space allocator
[karo-tx-linux.git] / mm / page_alloc.c
index 206920796f5f68cb176afa138238bd3584106a5a..bf1dd88190972bce44043098ca7be8105c53c436 100644 (file)
@@ -1742,10 +1742,17 @@ inline void setup_pageset(struct per_cpu_pageset *p, unsigned long batch)
  * with interrupts disabled.
  *
  * Some NUMA counter updates may also be caught by the boot pagesets.
- * These will be discarded when bootup is complete.
+ *
+ * The boot_pagesets must be kept even after bootup is complete for
+ * unused processors and/or zones. They do play a role for bootstrapping
+ * hotplugged processors.
+ *
+ * zoneinfo_show() and maybe other functions do
+ * not check if the processor is online before following the pageset pointer.
+ * Other parts of the kernel may not check if the zone is available.
  */
 static struct per_cpu_pageset
-       boot_pageset[NR_CPUS] __initdata;
+       boot_pageset[NR_CPUS];
 
 /*
  * Dynamically allocate memory for the
@@ -1929,6 +1936,7 @@ static void __init free_area_init_core(struct pglist_data *pgdat,
 static void __init alloc_node_mem_map(struct pglist_data *pgdat)
 {
        unsigned long size;
+       struct page *map;
 
        /* Skip empty nodes */
        if (!pgdat->node_spanned_pages)
@@ -1937,7 +1945,10 @@ static void __init alloc_node_mem_map(struct pglist_data *pgdat)
        /* ia64 gets its own node_mem_map, before this, without bootmem */
        if (!pgdat->node_mem_map) {
                size = (pgdat->node_spanned_pages + 1) * sizeof(struct page);
-               pgdat->node_mem_map = alloc_bootmem_node(pgdat, size);
+               map = alloc_remap(pgdat->node_id, size);
+               if (!map)
+                       map = alloc_bootmem_node(pgdat, size);
+               pgdat->node_mem_map = map;
        }
 #ifndef CONFIG_DISCONTIGMEM
        /*