aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmstat.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-02-10 04:43:02 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:17 -0500
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 @@
16void __get_zone_counts(unsigned long *active, unsigned long *inactive, 16void __get_zone_counts(unsigned long *active, unsigned long *inactive,
17 unsigned long *free, struct pglist_data *pgdat) 17 unsigned long *free, struct pglist_data *pgdat)
18{ 18{
19 struct zone *zones = pgdat->node_zones;
20 int i;
21
22 *active = node_page_state(pgdat->node_id, NR_ACTIVE); 19 *active = node_page_state(pgdat->node_id, NR_ACTIVE);
23 *inactive = node_page_state(pgdat->node_id, NR_INACTIVE); 20 *inactive = node_page_state(pgdat->node_id, NR_INACTIVE);
24 *free = 0; 21 *free = node_page_state(pgdat->node_id, NR_FREE_PAGES);
25 for (i = 0; i < MAX_NR_ZONES; i++) {
26 *free += zones[i].free_pages;
27 }
28} 22}
29 23
30void get_zone_counts(unsigned long *active, 24void get_zone_counts(unsigned long *active,
31 unsigned long *inactive, unsigned long *free) 25 unsigned long *inactive, unsigned long *free)
32{ 26{
33 struct pglist_data *pgdat;
34
35 *active = global_page_state(NR_ACTIVE); 27 *active = global_page_state(NR_ACTIVE);
36 *inactive = global_page_state(NR_INACTIVE); 28 *inactive = global_page_state(NR_INACTIVE);
37 *free = 0; 29 *free = global_page_state(NR_FREE_PAGES);
38 for_each_online_pgdat(pgdat) {
39 unsigned long l, m, n;
40 __get_zone_counts(&l, &m, &n, pgdat);
41 *free += n;
42 }
43} 30}
44 31
45#ifdef CONFIG_VM_EVENT_COUNTERS 32#ifdef CONFIG_VM_EVENT_COUNTERS
@@ -454,6 +441,7 @@ const struct seq_operations fragmentation_op = {
454 441
455static const char * const vmstat_text[] = { 442static const char * const vmstat_text[] = {
456 /* Zoned VM counters */ 443 /* Zoned VM counters */
444 "nr_free_pages",
457 "nr_active", 445 "nr_active",
458 "nr_inactive", 446 "nr_inactive",
459 "nr_anon_pages", 447 "nr_anon_pages",
@@ -534,7 +522,7 @@ static int zoneinfo_show(struct seq_file *m, void *arg)
534 "\n scanned %lu (a: %lu i: %lu)" 522 "\n scanned %lu (a: %lu i: %lu)"
535 "\n spanned %lu" 523 "\n spanned %lu"
536 "\n present %lu", 524 "\n present %lu",
537 zone->free_pages, 525 zone_page_state(zone, NR_FREE_PAGES),
538 zone->pages_min, 526 zone->pages_min,
539 zone->pages_low, 527 zone->pages_low,
540 zone->pages_high, 528 zone->pages_high,