diff options
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/memory_hotplug.c | 2 | ||||
| -rw-r--r-- | mm/page_alloc.c | 2 | ||||
| -rw-r--r-- | mm/slub.c | 22 | ||||
| -rw-r--r-- | mm/sparse.c | 11 |
4 files changed, 34 insertions, 3 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 84279127fcd3..df9d554bea30 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
| @@ -65,7 +65,7 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn) | |||
| 65 | int zone_type; | 65 | int zone_type; |
| 66 | 66 | ||
| 67 | zone_type = zone - pgdat->node_zones; | 67 | zone_type = zone - pgdat->node_zones; |
| 68 | if (!populated_zone(zone)) { | 68 | if (!zone->wait_table) { |
| 69 | int ret = 0; | 69 | int ret = 0; |
| 70 | ret = init_currently_empty_zone(zone, phys_start_pfn, | 70 | ret = init_currently_empty_zone(zone, phys_start_pfn, |
| 71 | nr_pages, MEMMAP_HOTPLUG); | 71 | nr_pages, MEMMAP_HOTPLUG); |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d8970623c566..bd8e33582d25 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -2689,7 +2689,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) | |||
| 2689 | map = alloc_bootmem_node(pgdat, size); | 2689 | map = alloc_bootmem_node(pgdat, size); |
| 2690 | pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); | 2690 | pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); |
| 2691 | } | 2691 | } |
| 2692 | #ifdef CONFIG_FLATMEM | 2692 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
| 2693 | /* | 2693 | /* |
| 2694 | * With no DISCONTIG, the global mem_map is just set as node 0's | 2694 | * With no DISCONTIG, the global mem_map is just set as node 0's |
| 2695 | */ | 2695 | */ |
| @@ -2435,6 +2435,7 @@ void __init kmem_cache_init(void) | |||
| 2435 | */ | 2435 | */ |
| 2436 | create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node", | 2436 | create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node", |
| 2437 | sizeof(struct kmem_cache_node), GFP_KERNEL); | 2437 | sizeof(struct kmem_cache_node), GFP_KERNEL); |
| 2438 | kmalloc_caches[0].refcount = -1; | ||
| 2438 | #endif | 2439 | #endif |
| 2439 | 2440 | ||
| 2440 | /* Able to allocate the per node structures */ | 2441 | /* Able to allocate the per node structures */ |
| @@ -2482,6 +2483,12 @@ static int slab_unmergeable(struct kmem_cache *s) | |||
| 2482 | if (s->ctor) | 2483 | if (s->ctor) |
| 2483 | return 1; | 2484 | return 1; |
| 2484 | 2485 | ||
| 2486 | /* | ||
| 2487 | * We may have set a slab to be unmergeable during bootstrap. | ||
| 2488 | */ | ||
| 2489 | if (s->refcount < 0) | ||
| 2490 | return 1; | ||
| 2491 | |||
| 2485 | return 0; | 2492 | return 0; |
| 2486 | } | 2493 | } |
| 2487 | 2494 | ||
| @@ -2601,6 +2608,19 @@ static void for_all_slabs(void (*func)(struct kmem_cache *, int), int cpu) | |||
| 2601 | } | 2608 | } |
| 2602 | 2609 | ||
| 2603 | /* | 2610 | /* |
| 2611 | * Version of __flush_cpu_slab for the case that interrupts | ||
| 2612 | * are enabled. | ||
| 2613 | */ | ||
| 2614 | static void cpu_slab_flush(struct kmem_cache *s, int cpu) | ||
| 2615 | { | ||
| 2616 | unsigned long flags; | ||
| 2617 | |||
| 2618 | local_irq_save(flags); | ||
| 2619 | __flush_cpu_slab(s, cpu); | ||
| 2620 | local_irq_restore(flags); | ||
| 2621 | } | ||
| 2622 | |||
| 2623 | /* | ||
| 2604 | * Use the cpu notifier to insure that the cpu slabs are flushed when | 2624 | * Use the cpu notifier to insure that the cpu slabs are flushed when |
| 2605 | * necessary. | 2625 | * necessary. |
| 2606 | */ | 2626 | */ |
| @@ -2614,7 +2634,7 @@ static int __cpuinit slab_cpuup_callback(struct notifier_block *nfb, | |||
| 2614 | case CPU_UP_CANCELED_FROZEN: | 2634 | case CPU_UP_CANCELED_FROZEN: |
| 2615 | case CPU_DEAD: | 2635 | case CPU_DEAD: |
| 2616 | case CPU_DEAD_FROZEN: | 2636 | case CPU_DEAD_FROZEN: |
| 2617 | for_all_slabs(__flush_cpu_slab, cpu); | 2637 | for_all_slabs(cpu_slab_flush, cpu); |
| 2618 | break; | 2638 | break; |
| 2619 | default: | 2639 | default: |
| 2620 | break; | 2640 | break; |
diff --git a/mm/sparse.c b/mm/sparse.c index 1302f8348d51..545e4d3afcdf 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
| @@ -209,6 +209,12 @@ static int __meminit sparse_init_one_section(struct mem_section *ms, | |||
| 209 | return 1; | 209 | return 1; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | __attribute__((weak)) | ||
| 213 | void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size) | ||
| 214 | { | ||
| 215 | return NULL; | ||
| 216 | } | ||
| 217 | |||
| 212 | static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) | 218 | static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) |
| 213 | { | 219 | { |
| 214 | struct page *map; | 220 | struct page *map; |
| @@ -219,6 +225,11 @@ static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) | |||
| 219 | if (map) | 225 | if (map) |
| 220 | return map; | 226 | return map; |
| 221 | 227 | ||
| 228 | map = alloc_bootmem_high_node(NODE_DATA(nid), | ||
| 229 | sizeof(struct page) * PAGES_PER_SECTION); | ||
| 230 | if (map) | ||
| 231 | return map; | ||
| 232 | |||
| 222 | map = alloc_bootmem_node(NODE_DATA(nid), | 233 | map = alloc_bootmem_node(NODE_DATA(nid), |
| 223 | sizeof(struct page) * PAGES_PER_SECTION); | 234 | sizeof(struct page) * PAGES_PER_SECTION); |
| 224 | if (map) | 235 | if (map) |
