From e6b9709c731b5f5e3d69b6136b3f61f7ba0dd305 Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Fri, 22 Feb 2013 16:33:02 -0800 Subject: [PATCH] --- yaml --- r: 356517 b: refs/heads/master c: cd099682e4c786c3a866e462b37fcac6e3a44a68 h: refs/heads/master i: 356515: e29fd0c062376568ce51e9a3708cf00e66e306e3 v: v3 --- [refs] | 2 +- trunk/mm/memory_hotplug.c | 4 ---- trunk/mm/sparse.c | 5 ++++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 961cb5bcbfa8..242f0faa3eef 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 46723bfa540f0a1e494476a1734d03626a0bd1e0 +refs/heads/master: cd099682e4c786c3a866e462b37fcac6e3a44a68 diff --git a/trunk/mm/memory_hotplug.c b/trunk/mm/memory_hotplug.c index 6c90d222ec0a..220459c9ff1c 100644 --- a/trunk/mm/memory_hotplug.c +++ b/trunk/mm/memory_hotplug.c @@ -444,8 +444,6 @@ static int __remove_section(struct zone *zone, struct mem_section *ms) #else static int __remove_section(struct zone *zone, struct mem_section *ms) { - unsigned long flags; - struct pglist_data *pgdat = zone->zone_pgdat; int ret = -EINVAL; if (!valid_section(ms)) @@ -455,9 +453,7 @@ static int __remove_section(struct zone *zone, struct mem_section *ms) if (ret) return ret; - pgdat_resize_lock(pgdat, &flags); sparse_remove_one_section(zone, ms); - pgdat_resize_unlock(pgdat, &flags); return 0; } #endif diff --git a/trunk/mm/sparse.c b/trunk/mm/sparse.c index 6b5fb762e2ca..66f0fd9d7964 100644 --- a/trunk/mm/sparse.c +++ b/trunk/mm/sparse.c @@ -796,8 +796,10 @@ static inline void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) void sparse_remove_one_section(struct zone *zone, struct mem_section *ms) { struct page *memmap = NULL; - unsigned long *usemap = NULL; + unsigned long *usemap = NULL, flags; + struct pglist_data *pgdat = zone->zone_pgdat; + pgdat_resize_lock(pgdat, &flags); if (ms->section_mem_map) { usemap = ms->pageblock_flags; memmap = sparse_decode_mem_map(ms->section_mem_map, @@ -805,6 +807,7 @@ void sparse_remove_one_section(struct zone *zone, struct mem_section *ms) ms->section_mem_map = 0; ms->pageblock_flags = NULL; } + pgdat_resize_unlock(pgdat, &flags); clear_hwpoisoned_pages(memmap, PAGES_PER_SECTION); free_section_usemap(memmap, usemap);