[PATCH] fix vmstat per cpu usage

Jan Blunck
2006-08-01T17:36:23Z

[-- Attachment #1: vmstat-fix.diff --]
[-- Type: text/x-patch, Size: 1271 bytes --]

From: Jan Blunck <jblunck@suse.de>
Subject: fix vmstat per cpu usage

The per cpu variables are used incorrectly in vmstat.h.

Signed-off-by: Jan Blunck <jblunck@suse.de>
---
include/linux/vmstat.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-v2.6.18-rc3/include/linux/vmstat.h
===================================================================
--- linux-v2.6.18-rc3.orig/include/linux/vmstat.h
+++ linux-v2.6.18-rc3/include/linux/vmstat.h
@@ -41,23 +41,23 @@ DECLARE_PER_CPU(struct vm_event_state, v

static inline void __count_vm_event(enum vm_event_item item)
{
- __get_cpu_var(vm_event_states.event[item])++;
+ __get_cpu_var(vm_event_states).event[item]++;
}

static inline void count_vm_event(enum vm_event_item item)
{
- get_cpu_var(vm_event_states.event[item])++;
+ get_cpu_var(vm_event_states).event[item]++;
put_cpu();
}

static inline void __count_vm_events(enum vm_event_item item, long delta)
{
- __get_cpu_var(vm_event_states.event[item]) += delta;
+ __get_cpu_var(vm_event_states).event[item] += delta;
}

static inline void count_vm_events(enum vm_event_item item, long delta)
{
- get_cpu_var(vm_event_states.event[item]) += delta;
+ get_cpu_var(vm_event_states).event[item] += delta;
put_cpu();
}