The patch titled Subject: mm/hotplug: free zone->pageset when a zone becomes empty has been removed from the -mm tree. Its filename was mm-hotplug-free-zone-pageset-when-a-zone-becomes-empty.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Jiang Liu <jiang.liu@xxxxxxxxxx> Subject: mm/hotplug: free zone->pageset when a zone becomes empty When a zone becomes empty after memory offlining, free zone->pageset. Otherwise it will cause memory leak when adding memory to the empty zone again because build_all_zonelists() will allocate zone->pageset for an empty zone. Signed-off-by: Jiang Liu <liuj97@xxxxxxxxx> Signed-off-by: Wei Wang <Bessel.Wang@xxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx> Cc: Yinghai Lu <yinghai@xxxxxxxxxx> Cc: Tony Luck <tony.luck@xxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Keping Chen <chenkeping@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/mm.h | 1 + mm/memory_hotplug.c | 3 +++ mm/page_alloc.c | 13 +++++++++++++ 3 files changed, 17 insertions(+) diff -puN include/linux/mm.h~mm-hotplug-free-zone-pageset-when-a-zone-becomes-empty include/linux/mm.h --- a/include/linux/mm.h~mm-hotplug-free-zone-pageset-when-a-zone-becomes-empty +++ a/include/linux/mm.h @@ -1331,6 +1331,7 @@ void warn_alloc_failed(gfp_t gfp_mask, i extern void setup_per_cpu_pageset(void); extern void zone_pcp_update(struct zone *zone); +extern void zone_pcp_reset(struct zone *zone); /* nommu.c */ extern atomic_long_t mmap_pages_allocated; diff -puN mm/memory_hotplug.c~mm-hotplug-free-zone-pageset-when-a-zone-becomes-empty mm/memory_hotplug.c --- a/mm/memory_hotplug.c~mm-hotplug-free-zone-pageset-when-a-zone-becomes-empty +++ a/mm/memory_hotplug.c @@ -966,6 +966,9 @@ repeat: init_per_zone_wmark_min(); + if (!populated_zone(zone)) + zone_pcp_reset(zone); + if (!node_present_pages(node)) { node_clear_state(node, N_HIGH_MEMORY); kswapd_stop(node); diff -puN mm/page_alloc.c~mm-hotplug-free-zone-pageset-when-a-zone-becomes-empty mm/page_alloc.c --- a/mm/page_alloc.c~mm-hotplug-free-zone-pageset-when-a-zone-becomes-empty +++ a/mm/page_alloc.c @@ -5894,6 +5894,19 @@ void free_contig_range(unsigned long pfn #endif #ifdef CONFIG_MEMORY_HOTREMOVE +void zone_pcp_reset(struct zone *zone) +{ + unsigned long flags; + + /* avoid races with drain_pages() */ + local_irq_save(flags); + if (zone->pageset != &boot_pageset) { + free_percpu(zone->pageset); + zone->pageset = &boot_pageset; + } + local_irq_restore(flags); +} + /* * All pages in the range must be isolated before calling this. */ _ Patches currently in -mm which might be from jiang.liu@xxxxxxxxxx are origin.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html