mem-hotplug: separate setup_per_cpu_pageset() into separate functions
No behavior change here. Move some of setup_per_cpu_pageset() code into a new function setup_zone_pageset() that will be useful for memory hotplug. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com> Reviewed-by: Andi Kleen <andi.kleen@intel.com> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
0faa56389c
commit
319774e25f
@@ -3292,18 +3292,10 @@ static void setup_pagelist_highmark(struct per_cpu_pageset *p,
|
|||||||
pcp->batch = PAGE_SHIFT * 8;
|
pcp->batch = PAGE_SHIFT * 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static __meminit void setup_zone_pageset(struct zone *zone)
|
||||||
* Allocate per cpu pagesets and initialize them.
|
|
||||||
* Before this call only boot pagesets were available.
|
|
||||||
* Boot pagesets will no longer be used by this processorr
|
|
||||||
* after setup_per_cpu_pageset().
|
|
||||||
*/
|
|
||||||
void __init setup_per_cpu_pageset(void)
|
|
||||||
{
|
{
|
||||||
struct zone *zone;
|
|
||||||
int cpu;
|
int cpu;
|
||||||
|
|
||||||
for_each_populated_zone(zone) {
|
|
||||||
zone->pageset = alloc_percpu(struct per_cpu_pageset);
|
zone->pageset = alloc_percpu(struct per_cpu_pageset);
|
||||||
|
|
||||||
for_each_possible_cpu(cpu) {
|
for_each_possible_cpu(cpu) {
|
||||||
@@ -3316,7 +3308,18 @@ void __init setup_per_cpu_pageset(void)
|
|||||||
(zone->present_pages /
|
(zone->present_pages /
|
||||||
percpu_pagelist_fraction));
|
percpu_pagelist_fraction));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocate per cpu pagesets and initialize them.
|
||||||
|
* Before this call only boot pagesets were available.
|
||||||
|
*/
|
||||||
|
void __init setup_per_cpu_pageset(void)
|
||||||
|
{
|
||||||
|
struct zone *zone;
|
||||||
|
|
||||||
|
for_each_populated_zone(zone)
|
||||||
|
setup_zone_pageset(zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
static noinline __init_refok
|
static noinline __init_refok
|
||||||
|
Reference in New Issue
Block a user