summaryrefslogtreecommitdiff
path: root/mm/vmstat.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-02-10 01:43:02 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 10:51:17 -0800
commitd23ad42324cc4378132e51f2fc5c9ba6cbe75182 (patch)
tree6844416befb3988e432e8f422f3a369e2f760d39 /mm/vmstat.c
parentc878538598d1e7ab41ecc0de8894e34e2fdef630 (diff)
[PATCH] Use ZVC for free_pages
This is again simplifies some of the VM counter calculations through the use of the ZVC consolidated counters. [michal.k.k.piotrowski@gmail.com: build fix] Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> 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.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 5462106725d7..2386716f1754 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -16,30 +16,17 @@
void __get_zone_counts(unsigned long *active, unsigned long *inactive,
unsigned long *free, struct pglist_data *pgdat)
{
- struct zone *zones = pgdat->node_zones;
- int i;
-
*active = node_page_state(pgdat->node_id, NR_ACTIVE);
*inactive = node_page_state(pgdat->node_id, NR_INACTIVE);
- *free = 0;
- for (i = 0; i < MAX_NR_ZONES; i++) {
- *free += zones[i].free_pages;
- }
+ *free = node_page_state(pgdat->node_id, NR_FREE_PAGES);
}
void get_zone_counts(unsigned long *active,
unsigned long *inactive, unsigned long *free)
{
- struct pglist_data *pgdat;
-
*active = global_page_state(NR_ACTIVE);
*inactive = global_page_state(NR_INACTIVE);
- *free = 0;
- for_each_online_pgdat(pgdat) {
- unsigned long l, m, n;
- __get_zone_counts(&l, &m, &n, pgdat);
- *free += n;
- }
+ *free = global_page_state(NR_FREE_PAGES);
}
#ifdef CONFIG_VM_EVENT_COUNTERS
@@ -454,6 +441,7 @@ const struct seq_operations fragmentation_op = {
static const char * const vmstat_text[] = {
/* Zoned VM counters */
+ "nr_free_pages",
"nr_active",
"nr_inactive",
"nr_anon_pages",
@@ -534,7 +522,7 @@ static int zoneinfo_show(struct seq_file *m, void *arg)
"\n scanned %lu (a: %lu i: %lu)"
"\n spanned %lu"
"\n present %lu",
- zone->free_pages,
+ zone_page_state(zone, NR_FREE_PAGES),
zone->pages_min,
zone->pages_low,
zone->pages_high,