diff options
-rw-r--r-- | include/linux/mm.h | 1 | ||||
-rw-r--r-- | mm/memory_hotplug.c | 3 | ||||
-rw-r--r-- | mm/page_alloc.c | 13 |
3 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 3955bedeeed1..7c6dfd2faa69 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1331,6 +1331,7 @@ void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); | |||
1331 | extern void setup_per_cpu_pageset(void); | 1331 | extern void setup_per_cpu_pageset(void); |
1332 | 1332 | ||
1333 | extern void zone_pcp_update(struct zone *zone); | 1333 | extern void zone_pcp_update(struct zone *zone); |
1334 | extern void zone_pcp_reset(struct zone *zone); | ||
1334 | 1335 | ||
1335 | /* nommu.c */ | 1336 | /* nommu.c */ |
1336 | extern atomic_long_t mmap_pages_allocated; | 1337 | extern atomic_long_t mmap_pages_allocated; |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 597d371329d3..3ad25f9d1fc1 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -966,6 +966,9 @@ repeat: | |||
966 | 966 | ||
967 | init_per_zone_wmark_min(); | 967 | init_per_zone_wmark_min(); |
968 | 968 | ||
969 | if (!populated_zone(zone)) | ||
970 | zone_pcp_reset(zone); | ||
971 | |||
969 | if (!node_present_pages(node)) { | 972 | if (!node_present_pages(node)) { |
970 | node_clear_state(node, N_HIGH_MEMORY); | 973 | node_clear_state(node, N_HIGH_MEMORY); |
971 | kswapd_stop(node); | 974 | kswapd_stop(node); |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9ad6866ac49c..9c9a31665a78 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5894,6 +5894,19 @@ void free_contig_range(unsigned long pfn, unsigned nr_pages) | |||
5894 | #endif | 5894 | #endif |
5895 | 5895 | ||
5896 | #ifdef CONFIG_MEMORY_HOTREMOVE | 5896 | #ifdef CONFIG_MEMORY_HOTREMOVE |
5897 | void zone_pcp_reset(struct zone *zone) | ||
5898 | { | ||
5899 | unsigned long flags; | ||
5900 | |||
5901 | /* avoid races with drain_pages() */ | ||
5902 | local_irq_save(flags); | ||
5903 | if (zone->pageset != &boot_pageset) { | ||
5904 | free_percpu(zone->pageset); | ||
5905 | zone->pageset = &boot_pageset; | ||
5906 | } | ||
5907 | local_irq_restore(flags); | ||
5908 | } | ||
5909 | |||
5897 | /* | 5910 | /* |
5898 | * All pages in the range must be isolated before calling this. | 5911 | * All pages in the range must be isolated before calling this. |
5899 | */ | 5912 | */ |