aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmstat.c
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2008-04-28 05:12:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:18 -0400
commit18ea7e710d2452fa726814a406779188028cf1bf (patch)
treedfa439770b4344ade1ad8bd4fe70920ad66ee064 /mm/vmstat.c
parent0e88460da6ab7bb6a7ef83675412ed5b6315d741 (diff)
mm: remember what the preferred zone is for zone_statistics
On NUMA, zone_statistics() is used to record events like numa hit, miss and foreign. It assumes that the first zone in a zonelist is the preferred zone. When multiple zonelists are replaced by one that is filtered, this is no longer the case. This patch records what the preferred zone is rather than assuming the first zone in the zonelist is it. This simplifies the reading of later patches in this set. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Christoph Lameter <clameter@sgi.com> Cc: Hugh Dickins <hugh@veritas.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r--mm/vmstat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 7c7286e9506d..879bcc0a1d4c 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -364,13 +364,13 @@ void refresh_cpu_vm_stats(int cpu)
364 * 364 *
365 * Must be called with interrupts disabled. 365 * Must be called with interrupts disabled.
366 */ 366 */
367void zone_statistics(struct zonelist *zonelist, struct zone *z) 367void zone_statistics(struct zone *preferred_zone, struct zone *z)
368{ 368{
369 if (z->zone_pgdat == zonelist->zones[0]->zone_pgdat) { 369 if (z->zone_pgdat == preferred_zone->zone_pgdat) {
370 __inc_zone_state(z, NUMA_HIT); 370 __inc_zone_state(z, NUMA_HIT);
371 } else { 371 } else {
372 __inc_zone_state(z, NUMA_MISS); 372 __inc_zone_state(z, NUMA_MISS);
373 __inc_zone_state(zonelist->zones[0], NUMA_FOREIGN); 373 __inc_zone_state(preferred_zone, NUMA_FOREIGN);
374 } 374 }
375 if (z->node == numa_node_id()) 375 if (z->node == numa_node_id())
376 __inc_zone_state(z, NUMA_LOCAL); 376 __inc_zone_state(z, NUMA_LOCAL);