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 #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL, HIGHMEM_ZONE(xx) xx##_MOVABLE
24 
25 enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
26 		FOR_ALL_ZONES(PGALLOC),
27 		FOR_ALL_ZONES(ALLOCSTALL),
28 		FOR_ALL_ZONES(PGSCAN_SKIP),
29 		PGFREE, PGACTIVATE, PGDEACTIVATE, PGLAZYFREE,
30 		PGFAULT, PGMAJFAULT,
31 		PGLAZYFREED,
32 		PGREFILL,
33 		PGREUSE,
34 		PGSTEAL_KSWAPD,
35 		PGSTEAL_DIRECT,
36 		PGSCAN_KSWAPD,
37 		PGSCAN_DIRECT,
38 		PGSCAN_DIRECT_THROTTLE,
39 		PGSCAN_ANON,
40 		PGSCAN_FILE,
41 		PGSTEAL_ANON,
42 		PGSTEAL_FILE,
43 #ifdef CONFIG_NUMA
44 		PGSCAN_ZONE_RECLAIM_FAILED,
45 #endif
46 		PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
47 		KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
48 		PAGEOUTRUN, PGROTATED,
49 		DROP_PAGECACHE, DROP_SLAB,
50 		OOM_KILL,
51 #ifdef CONFIG_NUMA_BALANCING
52 		NUMA_PTE_UPDATES,
53 		NUMA_HUGE_PTE_UPDATES,
54 		NUMA_HINT_FAULTS,
55 		NUMA_HINT_FAULTS_LOCAL,
56 		NUMA_PAGE_MIGRATE,
57 #endif
58 #ifdef CONFIG_MIGRATION
59 		PGMIGRATE_SUCCESS, PGMIGRATE_FAIL,
60 		THP_MIGRATION_SUCCESS,
61 		THP_MIGRATION_FAIL,
62 		THP_MIGRATION_SPLIT,
63 #endif
64 #ifdef CONFIG_COMPACTION
65 		COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED,
66 		COMPACTISOLATED,
67 		COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
68 		KCOMPACTD_WAKE,
69 		KCOMPACTD_MIGRATE_SCANNED, KCOMPACTD_FREE_SCANNED,
70 #endif
71 #ifdef CONFIG_HUGETLB_PAGE
72 		HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
73 #endif
74 		UNEVICTABLE_PGCULLED,	/* culled to noreclaim list */
75 		UNEVICTABLE_PGSCANNED,	/* scanned for reclaimability */
76 		UNEVICTABLE_PGRESCUED,	/* rescued from noreclaim list */
77 		UNEVICTABLE_PGMLOCKED,
78 		UNEVICTABLE_PGMUNLOCKED,
79 		UNEVICTABLE_PGCLEARED,	/* on COW, page truncate */
80 		UNEVICTABLE_PGSTRANDED,	/* unable to isolate on unlock */
81 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
82 		THP_FAULT_ALLOC,
83 		THP_FAULT_FALLBACK,
84 		THP_FAULT_FALLBACK_CHARGE,
85 		THP_COLLAPSE_ALLOC,
86 		THP_COLLAPSE_ALLOC_FAILED,
87 		THP_FILE_ALLOC,
88 		THP_FILE_FALLBACK,
89 		THP_FILE_FALLBACK_CHARGE,
90 		THP_FILE_MAPPED,
91 		THP_SPLIT_PAGE,
92 		THP_SPLIT_PAGE_FAILED,
93 		THP_DEFERRED_SPLIT_PAGE,
94 		THP_SPLIT_PMD,
95 #ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
96 		THP_SPLIT_PUD,
97 #endif
98 		THP_ZERO_PAGE_ALLOC,
99 		THP_ZERO_PAGE_ALLOC_FAILED,
100 		THP_SWPOUT,
101 		THP_SWPOUT_FALLBACK,
102 #endif
103 #ifdef CONFIG_MEMORY_BALLOON
104 		BALLOON_INFLATE,
105 		BALLOON_DEFLATE,
106 #ifdef CONFIG_BALLOON_COMPACTION
107 		BALLOON_MIGRATE,
108 #endif
109 #endif
110 #ifdef CONFIG_DEBUG_TLBFLUSH
111 		NR_TLB_REMOTE_FLUSH,	/* cpu tried to flush others' tlbs */
112 		NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */
113 		NR_TLB_LOCAL_FLUSH_ALL,
114 		NR_TLB_LOCAL_FLUSH_ONE,
115 #endif /* CONFIG_DEBUG_TLBFLUSH */
116 #ifdef CONFIG_DEBUG_VM_VMACACHE
117 		VMACACHE_FIND_CALLS,
118 		VMACACHE_FIND_HITS,
119 #endif
120 #ifdef CONFIG_SWAP
121 		SWAP_RA,
122 		SWAP_RA_HIT,
123 #endif
124 		NR_VM_EVENT_ITEMS
125 };
126 
127 #ifndef CONFIG_TRANSPARENT_HUGEPAGE
128 #define THP_FILE_ALLOC ({ BUILD_BUG(); 0; })
129 #define THP_FILE_FALLBACK ({ BUILD_BUG(); 0; })
130 #define THP_FILE_FALLBACK_CHARGE ({ BUILD_BUG(); 0; })
131 #define THP_FILE_MAPPED ({ BUILD_BUG(); 0; })
132 #endif
133 
134 #endif		/* VM_EVENT_ITEM_H_INCLUDED */
135