--- include/linux/vmstat.h | 2 +- mm/allocpercpu.c | 6 ++---- mm/vmstat.c | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) Index: linux-2.6/include/linux/vmstat.h =================================================================== --- linux-2.6.orig/include/linux/vmstat.h 2007-10-30 21:23:19.000000000 -0700 +++ linux-2.6/include/linux/vmstat.h 2007-10-30 21:23:20.000000000 -0700 @@ -36,7 +36,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PS FOR_ALL_ZONES(PGSCAN_KSWAPD), FOR_ALL_ZONES(PGSCAN_DIRECT), PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, - PAGEOUTRUN, ALLOCSTALL, PGROTATED, + PAGEOUTRUN, ALLOCSTALL, PGROTATED, ALLOC_PERCPU, NR_VM_EVENT_ITEMS }; Index: linux-2.6/mm/allocpercpu.c =================================================================== --- linux-2.6.orig/mm/allocpercpu.c 2007-10-30 21:23:19.000000000 -0700 +++ linux-2.6/mm/allocpercpu.c 2007-10-30 22:52:34.000000000 -0700 @@ -20,8 +20,6 @@ static u8 cpu_alloc_map[MAXIMUM_UNITS_PE DEFINE_PER_CPU(per_cpu_unit, cpu_area)[MAXIMUM_UNITS_PER_CPU]; EXPORT_PER_CPU_SYMBOL(cpu_area); -unsigned long free = MAXIMUM_UNITS_PER_CPU - 1; - static inline int size_to_units(unsigned long size) { return (size + sizeof(per_cpu_unit) - 1) / sizeof(per_cpu_unit); @@ -71,7 +69,7 @@ static inline void *cpu_alloc(unsigned l } while (1); set_map(start, units); - free -= units; + __count_vm_events(ALLOC_PERCPU, units * sizeof(per_cpu_unit)); spin_unlock(&cpu_area_lock); // printk("cpu_alloc(%ld) = %ld free=%ld\n", size, start, free); return (void *)start; @@ -87,7 +85,7 @@ static inline void cpu_free(void *pcpu) spin_lock(&cpu_area_lock); units = clear_map(start); - free += units; + __count_vm_events(ALLOC_PERCPU, -units * sizeof(per_cpu_unit)); spin_unlock(&cpu_area_lock); // printk("cpu_free(%ld) free=%d\n", start, units); } Index: linux-2.6/mm/vmstat.c =================================================================== --- linux-2.6.orig/mm/vmstat.c 2007-10-30 21:58:55.000000000 -0700 +++ linux-2.6/mm/vmstat.c 2007-10-30 21:59:16.000000000 -0700 @@ -642,6 +642,7 @@ static const char * const vmstat_text[] "allocstall", "pgrotated", + "alloc_percpu_bytes", #endif };