Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 2 | #ifndef _LINUX_VMSTAT_H |
| 3 | #define _LINUX_VMSTAT_H |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | #include <linux/percpu.h> |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 7 | #include <linux/mmzone.h> |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 8 | #include <linux/vm_event_item.h> |
Arun Sharma | 60063497 | 2011-07-26 16:09:06 -0700 | [diff] [blame] | 9 | #include <linux/atomic.h> |
Kemi Wang | 4518085 | 2017-11-15 17:38:22 -0800 | [diff] [blame] | 10 | #include <linux/static_key.h> |
Roman Gushchin | ea426c2 | 2020-08-06 23:20:35 -0700 | [diff] [blame] | 11 | #include <linux/mmdebug.h> |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 12 | |
Adrian Bunk | c748e13 | 2008-07-23 21:27:03 -0700 | [diff] [blame] | 13 | extern int sysctl_stat_interval; |
| 14 | |
Kemi Wang | 4518085 | 2017-11-15 17:38:22 -0800 | [diff] [blame] | 15 | #ifdef CONFIG_NUMA |
| 16 | #define ENABLE_NUMA_STAT 1 |
| 17 | #define DISABLE_NUMA_STAT 0 |
| 18 | extern int sysctl_vm_numa_stat; |
| 19 | DECLARE_STATIC_KEY_TRUE(vm_numa_stat_key); |
Christoph Hellwig | 3292739 | 2020-04-24 08:43:38 +0200 | [diff] [blame] | 20 | int sysctl_vm_numa_stat_handler(struct ctl_table *table, int write, |
| 21 | void *buffer, size_t *length, loff_t *ppos); |
Kemi Wang | 4518085 | 2017-11-15 17:38:22 -0800 | [diff] [blame] | 22 | #endif |
| 23 | |
Steven Rostedt | d51d1e6 | 2018-04-10 16:28:07 -0700 | [diff] [blame] | 24 | struct reclaim_stat { |
| 25 | unsigned nr_dirty; |
| 26 | unsigned nr_unqueued_dirty; |
| 27 | unsigned nr_congested; |
| 28 | unsigned nr_writeback; |
| 29 | unsigned nr_immediate; |
Johannes Weiner | 96f8bf4 | 2020-06-03 16:03:09 -0700 | [diff] [blame] | 30 | unsigned nr_pageout; |
Yu Zhao | ed01737 | 2020-10-15 20:09:55 -0700 | [diff] [blame] | 31 | unsigned nr_activate[ANON_AND_FILE]; |
Steven Rostedt | d51d1e6 | 2018-04-10 16:28:07 -0700 | [diff] [blame] | 32 | unsigned nr_ref_keep; |
| 33 | unsigned nr_unmap_fail; |
Jaewon Kim | 1f318a9b | 2020-06-03 16:01:15 -0700 | [diff] [blame] | 34 | unsigned nr_lazyfree_fail; |
Steven Rostedt | d51d1e6 | 2018-04-10 16:28:07 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
Konstantin Khlebnikov | 9d7ea9a | 2019-12-04 16:49:50 -0800 | [diff] [blame] | 37 | enum writeback_stat_item { |
| 38 | NR_DIRTY_THRESHOLD, |
| 39 | NR_DIRTY_BG_THRESHOLD, |
| 40 | NR_VM_WRITEBACK_STAT_ITEMS, |
| 41 | }; |
| 42 | |
Andrew Morton | 780a065 | 2007-02-10 01:44:41 -0800 | [diff] [blame] | 43 | #ifdef CONFIG_VM_EVENT_COUNTERS |
| 44 | /* |
| 45 | * Light weight per cpu counter implementation. |
| 46 | * |
| 47 | * Counters should only be incremented and no critical kernel component |
| 48 | * should rely on the counter values. |
| 49 | * |
| 50 | * Counters are handled completely inline. On many platforms the code |
| 51 | * generated will simply be the increment of a global address. |
| 52 | */ |
| 53 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 54 | struct vm_event_state { |
| 55 | unsigned long event[NR_VM_EVENT_ITEMS]; |
| 56 | }; |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 57 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 58 | DECLARE_PER_CPU(struct vm_event_state, vm_event_states); |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 59 | |
Christoph Lameter | 293b6a4 | 2014-04-07 15:39:43 -0700 | [diff] [blame] | 60 | /* |
| 61 | * vm counters are allowed to be racy. Use raw_cpu_ops to avoid the |
| 62 | * local_irq_disable overhead. |
| 63 | */ |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 64 | static inline void __count_vm_event(enum vm_event_item item) |
| 65 | { |
Christoph Lameter | 293b6a4 | 2014-04-07 15:39:43 -0700 | [diff] [blame] | 66 | raw_cpu_inc(vm_event_states.event[item]); |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 67 | } |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 68 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 69 | static inline void count_vm_event(enum vm_event_item item) |
| 70 | { |
Rusty Russell | dd17c8f | 2009-10-29 22:34:15 +0900 | [diff] [blame] | 71 | this_cpu_inc(vm_event_states.event[item]); |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 72 | } |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 73 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 74 | static inline void __count_vm_events(enum vm_event_item item, long delta) |
| 75 | { |
Christoph Lameter | 293b6a4 | 2014-04-07 15:39:43 -0700 | [diff] [blame] | 76 | raw_cpu_add(vm_event_states.event[item], delta); |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 77 | } |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 78 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 79 | static inline void count_vm_events(enum vm_event_item item, long delta) |
| 80 | { |
Rusty Russell | dd17c8f | 2009-10-29 22:34:15 +0900 | [diff] [blame] | 81 | this_cpu_add(vm_event_states.event[item], delta); |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 82 | } |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 83 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 84 | extern void all_vm_events(unsigned long *); |
Yijing Wang | f1cb087 | 2013-04-29 15:08:14 -0700 | [diff] [blame] | 85 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 86 | extern void vm_events_fold_cpu(int cpu); |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 87 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 88 | #else |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 89 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 90 | /* Disable counters */ |
Andrew Morton | 780a065 | 2007-02-10 01:44:41 -0800 | [diff] [blame] | 91 | static inline void count_vm_event(enum vm_event_item item) |
| 92 | { |
| 93 | } |
| 94 | static inline void count_vm_events(enum vm_event_item item, long delta) |
| 95 | { |
| 96 | } |
| 97 | static inline void __count_vm_event(enum vm_event_item item) |
| 98 | { |
| 99 | } |
| 100 | static inline void __count_vm_events(enum vm_event_item item, long delta) |
| 101 | { |
| 102 | } |
| 103 | static inline void all_vm_events(unsigned long *ret) |
| 104 | { |
| 105 | } |
| 106 | static inline void vm_events_fold_cpu(int cpu) |
| 107 | { |
| 108 | } |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 109 | |
Christoph Lameter | f8891e5 | 2006-06-30 01:55:45 -0700 | [diff] [blame] | 110 | #endif /* CONFIG_VM_EVENT_COUNTERS */ |
| 111 | |
Mel Gorman | 03c5a6e | 2012-11-02 14:52:48 +0000 | [diff] [blame] | 112 | #ifdef CONFIG_NUMA_BALANCING |
| 113 | #define count_vm_numa_event(x) count_vm_event(x) |
| 114 | #define count_vm_numa_events(x, y) count_vm_events(x, y) |
| 115 | #else |
| 116 | #define count_vm_numa_event(x) do {} while (0) |
Mel Gorman | 3c0ff46 | 2013-02-22 16:34:29 -0800 | [diff] [blame] | 117 | #define count_vm_numa_events(x, y) do { (void)(y); } while (0) |
Mel Gorman | 03c5a6e | 2012-11-02 14:52:48 +0000 | [diff] [blame] | 118 | #endif /* CONFIG_NUMA_BALANCING */ |
| 119 | |
Mel Gorman | ec65993 | 2014-01-21 14:33:16 -0800 | [diff] [blame] | 120 | #ifdef CONFIG_DEBUG_TLBFLUSH |
| 121 | #define count_vm_tlb_event(x) count_vm_event(x) |
| 122 | #define count_vm_tlb_events(x, y) count_vm_events(x, y) |
| 123 | #else |
| 124 | #define count_vm_tlb_event(x) do {} while (0) |
| 125 | #define count_vm_tlb_events(x, y) do { (void)(y); } while (0) |
| 126 | #endif |
| 127 | |
Davidlohr Bueso | 4f11514 | 2014-06-04 16:06:46 -0700 | [diff] [blame] | 128 | #ifdef CONFIG_DEBUG_VM_VMACACHE |
| 129 | #define count_vm_vmacache_event(x) count_vm_event(x) |
| 130 | #else |
| 131 | #define count_vm_vmacache_event(x) do {} while (0) |
| 132 | #endif |
| 133 | |
Mel Gorman | 16709d1 | 2016-07-28 15:46:56 -0700 | [diff] [blame] | 134 | #define __count_zid_vm_events(item, zid, delta) \ |
| 135 | __count_vm_events(item##_NORMAL - ZONE_NORMAL + zid, delta) |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 136 | |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 137 | /* |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 138 | * Zone and node-based page accounting with per cpu differentials. |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 139 | */ |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 140 | extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS]; |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 141 | extern atomic_long_t vm_node_stat[NR_VM_NODE_STAT_ITEMS]; |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 142 | extern atomic_long_t vm_numa_event[NR_VM_NUMA_EVENT_ITEMS]; |
Christoph Lameter | f6ac235 | 2006-06-30 01:55:32 -0700 | [diff] [blame] | 143 | |
Kemi Wang | 3a321d2 | 2017-09-08 16:12:48 -0700 | [diff] [blame] | 144 | #ifdef CONFIG_NUMA |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 145 | static inline void zone_numa_event_add(long x, struct zone *zone, |
| 146 | enum numa_stat_item item) |
Kemi Wang | 3a321d2 | 2017-09-08 16:12:48 -0700 | [diff] [blame] | 147 | { |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 148 | atomic_long_add(x, &zone->vm_numa_event[item]); |
| 149 | atomic_long_add(x, &vm_numa_event[item]); |
Kemi Wang | 3a321d2 | 2017-09-08 16:12:48 -0700 | [diff] [blame] | 150 | } |
| 151 | |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 152 | static inline unsigned long zone_numa_event_state(struct zone *zone, |
Kemi Wang | 3a321d2 | 2017-09-08 16:12:48 -0700 | [diff] [blame] | 153 | enum numa_stat_item item) |
| 154 | { |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 155 | return atomic_long_read(&zone->vm_numa_event[item]); |
| 156 | } |
Kemi Wang | 6380322 | 2017-09-08 16:12:55 -0700 | [diff] [blame] | 157 | |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 158 | static inline unsigned long |
| 159 | global_numa_event_state(enum numa_stat_item item) |
| 160 | { |
| 161 | return atomic_long_read(&vm_numa_event[item]); |
Kemi Wang | 3a321d2 | 2017-09-08 16:12:48 -0700 | [diff] [blame] | 162 | } |
| 163 | #endif /* CONFIG_NUMA */ |
| 164 | |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 165 | static inline void zone_page_state_add(long x, struct zone *zone, |
| 166 | enum zone_stat_item item) |
| 167 | { |
| 168 | atomic_long_add(x, &zone->vm_stat[item]); |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 169 | atomic_long_add(x, &vm_zone_stat[item]); |
| 170 | } |
| 171 | |
| 172 | static inline void node_page_state_add(long x, struct pglist_data *pgdat, |
| 173 | enum node_stat_item item) |
| 174 | { |
| 175 | atomic_long_add(x, &pgdat->vm_stat[item]); |
| 176 | atomic_long_add(x, &vm_node_stat[item]); |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 177 | } |
| 178 | |
Michal Hocko | c41f012 | 2017-09-06 16:23:36 -0700 | [diff] [blame] | 179 | static inline unsigned long global_zone_page_state(enum zone_stat_item item) |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 180 | { |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 181 | long x = atomic_long_read(&vm_zone_stat[item]); |
| 182 | #ifdef CONFIG_SMP |
| 183 | if (x < 0) |
| 184 | x = 0; |
| 185 | #endif |
| 186 | return x; |
| 187 | } |
| 188 | |
Roman Gushchin | ea426c2 | 2020-08-06 23:20:35 -0700 | [diff] [blame] | 189 | static inline |
| 190 | unsigned long global_node_page_state_pages(enum node_stat_item item) |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 191 | { |
| 192 | long x = atomic_long_read(&vm_node_stat[item]); |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 193 | #ifdef CONFIG_SMP |
| 194 | if (x < 0) |
| 195 | x = 0; |
| 196 | #endif |
| 197 | return x; |
| 198 | } |
| 199 | |
Roman Gushchin | ea426c2 | 2020-08-06 23:20:35 -0700 | [diff] [blame] | 200 | static inline unsigned long global_node_page_state(enum node_stat_item item) |
| 201 | { |
| 202 | VM_WARN_ON_ONCE(vmstat_item_in_bytes(item)); |
| 203 | |
| 204 | return global_node_page_state_pages(item); |
| 205 | } |
| 206 | |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 207 | static inline unsigned long zone_page_state(struct zone *zone, |
| 208 | enum zone_stat_item item) |
| 209 | { |
| 210 | long x = atomic_long_read(&zone->vm_stat[item]); |
| 211 | #ifdef CONFIG_SMP |
| 212 | if (x < 0) |
| 213 | x = 0; |
| 214 | #endif |
| 215 | return x; |
| 216 | } |
| 217 | |
Christoph Lameter | aa45484 | 2010-09-09 16:38:17 -0700 | [diff] [blame] | 218 | /* |
| 219 | * More accurate version that also considers the currently pending |
| 220 | * deltas. For that we need to loop over all cpus to find the current |
| 221 | * deltas. There is no synchronization so the result cannot be |
| 222 | * exactly accurate either. |
| 223 | */ |
| 224 | static inline unsigned long zone_page_state_snapshot(struct zone *zone, |
| 225 | enum zone_stat_item item) |
| 226 | { |
| 227 | long x = atomic_long_read(&zone->vm_stat[item]); |
| 228 | |
| 229 | #ifdef CONFIG_SMP |
| 230 | int cpu; |
| 231 | for_each_online_cpu(cpu) |
Mel Gorman | 28f836b | 2021-06-28 19:41:38 -0700 | [diff] [blame] | 232 | x += per_cpu_ptr(zone->per_cpu_zonestats, cpu)->vm_stat_diff[item]; |
Christoph Lameter | aa45484 | 2010-09-09 16:38:17 -0700 | [diff] [blame] | 233 | |
| 234 | if (x < 0) |
| 235 | x = 0; |
| 236 | #endif |
| 237 | return x; |
| 238 | } |
| 239 | |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 240 | #ifdef CONFIG_NUMA |
Mel Gorman | 3ac44a3 | 2021-06-28 19:41:47 -0700 | [diff] [blame] | 241 | /* See __count_vm_event comment on why raw_cpu_inc is used. */ |
| 242 | static inline void |
| 243 | __count_numa_event(struct zone *zone, enum numa_stat_item item) |
| 244 | { |
| 245 | struct per_cpu_zonestat __percpu *pzstats = zone->per_cpu_zonestats; |
| 246 | |
| 247 | raw_cpu_inc(pzstats->vm_numa_event[item]); |
| 248 | } |
| 249 | |
Mel Gorman | 3e23060 | 2021-06-28 19:41:50 -0700 | [diff] [blame] | 250 | static inline void |
| 251 | __count_numa_events(struct zone *zone, enum numa_stat_item item, long delta) |
| 252 | { |
| 253 | struct per_cpu_zonestat __percpu *pzstats = zone->per_cpu_zonestats; |
| 254 | |
| 255 | raw_cpu_add(pzstats->vm_numa_event[item], delta); |
| 256 | } |
| 257 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 258 | extern unsigned long sum_zone_node_page_state(int node, |
Kemi Wang | 3a321d2 | 2017-09-08 16:12:48 -0700 | [diff] [blame] | 259 | enum zone_stat_item item); |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 260 | extern unsigned long sum_zone_numa_event_state(int node, enum numa_stat_item item); |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 261 | extern unsigned long node_page_state(struct pglist_data *pgdat, |
| 262 | enum node_stat_item item); |
Roman Gushchin | ea426c2 | 2020-08-06 23:20:35 -0700 | [diff] [blame] | 263 | extern unsigned long node_page_state_pages(struct pglist_data *pgdat, |
| 264 | enum node_stat_item item); |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 265 | extern void fold_vm_numa_events(void); |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 266 | #else |
Michal Hocko | c41f012 | 2017-09-06 16:23:36 -0700 | [diff] [blame] | 267 | #define sum_zone_node_page_state(node, item) global_zone_page_state(item) |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 268 | #define node_page_state(node, item) global_node_page_state(item) |
Roman Gushchin | ea426c2 | 2020-08-06 23:20:35 -0700 | [diff] [blame] | 269 | #define node_page_state_pages(node, item) global_node_page_state_pages(item) |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 270 | static inline void fold_vm_numa_events(void) |
| 271 | { |
| 272 | } |
Christoph Lameter | ca889e6 | 2006-06-30 01:55:44 -0700 | [diff] [blame] | 273 | #endif /* CONFIG_NUMA */ |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 274 | |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 275 | #ifdef CONFIG_SMP |
Heiko Carstens | 6cdb18a | 2015-12-29 14:54:32 -0800 | [diff] [blame] | 276 | void __mod_zone_page_state(struct zone *, enum zone_stat_item item, long); |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 277 | void __inc_zone_page_state(struct page *, enum zone_stat_item); |
| 278 | void __dec_zone_page_state(struct page *, enum zone_stat_item); |
| 279 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 280 | void __mod_node_page_state(struct pglist_data *, enum node_stat_item item, long); |
| 281 | void __inc_node_page_state(struct page *, enum node_stat_item); |
| 282 | void __dec_node_page_state(struct page *, enum node_stat_item); |
| 283 | |
Heiko Carstens | 6cdb18a | 2015-12-29 14:54:32 -0800 | [diff] [blame] | 284 | void mod_zone_page_state(struct zone *, enum zone_stat_item, long); |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 285 | void inc_zone_page_state(struct page *, enum zone_stat_item); |
| 286 | void dec_zone_page_state(struct page *, enum zone_stat_item); |
| 287 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 288 | void mod_node_page_state(struct pglist_data *, enum node_stat_item, long); |
| 289 | void inc_node_page_state(struct page *, enum node_stat_item); |
| 290 | void dec_node_page_state(struct page *, enum node_stat_item); |
| 291 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 292 | extern void inc_node_state(struct pglist_data *, enum node_stat_item); |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 293 | extern void __inc_zone_state(struct zone *, enum zone_stat_item); |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 294 | extern void __inc_node_state(struct pglist_data *, enum node_stat_item); |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 295 | extern void dec_zone_state(struct zone *, enum zone_stat_item); |
| 296 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 297 | extern void __dec_node_state(struct pglist_data *, enum node_stat_item); |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 298 | |
Christoph Lameter | 0eb77e9 | 2016-01-14 15:21:40 -0800 | [diff] [blame] | 299 | void quiet_vmstat(void); |
Christoph Lameter | 2bb921e | 2013-09-11 14:21:30 -0700 | [diff] [blame] | 300 | void cpu_vm_stats_fold(int cpu); |
KOSAKI Motohiro | a6cccdc | 2011-05-24 17:11:33 -0700 | [diff] [blame] | 301 | void refresh_zone_stat_thresholds(void); |
Mel Gorman | b44129b | 2011-01-13 15:45:43 -0800 | [diff] [blame] | 302 | |
Hugh Dickins | 52b6f46 | 2016-05-19 17:12:50 -0700 | [diff] [blame] | 303 | struct ctl_table; |
Christoph Hellwig | 3292739 | 2020-04-24 08:43:38 +0200 | [diff] [blame] | 304 | int vmstat_refresh(struct ctl_table *, int write, void *buffer, size_t *lenp, |
| 305 | loff_t *ppos); |
Hugh Dickins | 52b6f46 | 2016-05-19 17:12:50 -0700 | [diff] [blame] | 306 | |
Mel Gorman | 28f836b | 2021-06-28 19:41:38 -0700 | [diff] [blame] | 307 | void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *); |
Minchan Kim | 5a88381 | 2012-10-08 16:33:39 -0700 | [diff] [blame] | 308 | |
Mel Gorman | b44129b | 2011-01-13 15:45:43 -0800 | [diff] [blame] | 309 | int calculate_pressure_threshold(struct zone *zone); |
| 310 | int calculate_normal_threshold(struct zone *zone); |
| 311 | void set_pgdat_percpu_threshold(pg_data_t *pgdat, |
| 312 | int (*calculate_pressure)(struct zone *)); |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 313 | #else /* CONFIG_SMP */ |
| 314 | |
| 315 | /* |
| 316 | * We do not maintain differentials in a single processor configuration. |
| 317 | * The functions directly modify the zone and global counters. |
| 318 | */ |
| 319 | static inline void __mod_zone_page_state(struct zone *zone, |
Heiko Carstens | 6cdb18a | 2015-12-29 14:54:32 -0800 | [diff] [blame] | 320 | enum zone_stat_item item, long delta) |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 321 | { |
| 322 | zone_page_state_add(delta, zone, item); |
| 323 | } |
| 324 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 325 | static inline void __mod_node_page_state(struct pglist_data *pgdat, |
| 326 | enum node_stat_item item, int delta) |
| 327 | { |
Roman Gushchin | be45831 | 2020-10-01 13:07:49 -0700 | [diff] [blame] | 328 | if (vmstat_item_in_bytes(item)) { |
Johannes Weiner | 629484a | 2021-02-25 17:16:51 -0800 | [diff] [blame] | 329 | /* |
| 330 | * Only cgroups use subpage accounting right now; at |
| 331 | * the global level, these items still change in |
| 332 | * multiples of whole pages. Store them as pages |
| 333 | * internally to keep the per-cpu counters compact. |
| 334 | */ |
Roman Gushchin | be45831 | 2020-10-01 13:07:49 -0700 | [diff] [blame] | 335 | VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1)); |
| 336 | delta >>= PAGE_SHIFT; |
| 337 | } |
| 338 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 339 | node_page_state_add(delta, pgdat, item); |
| 340 | } |
| 341 | |
Christoph Lameter | 7f4599e | 2006-07-10 04:44:30 -0700 | [diff] [blame] | 342 | static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) |
| 343 | { |
| 344 | atomic_long_inc(&zone->vm_stat[item]); |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 345 | atomic_long_inc(&vm_zone_stat[item]); |
| 346 | } |
| 347 | |
| 348 | static inline void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) |
| 349 | { |
| 350 | atomic_long_inc(&pgdat->vm_stat[item]); |
| 351 | atomic_long_inc(&vm_node_stat[item]); |
Christoph Lameter | 7f4599e | 2006-07-10 04:44:30 -0700 | [diff] [blame] | 352 | } |
| 353 | |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 354 | static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item) |
| 355 | { |
| 356 | atomic_long_dec(&zone->vm_stat[item]); |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 357 | atomic_long_dec(&vm_zone_stat[item]); |
| 358 | } |
| 359 | |
| 360 | static inline void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) |
| 361 | { |
| 362 | atomic_long_dec(&pgdat->vm_stat[item]); |
| 363 | atomic_long_dec(&vm_node_stat[item]); |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 364 | } |
| 365 | |
Johannes Weiner | 6a3ed21 | 2014-04-03 14:47:34 -0700 | [diff] [blame] | 366 | static inline void __inc_zone_page_state(struct page *page, |
| 367 | enum zone_stat_item item) |
| 368 | { |
| 369 | __inc_zone_state(page_zone(page), item); |
| 370 | } |
| 371 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 372 | static inline void __inc_node_page_state(struct page *page, |
| 373 | enum node_stat_item item) |
| 374 | { |
| 375 | __inc_node_state(page_pgdat(page), item); |
| 376 | } |
| 377 | |
| 378 | |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 379 | static inline void __dec_zone_page_state(struct page *page, |
| 380 | enum zone_stat_item item) |
| 381 | { |
Uwe Kleine-König | 57ce36f | 2008-02-25 16:45:03 +0100 | [diff] [blame] | 382 | __dec_zone_state(page_zone(page), item); |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 383 | } |
| 384 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 385 | static inline void __dec_node_page_state(struct page *page, |
| 386 | enum node_stat_item item) |
| 387 | { |
| 388 | __dec_node_state(page_pgdat(page), item); |
| 389 | } |
| 390 | |
| 391 | |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 392 | /* |
| 393 | * We only use atomic operations to update counters. So there is no need to |
| 394 | * disable interrupts. |
| 395 | */ |
| 396 | #define inc_zone_page_state __inc_zone_page_state |
| 397 | #define dec_zone_page_state __dec_zone_page_state |
| 398 | #define mod_zone_page_state __mod_zone_page_state |
| 399 | |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 400 | #define inc_node_page_state __inc_node_page_state |
| 401 | #define dec_node_page_state __dec_node_page_state |
| 402 | #define mod_node_page_state __mod_node_page_state |
| 403 | |
Johannes Weiner | 6a3ed21 | 2014-04-03 14:47:34 -0700 | [diff] [blame] | 404 | #define inc_zone_state __inc_zone_state |
Mel Gorman | 75ef718 | 2016-07-28 15:45:24 -0700 | [diff] [blame] | 405 | #define inc_node_state __inc_node_state |
Johannes Weiner | 6a3ed21 | 2014-04-03 14:47:34 -0700 | [diff] [blame] | 406 | #define dec_zone_state __dec_zone_state |
| 407 | |
Mel Gorman | b44129b | 2011-01-13 15:45:43 -0800 | [diff] [blame] | 408 | #define set_pgdat_percpu_threshold(pgdat, callback) { } |
Mel Gorman | 88f5acf | 2011-01-13 15:45:41 -0800 | [diff] [blame] | 409 | |
KOSAKI Motohiro | a6cccdc | 2011-05-24 17:11:33 -0700 | [diff] [blame] | 410 | static inline void refresh_zone_stat_thresholds(void) { } |
Christoph Lameter | 2bb921e | 2013-09-11 14:21:30 -0700 | [diff] [blame] | 411 | static inline void cpu_vm_stats_fold(int cpu) { } |
Christoph Lameter | 0eb77e9 | 2016-01-14 15:21:40 -0800 | [diff] [blame] | 412 | static inline void quiet_vmstat(void) { } |
KOSAKI Motohiro | a6cccdc | 2011-05-24 17:11:33 -0700 | [diff] [blame] | 413 | |
Minchan Kim | 5a88381 | 2012-10-08 16:33:39 -0700 | [diff] [blame] | 414 | static inline void drain_zonestat(struct zone *zone, |
Mel Gorman | 28f836b | 2021-06-28 19:41:38 -0700 | [diff] [blame] | 415 | struct per_cpu_zonestat *pzstats) { } |
KOSAKI Motohiro | fa25c50 | 2011-05-24 17:11:28 -0700 | [diff] [blame] | 416 | #endif /* CONFIG_SMP */ |
| 417 | |
Matthew Wilcox (Oracle) | a53e17e | 2021-01-18 08:14:00 -0500 | [diff] [blame^] | 418 | static inline void __zone_stat_mod_folio(struct folio *folio, |
| 419 | enum zone_stat_item item, long nr) |
| 420 | { |
| 421 | __mod_zone_page_state(folio_zone(folio), item, nr); |
| 422 | } |
| 423 | |
| 424 | static inline void __zone_stat_add_folio(struct folio *folio, |
| 425 | enum zone_stat_item item) |
| 426 | { |
| 427 | __mod_zone_page_state(folio_zone(folio), item, folio_nr_pages(folio)); |
| 428 | } |
| 429 | |
| 430 | static inline void __zone_stat_sub_folio(struct folio *folio, |
| 431 | enum zone_stat_item item) |
| 432 | { |
| 433 | __mod_zone_page_state(folio_zone(folio), item, -folio_nr_pages(folio)); |
| 434 | } |
| 435 | |
| 436 | static inline void zone_stat_mod_folio(struct folio *folio, |
| 437 | enum zone_stat_item item, long nr) |
| 438 | { |
| 439 | mod_zone_page_state(folio_zone(folio), item, nr); |
| 440 | } |
| 441 | |
| 442 | static inline void zone_stat_add_folio(struct folio *folio, |
| 443 | enum zone_stat_item item) |
| 444 | { |
| 445 | mod_zone_page_state(folio_zone(folio), item, folio_nr_pages(folio)); |
| 446 | } |
| 447 | |
| 448 | static inline void zone_stat_sub_folio(struct folio *folio, |
| 449 | enum zone_stat_item item) |
| 450 | { |
| 451 | mod_zone_page_state(folio_zone(folio), item, -folio_nr_pages(folio)); |
| 452 | } |
| 453 | |
| 454 | static inline void __node_stat_mod_folio(struct folio *folio, |
| 455 | enum node_stat_item item, long nr) |
| 456 | { |
| 457 | __mod_node_page_state(folio_pgdat(folio), item, nr); |
| 458 | } |
| 459 | |
| 460 | static inline void __node_stat_add_folio(struct folio *folio, |
| 461 | enum node_stat_item item) |
| 462 | { |
| 463 | __mod_node_page_state(folio_pgdat(folio), item, folio_nr_pages(folio)); |
| 464 | } |
| 465 | |
| 466 | static inline void __node_stat_sub_folio(struct folio *folio, |
| 467 | enum node_stat_item item) |
| 468 | { |
| 469 | __mod_node_page_state(folio_pgdat(folio), item, -folio_nr_pages(folio)); |
| 470 | } |
| 471 | |
| 472 | static inline void node_stat_mod_folio(struct folio *folio, |
| 473 | enum node_stat_item item, long nr) |
| 474 | { |
| 475 | mod_node_page_state(folio_pgdat(folio), item, nr); |
| 476 | } |
| 477 | |
| 478 | static inline void node_stat_add_folio(struct folio *folio, |
| 479 | enum node_stat_item item) |
| 480 | { |
| 481 | mod_node_page_state(folio_pgdat(folio), item, folio_nr_pages(folio)); |
| 482 | } |
| 483 | |
| 484 | static inline void node_stat_sub_folio(struct folio *folio, |
| 485 | enum node_stat_item item) |
| 486 | { |
| 487 | mod_node_page_state(folio_pgdat(folio), item, -folio_nr_pages(folio)); |
| 488 | } |
| 489 | |
Bartlomiej Zolnierkiewicz | d1ce749 | 2012-10-08 16:32:02 -0700 | [diff] [blame] | 490 | static inline void __mod_zone_freepage_state(struct zone *zone, int nr_pages, |
| 491 | int migratetype) |
| 492 | { |
| 493 | __mod_zone_page_state(zone, NR_FREE_PAGES, nr_pages); |
| 494 | if (is_migrate_cma(migratetype)) |
| 495 | __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages); |
| 496 | } |
| 497 | |
KOSAKI Motohiro | fa25c50 | 2011-05-24 17:11:28 -0700 | [diff] [blame] | 498 | extern const char * const vmstat_text[]; |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 499 | |
Konstantin Khlebnikov | 9d7ea9a | 2019-12-04 16:49:50 -0800 | [diff] [blame] | 500 | static inline const char *zone_stat_name(enum zone_stat_item item) |
| 501 | { |
| 502 | return vmstat_text[item]; |
| 503 | } |
| 504 | |
| 505 | #ifdef CONFIG_NUMA |
| 506 | static inline const char *numa_stat_name(enum numa_stat_item item) |
| 507 | { |
| 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + |
| 509 | item]; |
| 510 | } |
| 511 | #endif /* CONFIG_NUMA */ |
| 512 | |
| 513 | static inline const char *node_stat_name(enum node_stat_item item) |
| 514 | { |
| 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 516 | NR_VM_NUMA_EVENT_ITEMS + |
Konstantin Khlebnikov | 9d7ea9a | 2019-12-04 16:49:50 -0800 | [diff] [blame] | 517 | item]; |
| 518 | } |
| 519 | |
| 520 | static inline const char *lru_list_name(enum lru_list lru) |
| 521 | { |
| 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" |
| 523 | } |
| 524 | |
| 525 | static inline const char *writeback_stat_name(enum writeback_stat_item item) |
| 526 | { |
| 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 528 | NR_VM_NUMA_EVENT_ITEMS + |
Konstantin Khlebnikov | 9d7ea9a | 2019-12-04 16:49:50 -0800 | [diff] [blame] | 529 | NR_VM_NODE_STAT_ITEMS + |
| 530 | item]; |
| 531 | } |
| 532 | |
Konstantin Khlebnikov | ebc5d83d | 2019-12-04 16:49:53 -0800 | [diff] [blame] | 533 | #if defined(CONFIG_VM_EVENT_COUNTERS) || defined(CONFIG_MEMCG) |
Konstantin Khlebnikov | 9d7ea9a | 2019-12-04 16:49:50 -0800 | [diff] [blame] | 534 | static inline const char *vm_event_name(enum vm_event_item item) |
| 535 | { |
| 536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + |
Mel Gorman | f19298b | 2021-06-28 19:41:44 -0700 | [diff] [blame] | 537 | NR_VM_NUMA_EVENT_ITEMS + |
Konstantin Khlebnikov | 9d7ea9a | 2019-12-04 16:49:50 -0800 | [diff] [blame] | 538 | NR_VM_NODE_STAT_ITEMS + |
| 539 | NR_VM_WRITEBACK_STAT_ITEMS + |
| 540 | item]; |
| 541 | } |
Konstantin Khlebnikov | ebc5d83d | 2019-12-04 16:49:53 -0800 | [diff] [blame] | 542 | #endif /* CONFIG_VM_EVENT_COUNTERS || CONFIG_MEMCG */ |
Konstantin Khlebnikov | 9d7ea9a | 2019-12-04 16:49:50 -0800 | [diff] [blame] | 543 | |
Shakeel Butt | c47d503 | 2020-12-14 19:07:14 -0800 | [diff] [blame] | 544 | #ifdef CONFIG_MEMCG |
| 545 | |
| 546 | void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, |
| 547 | int val); |
| 548 | |
| 549 | static inline void mod_lruvec_state(struct lruvec *lruvec, |
| 550 | enum node_stat_item idx, int val) |
| 551 | { |
| 552 | unsigned long flags; |
| 553 | |
| 554 | local_irq_save(flags); |
| 555 | __mod_lruvec_state(lruvec, idx, val); |
| 556 | local_irq_restore(flags); |
| 557 | } |
| 558 | |
| 559 | void __mod_lruvec_page_state(struct page *page, |
| 560 | enum node_stat_item idx, int val); |
| 561 | |
| 562 | static inline void mod_lruvec_page_state(struct page *page, |
| 563 | enum node_stat_item idx, int val) |
| 564 | { |
| 565 | unsigned long flags; |
| 566 | |
| 567 | local_irq_save(flags); |
| 568 | __mod_lruvec_page_state(page, idx, val); |
| 569 | local_irq_restore(flags); |
| 570 | } |
| 571 | |
| 572 | #else |
| 573 | |
| 574 | static inline void __mod_lruvec_state(struct lruvec *lruvec, |
| 575 | enum node_stat_item idx, int val) |
| 576 | { |
| 577 | __mod_node_page_state(lruvec_pgdat(lruvec), idx, val); |
| 578 | } |
| 579 | |
| 580 | static inline void mod_lruvec_state(struct lruvec *lruvec, |
| 581 | enum node_stat_item idx, int val) |
| 582 | { |
| 583 | mod_node_page_state(lruvec_pgdat(lruvec), idx, val); |
| 584 | } |
| 585 | |
| 586 | static inline void __mod_lruvec_page_state(struct page *page, |
| 587 | enum node_stat_item idx, int val) |
| 588 | { |
| 589 | __mod_node_page_state(page_pgdat(page), idx, val); |
| 590 | } |
| 591 | |
| 592 | static inline void mod_lruvec_page_state(struct page *page, |
| 593 | enum node_stat_item idx, int val) |
| 594 | { |
| 595 | mod_node_page_state(page_pgdat(page), idx, val); |
| 596 | } |
| 597 | |
| 598 | #endif /* CONFIG_MEMCG */ |
| 599 | |
Johannes Weiner | 1c824a6 | 2021-04-29 22:55:32 -0700 | [diff] [blame] | 600 | static inline void inc_lruvec_state(struct lruvec *lruvec, |
| 601 | enum node_stat_item idx) |
Shakeel Butt | c47d503 | 2020-12-14 19:07:14 -0800 | [diff] [blame] | 602 | { |
Johannes Weiner | 1c824a6 | 2021-04-29 22:55:32 -0700 | [diff] [blame] | 603 | mod_lruvec_state(lruvec, idx, 1); |
Shakeel Butt | c47d503 | 2020-12-14 19:07:14 -0800 | [diff] [blame] | 604 | } |
| 605 | |
| 606 | static inline void __inc_lruvec_page_state(struct page *page, |
| 607 | enum node_stat_item idx) |
| 608 | { |
| 609 | __mod_lruvec_page_state(page, idx, 1); |
| 610 | } |
| 611 | |
| 612 | static inline void __dec_lruvec_page_state(struct page *page, |
| 613 | enum node_stat_item idx) |
| 614 | { |
| 615 | __mod_lruvec_page_state(page, idx, -1); |
| 616 | } |
| 617 | |
Matthew Wilcox (Oracle) | a53e17e | 2021-01-18 08:14:00 -0500 | [diff] [blame^] | 618 | static inline void __lruvec_stat_mod_folio(struct folio *folio, |
| 619 | enum node_stat_item idx, int val) |
| 620 | { |
| 621 | __mod_lruvec_page_state(&folio->page, idx, val); |
| 622 | } |
| 623 | |
| 624 | static inline void __lruvec_stat_add_folio(struct folio *folio, |
| 625 | enum node_stat_item idx) |
| 626 | { |
| 627 | __lruvec_stat_mod_folio(folio, idx, folio_nr_pages(folio)); |
| 628 | } |
| 629 | |
| 630 | static inline void __lruvec_stat_sub_folio(struct folio *folio, |
| 631 | enum node_stat_item idx) |
| 632 | { |
| 633 | __lruvec_stat_mod_folio(folio, idx, -folio_nr_pages(folio)); |
| 634 | } |
| 635 | |
Shakeel Butt | c47d503 | 2020-12-14 19:07:14 -0800 | [diff] [blame] | 636 | static inline void inc_lruvec_page_state(struct page *page, |
| 637 | enum node_stat_item idx) |
| 638 | { |
| 639 | mod_lruvec_page_state(page, idx, 1); |
| 640 | } |
| 641 | |
| 642 | static inline void dec_lruvec_page_state(struct page *page, |
| 643 | enum node_stat_item idx) |
| 644 | { |
| 645 | mod_lruvec_page_state(page, idx, -1); |
| 646 | } |
| 647 | |
Matthew Wilcox (Oracle) | a53e17e | 2021-01-18 08:14:00 -0500 | [diff] [blame^] | 648 | static inline void lruvec_stat_mod_folio(struct folio *folio, |
| 649 | enum node_stat_item idx, int val) |
| 650 | { |
| 651 | mod_lruvec_page_state(&folio->page, idx, val); |
| 652 | } |
| 653 | |
| 654 | static inline void lruvec_stat_add_folio(struct folio *folio, |
| 655 | enum node_stat_item idx) |
| 656 | { |
| 657 | lruvec_stat_mod_folio(folio, idx, folio_nr_pages(folio)); |
| 658 | } |
| 659 | |
| 660 | static inline void lruvec_stat_sub_folio(struct folio *folio, |
| 661 | enum node_stat_item idx) |
| 662 | { |
| 663 | lruvec_stat_mod_folio(folio, idx, -folio_nr_pages(folio)); |
| 664 | } |
Christoph Lameter | 2244b95 | 2006-06-30 01:55:33 -0700 | [diff] [blame] | 665 | #endif /* _LINUX_VMSTAT_H */ |