aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r--mm/vmstat.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index bf62a8232100..5462106725d7 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -19,12 +19,10 @@ void __get_zone_counts(unsigned long *active, unsigned long *inactive,
19 struct zone *zones = pgdat->node_zones; 19 struct zone *zones = pgdat->node_zones;
20 int i; 20 int i;
21 21
22 *active = 0; 22 *active = node_page_state(pgdat->node_id, NR_ACTIVE);
23 *inactive = 0; 23 *inactive = node_page_state(pgdat->node_id, NR_INACTIVE);
24 *free = 0; 24 *free = 0;
25 for (i = 0; i < MAX_NR_ZONES; i++) { 25 for (i = 0; i < MAX_NR_ZONES; i++) {
26 *active += zones[i].nr_active;
27 *inactive += zones[i].nr_inactive;
28 *free += zones[i].free_pages; 26 *free += zones[i].free_pages;
29 } 27 }
30} 28}
@@ -34,14 +32,12 @@ void get_zone_counts(unsigned long *active,
34{ 32{
35 struct pglist_data *pgdat; 33 struct pglist_data *pgdat;
36 34
37 *active = 0; 35 *active = global_page_state(NR_ACTIVE);
38 *inactive = 0; 36 *inactive = global_page_state(NR_INACTIVE);
39 *free = 0; 37 *free = 0;
40 for_each_online_pgdat(pgdat) { 38 for_each_online_pgdat(pgdat) {
41 unsigned long l, m, n; 39 unsigned long l, m, n;
42 __get_zone_counts(&l, &m, &n, pgdat); 40 __get_zone_counts(&l, &m, &n, pgdat);
43 *active += l;
44 *inactive += m;
45 *free += n; 41 *free += n;
46 } 42 }
47} 43}
@@ -239,7 +235,7 @@ EXPORT_SYMBOL(mod_zone_page_state);
239 * in between and therefore the atomicity vs. interrupt cannot be exploited 235 * in between and therefore the atomicity vs. interrupt cannot be exploited
240 * in a useful way here. 236 * in a useful way here.
241 */ 237 */
242static void __inc_zone_state(struct zone *zone, enum zone_stat_item item) 238void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
243{ 239{
244 struct per_cpu_pageset *pcp = zone_pcp(zone, smp_processor_id()); 240 struct per_cpu_pageset *pcp = zone_pcp(zone, smp_processor_id());
245 s8 *p = pcp->vm_stat_diff + item; 241 s8 *p = pcp->vm_stat_diff + item;
@@ -260,9 +256,8 @@ void __inc_zone_page_state(struct page *page, enum zone_stat_item item)
260} 256}
261EXPORT_SYMBOL(__inc_zone_page_state); 257EXPORT_SYMBOL(__inc_zone_page_state);
262 258
263void __dec_zone_page_state(struct page *page, enum zone_stat_item item) 259void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
264{ 260{
265 struct zone *zone = page_zone(page);
266 struct per_cpu_pageset *pcp = zone_pcp(zone, smp_processor_id()); 261 struct per_cpu_pageset *pcp = zone_pcp(zone, smp_processor_id());
267 s8 *p = pcp->vm_stat_diff + item; 262 s8 *p = pcp->vm_stat_diff + item;
268 263
@@ -275,6 +270,11 @@ void __dec_zone_page_state(struct page *page, enum zone_stat_item item)
275 *p = overstep; 270 *p = overstep;
276 } 271 }
277} 272}
273
274void __dec_zone_page_state(struct page *page, enum zone_stat_item item)
275{
276 __dec_zone_state(page_zone(page), item);
277}
278EXPORT_SYMBOL(__dec_zone_page_state); 278EXPORT_SYMBOL(__dec_zone_page_state);
279 279
280void inc_zone_state(struct zone *zone, enum zone_stat_item item) 280void inc_zone_state(struct zone *zone, enum zone_stat_item item)
@@ -454,6 +454,8 @@ const struct seq_operations fragmentation_op = {
454 454
455static const char * const vmstat_text[] = { 455static const char * const vmstat_text[] = {
456 /* Zoned VM counters */ 456 /* Zoned VM counters */
457 "nr_active",
458 "nr_inactive",
457 "nr_anon_pages", 459 "nr_anon_pages",
458 "nr_mapped", 460 "nr_mapped",
459 "nr_file_pages", 461 "nr_file_pages",
@@ -529,8 +531,6 @@ static int zoneinfo_show(struct seq_file *m, void *arg)
529 "\n min %lu" 531 "\n min %lu"
530 "\n low %lu" 532 "\n low %lu"
531 "\n high %lu" 533 "\n high %lu"
532 "\n active %lu"
533 "\n inactive %lu"
534 "\n scanned %lu (a: %lu i: %lu)" 534 "\n scanned %lu (a: %lu i: %lu)"
535 "\n spanned %lu" 535 "\n spanned %lu"
536 "\n present %lu", 536 "\n present %lu",
@@ -538,8 +538,6 @@ static int zoneinfo_show(struct seq_file *m, void *arg)
538 zone->pages_min, 538 zone->pages_min,
539 zone->pages_low, 539 zone->pages_low,
540 zone->pages_high, 540 zone->pages_high,
541 zone->nr_active,
542 zone->nr_inactive,
543 zone->pages_scanned, 541 zone->pages_scanned,
544 zone->nr_scan_active, zone->nr_scan_inactive, 542 zone->nr_scan_active, zone->nr_scan_inactive,
545 zone->spanned_pages, 543 zone->spanned_pages,