diff options
author | Wen Congyang <wency@cn.fujitsu.com> | 2012-12-11 19:01:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-11 20:22:23 -0500 |
commit | 6dcd73d7011ba9046f9b98e7f7c9d958f5810e6b (patch) | |
tree | e2cc08839a13745a21ade3d5ab22d8f8836ace80 /mm/page_alloc.c | |
parent | 3ac19f8efe26451cacac31d0be34fa9c51114c2a (diff) |
memory-hotplug: allocate zone's pcp before onlining pages
We use __free_page() to put a page to buddy system when onlining pages.
__free_page() will store NR_FREE_PAGES in zone's pcp.vm_stat_diff, so we
should allocate zone's pcp before onlining pages, otherwise we will lose
some free pages.
[mhocko@suse.cz: make zone_pcp_reset independent of MEMORY_HOTREMOVE]
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4dba04f06880..5a7b7611d4e4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5983,7 +5983,6 @@ void __meminit zone_pcp_update(struct zone *zone) | |||
5983 | } | 5983 | } |
5984 | #endif | 5984 | #endif |
5985 | 5985 | ||
5986 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
5987 | void zone_pcp_reset(struct zone *zone) | 5986 | void zone_pcp_reset(struct zone *zone) |
5988 | { | 5987 | { |
5989 | unsigned long flags; | 5988 | unsigned long flags; |
@@ -6003,6 +6002,7 @@ void zone_pcp_reset(struct zone *zone) | |||
6003 | local_irq_restore(flags); | 6002 | local_irq_restore(flags); |
6004 | } | 6003 | } |
6005 | 6004 | ||
6005 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
6006 | /* | 6006 | /* |
6007 | * All pages in the range must be isolated before calling this. | 6007 | * All pages in the range must be isolated before calling this. |
6008 | */ | 6008 | */ |