1 #ifndef _LINUX_VMSTAT_H
2 #define _LINUX_VMSTAT_H
4 #include <linux/types.h>
13 #ifdef CONFIG_VM_EVENT_COUNTERS
24 struct vm_event_state {
50 extern void all_vm_events(
unsigned long *);
52 extern void vm_events_fold_cpu(
int cpu);
54 static inline void vm_events_fold_cpu(
int cpu)
74 static inline void all_vm_events(
unsigned long *
ret)
77 static inline void vm_events_fold_cpu(
int cpu)
83 #define __count_zone_vm_events(item, zone, delta) \
84 __count_vm_events(item##_NORMAL - ZONE_NORMAL + \
85 zone_idx(zone), delta)
92 static inline void zone_page_state_add(
long x,
struct zone *
zone,
95 atomic_long_add(x, &zone->
vm_stat[item]);
96 atomic_long_add(x, &vm_stat[item]);
101 long x = atomic_long_read(&vm_stat[item]);
109 static inline unsigned long zone_page_state(
struct zone *
zone,
112 long x = atomic_long_read(&zone->
vm_stat[item]);
126 static inline unsigned long zone_page_state_snapshot(
struct zone *zone,
129 long x = atomic_long_read(&zone->
vm_stat[item]);
134 x +=
per_cpu_ptr(zone->pageset, cpu)->vm_stat_diff[item];
154 struct zone *zones =
NODE_DATA(node)->node_zones;
157 #ifdef CONFIG_ZONE_DMA
158 zone_page_state(&zones[ZONE_DMA], item) +
160 #ifdef CONFIG_ZONE_DMA32
161 zone_page_state(&zones[ZONE_DMA32], item) +
163 #ifdef CONFIG_HIGHMEM
164 zone_page_state(&zones[ZONE_HIGHMEM], item) +
174 #define node_page_state(node, item) global_page_state(item)
175 #define zone_statistics(_zl, _z, gfp) do { } while (0)
179 #define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d)
180 #define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d))
185 void __mod_zone_page_state(
struct zone *,
enum zone_stat_item item,
int);
198 void refresh_cpu_vm_stats(
int);
199 void refresh_zone_stat_thresholds(
void);
203 int calculate_pressure_threshold(
struct zone *zone);
204 int calculate_normal_threshold(
struct zone *zone);
206 int (*calculate_pressure)(
struct zone *));
213 static inline void __mod_zone_page_state(
struct zone *zone,
216 zone_page_state_add(delta, zone, item);
219 static inline void __inc_zone_state(
struct zone *zone,
enum zone_stat_item item)
221 atomic_long_inc(&zone->
vm_stat[item]);
222 atomic_long_inc(&vm_stat[item]);
225 static inline void __inc_zone_page_state(
struct page *
page,
228 __inc_zone_state(page_zone(page), item);
231 static inline void __dec_zone_state(
struct zone *zone,
enum zone_stat_item item)
233 atomic_long_dec(&zone->
vm_stat[item]);
234 atomic_long_dec(&vm_stat[item]);
237 static inline void __dec_zone_page_state(
struct page *page,
240 __dec_zone_state(page_zone(page), item);
247 #define inc_zone_page_state __inc_zone_page_state
248 #define dec_zone_page_state __dec_zone_page_state
249 #define mod_zone_page_state __mod_zone_page_state
251 #define set_pgdat_percpu_threshold(pgdat, callback) { }
253 static inline void refresh_cpu_vm_stats(
int cpu) { }
254 static inline void refresh_zone_stat_thresholds(
void) { }
256 static inline void drain_zonestat(
struct zone *zone,
260 static inline void __mod_zone_freepage_state(
struct zone *zone,
int nr_pages,