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