summaryrefslogtreecommitdiff
path: root/include/linux/vmstat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/vmstat.h')
-rw-r--r--include/linux/vmstat.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 3e0daf54133e..1ab806c47514 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -57,7 +57,7 @@ static inline void __count_vm_events(enum vm_event_item item, long delta)
static inline void count_vm_events(enum vm_event_item item, long delta)
{
- get_cpu_var(vm_event_states.event[item])++;
+ get_cpu_var(vm_event_states.event[item]) += delta;
put_cpu();
}
@@ -186,11 +186,16 @@ static inline void __mod_zone_page_state(struct zone *zone,
zone_page_state_add(delta, zone, item);
}
+static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
+{
+ atomic_long_inc(&zone->vm_stat[item]);
+ atomic_long_inc(&vm_stat[item]);
+}
+
static inline void __inc_zone_page_state(struct page *page,
enum zone_stat_item item)
{
- atomic_long_inc(&page_zone(page)->vm_stat[item]);
- atomic_long_inc(&vm_stat[item]);
+ __inc_zone_state(page_zone(page), item);
}
static inline void __dec_zone_page_state(struct page *page,