xref: /linux/include/linux/vm_event_item.h (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef VM_EVENT_ITEM_H_INCLUDED
3 #define VM_EVENT_ITEM_H_INCLUDED
4 
5 #ifdef CONFIG_ZONE_DMA
6 #define DMA_ZONE(xx) xx##_DMA,
7 #else
8 #define DMA_ZONE(xx)
9 #endif
10 
11 #ifdef CONFIG_ZONE_DMA32
12 #define DMA32_ZONE(xx) xx##_DMA32,
13 #else
14 #define DMA32_ZONE(xx)
15 #endif
16 
17 #ifdef CONFIG_HIGHMEM
18 #define HIGHMEM_ZONE(xx) xx##_HIGH,
19 #else
20 #define HIGHMEM_ZONE(xx)
21 #endif
22 
23 #ifdef CONFIG_ZONE_DEVICE
24 #define DEVICE_ZONE(xx) xx##_DEVICE,
25 #else
26 #define DEVICE_ZONE(xx)
27 #endif
28 
29 #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL, \
30 	HIGHMEM_ZONE(xx) xx##_MOVABLE, DEVICE_ZONE(xx)
31 
32 enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
33 		FOR_ALL_ZONES(PGALLOC)
34 		FOR_ALL_ZONES(ALLOCSTALL)
35 		FOR_ALL_ZONES(PGSCAN_SKIP)
36 		PGFREE, PGACTIVATE, PGDEACTIVATE, PGLAZYFREE,
37 		PGFAULT, PGMAJFAULT,
38 		PGLAZYFREED,
39 		PGREFILL,
40 		PGREUSE,
41 		PGSTEAL_KSWAPD,
42 		PGSTEAL_DIRECT,
43 		PGSTEAL_KHUGEPAGED,
44 		PGSCAN_KSWAPD,
45 		PGSCAN_DIRECT,
46 		PGSCAN_KHUGEPAGED,
47 		PGSCAN_DIRECT_THROTTLE,
48 		PGSCAN_ANON,
49 		PGSCAN_FILE,
50 		PGSTEAL_ANON,
51 		PGSTEAL_FILE,
52 #ifdef CONFIG_NUMA
53 		PGSCAN_ZONE_RECLAIM_SUCCESS,
54 		PGSCAN_ZONE_RECLAIM_FAILED,
55 #endif
56 		PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
57 		KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
58 		PAGEOUTRUN, PGROTATED,
59 		DROP_PAGECACHE, DROP_SLAB,
60 		OOM_KILL,
61 #ifdef CONFIG_NUMA_BALANCING
62 		NUMA_PTE_UPDATES,
63 		NUMA_HUGE_PTE_UPDATES,
64 		NUMA_HINT_FAULTS,
65 		NUMA_HINT_FAULTS_LOCAL,
66 		NUMA_PAGE_MIGRATE,
67 #endif
68 #ifdef CONFIG_MIGRATION
69 		PGMIGRATE_SUCCESS, PGMIGRATE_FAIL,
70 		THP_MIGRATION_SUCCESS,
71 		THP_MIGRATION_FAIL,
72 		THP_MIGRATION_SPLIT,
73 #endif
74 #ifdef CONFIG_COMPACTION
75 		COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED,
76 		COMPACTISOLATED,
77 		COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
78 		KCOMPACTD_WAKE,
79 		KCOMPACTD_MIGRATE_SCANNED, KCOMPACTD_FREE_SCANNED,
80 #endif
81 #ifdef CONFIG_HUGETLB_PAGE
82 		HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
83 #endif
84 #ifdef CONFIG_CMA
85 		CMA_ALLOC_SUCCESS,
86 		CMA_ALLOC_FAIL,
87 #endif
88 		UNEVICTABLE_PGCULLED,	/* culled to noreclaim list */
89 		UNEVICTABLE_PGSCANNED,	/* scanned for reclaimability */
90 		UNEVICTABLE_PGRESCUED,	/* rescued from noreclaim list */
91 		UNEVICTABLE_PGMLOCKED,
92 		UNEVICTABLE_PGMUNLOCKED,
93 		UNEVICTABLE_PGCLEARED,	/* on COW, page truncate */
94 		UNEVICTABLE_PGSTRANDED,	/* unable to isolate on unlock */
95 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
96 		THP_FAULT_ALLOC,
97 		THP_FAULT_FALLBACK,
98 		THP_FAULT_FALLBACK_CHARGE,
99 		THP_COLLAPSE_ALLOC,
100 		THP_COLLAPSE_ALLOC_FAILED,
101 		THP_FILE_ALLOC,
102 		THP_FILE_FALLBACK,
103 		THP_FILE_FALLBACK_CHARGE,
104 		THP_FILE_MAPPED,
105 		THP_SPLIT_PAGE,
106 		THP_SPLIT_PAGE_FAILED,
107 		THP_DEFERRED_SPLIT_PAGE,
108 		THP_UNDERUSED_SPLIT_PAGE,
109 		THP_SPLIT_PMD,
110 		THP_SCAN_EXCEED_NONE_PTE,
111 		THP_SCAN_EXCEED_SWAP_PTE,
112 		THP_SCAN_EXCEED_SHARED_PTE,
113 #ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
114 		THP_SPLIT_PUD,
115 #endif
116 		THP_ZERO_PAGE_ALLOC,
117 		THP_ZERO_PAGE_ALLOC_FAILED,
118 		THP_SWPOUT,
119 		THP_SWPOUT_FALLBACK,
120 #endif
121 #ifdef CONFIG_MEMORY_BALLOON
122 		BALLOON_INFLATE,
123 		BALLOON_DEFLATE,
124 #ifdef CONFIG_BALLOON_COMPACTION
125 		BALLOON_MIGRATE,
126 #endif
127 #endif
128 #ifdef CONFIG_DEBUG_TLBFLUSH
129 		NR_TLB_REMOTE_FLUSH,	/* cpu tried to flush others' tlbs */
130 		NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */
131 		NR_TLB_LOCAL_FLUSH_ALL,
132 		NR_TLB_LOCAL_FLUSH_ONE,
133 #endif /* CONFIG_DEBUG_TLBFLUSH */
134 #ifdef CONFIG_SWAP
135 		SWAP_RA,
136 		SWAP_RA_HIT,
137 #ifdef CONFIG_KSM
138 		KSM_SWPIN_COPY,
139 #endif
140 #endif
141 #ifdef CONFIG_KSM
142 		COW_KSM,
143 #endif
144 #ifdef CONFIG_ZSWAP
145 		ZSWPIN,
146 		ZSWPOUT,
147 		ZSWPWB,
148 #endif
149 #ifdef CONFIG_X86
150 		DIRECT_MAP_LEVEL2_SPLIT,
151 		DIRECT_MAP_LEVEL3_SPLIT,
152 #endif
153 #ifdef CONFIG_PER_VMA_LOCK_STATS
154 		VMA_LOCK_SUCCESS,
155 		VMA_LOCK_ABORT,
156 		VMA_LOCK_RETRY,
157 		VMA_LOCK_MISS,
158 #endif
159 #ifdef CONFIG_DEBUG_STACK_USAGE
160 		KSTACK_1K,
161 #if THREAD_SIZE > 1024
162 		KSTACK_2K,
163 #endif
164 #if THREAD_SIZE > 2048
165 		KSTACK_4K,
166 #endif
167 #if THREAD_SIZE > 4096
168 		KSTACK_8K,
169 #endif
170 #if THREAD_SIZE > 8192
171 		KSTACK_16K,
172 #endif
173 #if THREAD_SIZE > 16384
174 		KSTACK_32K,
175 #endif
176 #if THREAD_SIZE > 32768
177 		KSTACK_64K,
178 #endif
179 #if THREAD_SIZE > 65536
180 		KSTACK_REST,
181 #endif
182 #endif /* CONFIG_DEBUG_STACK_USAGE */
183 		NR_VM_EVENT_ITEMS
184 };
185 
186 #ifndef CONFIG_TRANSPARENT_HUGEPAGE
187 #define THP_FILE_ALLOC ({ BUILD_BUG(); 0; })
188 #define THP_FILE_FALLBACK ({ BUILD_BUG(); 0; })
189 #define THP_FILE_FALLBACK_CHARGE ({ BUILD_BUG(); 0; })
190 #define THP_FILE_MAPPED ({ BUILD_BUG(); 0; })
191 #endif
192 
193 #endif		/* VM_EVENT_ITEM_H_INCLUDED */
194