Index: linux-2.6.17-rc6-cl/mm/vmstat.c =================================================================== --- linux-2.6.17-rc6-cl.orig/mm/vmstat.c 2006-06-13 15:10:10.072579251 -0700 +++ linux-2.6.17-rc6-cl/mm/vmstat.c 2006-06-13 15:28:46.804148218 -0700 @@ -435,6 +435,9 @@ static char *vmstat_text[] = { "numa_local", "numa_other", #endif + "nr_active", + "nr_inactive", + #ifdef CONFIG_VM_EVENT_COUNTERS "pgpgin", "pgpgout", Index: linux-2.6.17-rc6-cl/mm/vmscan.c =================================================================== --- linux-2.6.17-rc6-cl.orig/mm/vmscan.c 2006-06-13 14:50:13.508090264 -0700 +++ linux-2.6.17-rc6-cl/mm/vmscan.c 2006-06-13 15:33:26.958625066 -0700 @@ -778,7 +778,7 @@ static void shrink_active_list(unsigned pgmoved = isolate_lru_pages(nr_pages, &zone->active_list, &l_hold, &pgscanned); zone->pages_scanned += pgscanned; - zone->nr_active -= pgmoved; + sub_zone_state(pgmovedi, NR_INACTIVE); spin_unlock_irq(&zone->lru_lock); while (!list_empty(&l_hold)) { @@ -838,7 +838,7 @@ static void shrink_active_list(unsigned list_move(&page->lru, &zone->active_list); pgmoved++; if (!pagevec_add(&pvec, page)) { - zone->nr_active += pgmoved; + add_zone_page_state(pgmoved, zone, NR_INACTIVE); pgmoved = 0; spin_unlock_irq(&zone->lru_lock); __pagevec_release(&pvec); Index: linux-2.6.17-rc6-cl/mm/page_alloc.c =================================================================== --- linux-2.6.17-rc6-cl.orig/mm/page_alloc.c 2006-06-13 15:17:14.964272257 -0700 +++ linux-2.6.17-rc6-cl/mm/page_alloc.c 2006-06-13 15:31:49.555493908 -0700 @@ -1310,13 +1310,11 @@ static void show_node(struct zone *zone) */ unsigned long nr_free_inactive_pages_node(int nid) { - unsigned int i; - unsigned long sum = 0; + unsigned long sum = node_page_state(nid, NR_INACTIVE); struct zone *zones = NODE_DATA(nid)->node_zones; for (i = 0; i < MAX_NR_ZONES; i++) - sum += zones[i].nr_inactive + - zones[i].free_pages - zones[i].pages_low; + sum += zones[i].free_pages - zones[i].pages_low; return sum; } @@ -1430,8 +1428,8 @@ void show_free_areas(void) K(zone->pages_min), K(zone->pages_low), K(zone->pages_high), - K(zone->nr_active), - K(zone->nr_inactive), + K(zone_page_state(zone, NR_ACTIVE)), + K(zone_page_state(zone, NR_INACTIVE)), K(zone->present_pages), zone->pages_scanned, (zone->all_unreclaimable ? "yes" : "no") @@ -2139,8 +2137,6 @@ static void __meminit free_area_init_cor INIT_LIST_HEAD(&zone->inactive_list); zone->nr_scan_active = 0; zone->nr_scan_inactive = 0; - zone->nr_active = 0; - zone->nr_inactive = 0; zap_zone_vm_stats(zone); atomic_set(&zone->reclaim_in_progress, 0); if (!size) Index: linux-2.6.17-rc6-cl/include/linux/mm_inline.h =================================================================== --- linux-2.6.17-rc6-cl.orig/include/linux/mm_inline.h 2006-06-12 12:42:50.748942777 -0700 +++ linux-2.6.17-rc6-cl/include/linux/mm_inline.h 2006-06-13 15:28:11.827804945 -0700 @@ -3,35 +3,35 @@ static inline void add_page_to_active_list(struct zone *zone, struct page *page) { list_add(&page->lru, &zone->active_list); - zone->nr_active++; + __inc_zone_page_state(page, NR_ACTIVE); } static inline void add_page_to_inactive_list(struct zone *zone, struct page *page) { list_add(&page->lru, &zone->inactive_list); - zone->nr_inactive++; + __inc_zone_page_state(page, NR_INACTIVE); } static inline void add_page_to_inactive_list_tail(struct zone *zone, struct page *page) { list_add_tail(&page->lru, &zone->inactive_list); - zone->nr_inactive++; + __inc_zone_page_state(page, NR_INACTIVE); } static inline void del_page_from_active_list(struct zone *zone, struct page *page) { list_del(&page->lru); - zone->nr_active--; + __dec_zone_page_state(page, NR_ACTIVE); } static inline void del_page_from_inactive_list(struct zone *zone, struct page *page) { list_del(&page->lru); - zone->nr_inactive--; + __dec_zone_page_state(page, NR_INACTIVE); } static inline void @@ -40,9 +40,9 @@ del_page_from_lru(struct zone *zone, str list_del(&page->lru); if (PageActive(page)) { __ClearPageActive(page); - zone->nr_active--; + __dec_zone_page_state(page, NR_ACTIVE); } else { - zone->nr_inactive--; + __dec_zone_page_state(page, NR_INACTIVE); } } Index: linux-2.6.17-rc6-cl/include/linux/mmzone.h =================================================================== --- linux-2.6.17-rc6-cl.orig/include/linux/mmzone.h 2006-06-13 15:09:03.771015047 -0700 +++ linux-2.6.17-rc6-cl/include/linux/mmzone.h 2006-06-13 15:25:08.810852614 -0700 @@ -65,6 +65,8 @@ enum zone_stat_item { NUMA_LOCAL, NUMA_OTHER, #endif + NR_ACTIVE, + NR_INACTIVE, NR_VM_ZONE_STAT_ITEMS }; struct per_cpu_pages { @@ -173,8 +175,6 @@ struct zone { struct list_head inactive_list; unsigned long nr_scan_active; unsigned long nr_scan_inactive; - unsigned long nr_active; - unsigned long nr_inactive; unsigned long pages_scanned; /* since last reclaim */ int all_unreclaimable; /* All pages pinned */