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.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 97e11ab573f0..9ac82e29948f 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -107,8 +107,33 @@ static inline void vm_events_fold_cpu(int cpu)
107 * Zone and node-based page accounting with per cpu differentials. 107 * Zone and node-based page accounting with per cpu differentials.
108 */ 108 */
109extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS]; 109extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS];
110extern atomic_long_t vm_numa_stat[NR_VM_NUMA_STAT_ITEMS];
110extern atomic_long_t vm_node_stat[NR_VM_NODE_STAT_ITEMS]; 111extern atomic_long_t vm_node_stat[NR_VM_NODE_STAT_ITEMS];
111 112
113#ifdef CONFIG_NUMA
114static inline void zone_numa_state_add(long x, struct zone *zone,
115 enum numa_stat_item item)
116{
117 atomic_long_add(x, &zone->vm_numa_stat[item]);
118 atomic_long_add(x, &vm_numa_stat[item]);
119}
120
121static inline unsigned long global_numa_state(enum numa_stat_item item)
122{
123 long x = atomic_long_read(&vm_numa_stat[item]);
124
125 return x;
126}
127
128static inline unsigned long zone_numa_state(struct zone *zone,
129 enum numa_stat_item item)
130{
131 long x = atomic_long_read(&zone->vm_numa_stat[item]);
132
133 return x;
134}
135#endif /* CONFIG_NUMA */
136
112static inline void zone_page_state_add(long x, struct zone *zone, 137static inline void zone_page_state_add(long x, struct zone *zone,
113 enum zone_stat_item item) 138 enum zone_stat_item item)
114{ 139{
@@ -194,8 +219,10 @@ static inline unsigned long node_page_state_snapshot(pg_data_t *pgdat,
194 219
195 220
196#ifdef CONFIG_NUMA 221#ifdef CONFIG_NUMA
222extern void __inc_numa_state(struct zone *zone, enum numa_stat_item item);
197extern unsigned long sum_zone_node_page_state(int node, 223extern unsigned long sum_zone_node_page_state(int node,
198 enum zone_stat_item item); 224 enum zone_stat_item item);
225extern unsigned long sum_zone_numa_state(int node, enum numa_stat_item item);
199extern unsigned long node_page_state(struct pglist_data *pgdat, 226extern unsigned long node_page_state(struct pglist_data *pgdat,
200 enum node_stat_item item); 227 enum node_stat_item item);
201#else 228#else