Commit 23316bc8 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] mm: cleanup zone_pcp

Use zone_pcp everywhere even though NUMA code "knows" the internal details
of the zone.  Stop other people trying to copy, and it looks nicer.

Also, only print the pagesets of online cpus in zoneinfo.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Cc: "Seth, Rohit" <rohit.seth@intel.com>
Cc: Christoph Lameter <christoph@lameter.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8ad4b1fb
...@@ -597,7 +597,7 @@ void drain_remote_pages(void) ...@@ -597,7 +597,7 @@ void drain_remote_pages(void)
if (zone->zone_pgdat->node_id == numa_node_id()) if (zone->zone_pgdat->node_id == numa_node_id())
continue; continue;
pset = zone->pageset[smp_processor_id()]; pset = zone_pcp(zone, smp_processor_id());
for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) { for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) {
struct per_cpu_pages *pcp; struct per_cpu_pages *pcp;
...@@ -1881,12 +1881,12 @@ static int __devinit process_zones(int cpu) ...@@ -1881,12 +1881,12 @@ static int __devinit process_zones(int cpu)
for_each_zone(zone) { for_each_zone(zone) {
zone->pageset[cpu] = kmalloc_node(sizeof(struct per_cpu_pageset), zone_pcp(zone, cpu) = kmalloc_node(sizeof(struct per_cpu_pageset),
GFP_KERNEL, cpu_to_node(cpu)); GFP_KERNEL, cpu_to_node(cpu));
if (!zone->pageset[cpu]) if (!zone_pcp(zone, cpu))
goto bad; goto bad;
setup_pageset(zone->pageset[cpu], zone_batchsize(zone)); setup_pageset(zone_pcp(zone, cpu), zone_batchsize(zone));
if (percpu_pagelist_fraction) if (percpu_pagelist_fraction)
setup_pagelist_highmark(zone_pcp(zone, cpu), setup_pagelist_highmark(zone_pcp(zone, cpu),
...@@ -1898,8 +1898,8 @@ static int __devinit process_zones(int cpu) ...@@ -1898,8 +1898,8 @@ static int __devinit process_zones(int cpu)
for_each_zone(dzone) { for_each_zone(dzone) {
if (dzone == zone) if (dzone == zone)
break; break;
kfree(dzone->pageset[cpu]); kfree(zone_pcp(dzone, cpu));
dzone->pageset[cpu] = NULL; zone_pcp(dzone, cpu) = NULL;
} }
return -ENOMEM; return -ENOMEM;
} }
...@@ -1984,7 +1984,7 @@ static __devinit void zone_pcp_init(struct zone *zone) ...@@ -1984,7 +1984,7 @@ static __devinit void zone_pcp_init(struct zone *zone)
for (cpu = 0; cpu < NR_CPUS; cpu++) { for (cpu = 0; cpu < NR_CPUS; cpu++) {
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
/* Early boot. Slab allocator not functional yet */ /* Early boot. Slab allocator not functional yet */
zone->pageset[cpu] = &boot_pageset[cpu]; zone_pcp(zone, cpu) = &boot_pageset[cpu];
setup_pageset(&boot_pageset[cpu],0); setup_pageset(&boot_pageset[cpu],0);
#else #else
setup_pageset(zone_pcp(zone,cpu), batch); setup_pageset(zone_pcp(zone,cpu), batch);
...@@ -2227,7 +2227,7 @@ static int zoneinfo_show(struct seq_file *m, void *arg) ...@@ -2227,7 +2227,7 @@ static int zoneinfo_show(struct seq_file *m, void *arg)
seq_printf(m, seq_printf(m,
")" ")"
"\n pagesets"); "\n pagesets");
for (i = 0; i < ARRAY_SIZE(zone->pageset); i++) { for_each_online_cpu(i) {
struct per_cpu_pageset *pageset; struct per_cpu_pageset *pageset;
int j; int j;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment