aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/vmstat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/vmstat.h')
-rw-r--r--include/linux/vmstat.h73
1 files changed, 16 insertions, 57 deletions
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index eaaea37b3b75..bcd942fa611c 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -5,62 +5,9 @@
5#include <linux/percpu.h> 5#include <linux/percpu.h>
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/mmzone.h> 7#include <linux/mmzone.h>
8#include <linux/vm_event_item.h>
8#include <asm/atomic.h> 9#include <asm/atomic.h>
9 10
10#ifdef CONFIG_ZONE_DMA
11#define DMA_ZONE(xx) xx##_DMA,
12#else
13#define DMA_ZONE(xx)
14#endif
15
16#ifdef CONFIG_ZONE_DMA32
17#define DMA32_ZONE(xx) xx##_DMA32,
18#else
19#define DMA32_ZONE(xx)
20#endif
21
22#ifdef CONFIG_HIGHMEM
23#define HIGHMEM_ZONE(xx) , xx##_HIGH
24#else
25#define HIGHMEM_ZONE(xx)
26#endif
27
28
29#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) , xx##_MOVABLE
30
31enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
32 FOR_ALL_ZONES(PGALLOC),
33 PGFREE, PGACTIVATE, PGDEACTIVATE,
34 PGFAULT, PGMAJFAULT,
35 FOR_ALL_ZONES(PGREFILL),
36 FOR_ALL_ZONES(PGSTEAL),
37 FOR_ALL_ZONES(PGSCAN_KSWAPD),
38 FOR_ALL_ZONES(PGSCAN_DIRECT),
39#ifdef CONFIG_NUMA
40 PGSCAN_ZONE_RECLAIM_FAILED,
41#endif
42 PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL,
43 KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
44 KSWAPD_SKIP_CONGESTION_WAIT,
45 PAGEOUTRUN, ALLOCSTALL, PGROTATED,
46#ifdef CONFIG_COMPACTION
47 COMPACTBLOCKS, COMPACTPAGES, COMPACTPAGEFAILED,
48 COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
49#endif
50#ifdef CONFIG_HUGETLB_PAGE
51 HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
52#endif
53 UNEVICTABLE_PGCULLED, /* culled to noreclaim list */
54 UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */
55 UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */
56 UNEVICTABLE_PGMLOCKED,
57 UNEVICTABLE_PGMUNLOCKED,
58 UNEVICTABLE_PGCLEARED, /* on COW, page truncate */
59 UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */
60 UNEVICTABLE_MLOCKFREED,
61 NR_VM_EVENT_ITEMS
62};
63
64extern int sysctl_stat_interval; 11extern int sysctl_stat_interval;
65 12
66#ifdef CONFIG_VM_EVENT_COUNTERS 13#ifdef CONFIG_VM_EVENT_COUNTERS
@@ -220,12 +167,12 @@ static inline unsigned long node_page_state(int node,
220 zone_page_state(&zones[ZONE_MOVABLE], item); 167 zone_page_state(&zones[ZONE_MOVABLE], item);
221} 168}
222 169
223extern void zone_statistics(struct zone *, struct zone *); 170extern void zone_statistics(struct zone *, struct zone *, gfp_t gfp);
224 171
225#else 172#else
226 173
227#define node_page_state(node, item) global_page_state(item) 174#define node_page_state(node, item) global_page_state(item)
228#define zone_statistics(_zl,_z) do { } while (0) 175#define zone_statistics(_zl, _z, gfp) do { } while (0)
229 176
230#endif /* CONFIG_NUMA */ 177#endif /* CONFIG_NUMA */
231 178
@@ -254,6 +201,12 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item);
254extern void __dec_zone_state(struct zone *, enum zone_stat_item); 201extern void __dec_zone_state(struct zone *, enum zone_stat_item);
255 202
256void refresh_cpu_vm_stats(int); 203void refresh_cpu_vm_stats(int);
204void refresh_zone_stat_thresholds(void);
205
206int calculate_pressure_threshold(struct zone *zone);
207int calculate_normal_threshold(struct zone *zone);
208void set_pgdat_percpu_threshold(pg_data_t *pgdat,
209 int (*calculate_pressure)(struct zone *));
257#else /* CONFIG_SMP */ 210#else /* CONFIG_SMP */
258 211
259/* 212/*
@@ -298,7 +251,13 @@ static inline void __dec_zone_page_state(struct page *page,
298#define dec_zone_page_state __dec_zone_page_state 251#define dec_zone_page_state __dec_zone_page_state
299#define mod_zone_page_state __mod_zone_page_state 252#define mod_zone_page_state __mod_zone_page_state
300 253
254#define set_pgdat_percpu_threshold(pgdat, callback) { }
255
301static inline void refresh_cpu_vm_stats(int cpu) { } 256static inline void refresh_cpu_vm_stats(int cpu) { }
302#endif 257static inline void refresh_zone_stat_thresholds(void) { }
258
259#endif /* CONFIG_SMP */
260
261extern const char * const vmstat_text[];
303 262
304#endif /* _LINUX_VMSTAT_H */ 263#endif /* _LINUX_VMSTAT_H */