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