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 #ifdef CONFIG_CMA 75 CMA_ALLOC_SUCCESS, 76 CMA_ALLOC_FAIL, 77 #endif 78 UNEVICTABLE_PGCULLED, /* culled to noreclaim list */ 79 UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */ 80 UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */ 81 UNEVICTABLE_PGMLOCKED, 82 UNEVICTABLE_PGMUNLOCKED, 83 UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ 84 UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ 85 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 86 THP_FAULT_ALLOC, 87 THP_FAULT_FALLBACK, 88 THP_FAULT_FALLBACK_CHARGE, 89 THP_COLLAPSE_ALLOC, 90 THP_COLLAPSE_ALLOC_FAILED, 91 THP_FILE_ALLOC, 92 THP_FILE_FALLBACK, 93 THP_FILE_FALLBACK_CHARGE, 94 THP_FILE_MAPPED, 95 THP_SPLIT_PAGE, 96 THP_SPLIT_PAGE_FAILED, 97 THP_DEFERRED_SPLIT_PAGE, 98 THP_SPLIT_PMD, 99 #ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD 100 THP_SPLIT_PUD, 101 #endif 102 THP_ZERO_PAGE_ALLOC, 103 THP_ZERO_PAGE_ALLOC_FAILED, 104 THP_SWPOUT, 105 THP_SWPOUT_FALLBACK, 106 #endif 107 #ifdef CONFIG_MEMORY_BALLOON 108 BALLOON_INFLATE, 109 BALLOON_DEFLATE, 110 #ifdef CONFIG_BALLOON_COMPACTION 111 BALLOON_MIGRATE, 112 #endif 113 #endif 114 #ifdef CONFIG_DEBUG_TLBFLUSH 115 NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */ 116 NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */ 117 NR_TLB_LOCAL_FLUSH_ALL, 118 NR_TLB_LOCAL_FLUSH_ONE, 119 #endif /* CONFIG_DEBUG_TLBFLUSH */ 120 #ifdef CONFIG_DEBUG_VM_VMACACHE 121 VMACACHE_FIND_CALLS, 122 VMACACHE_FIND_HITS, 123 #endif 124 #ifdef CONFIG_SWAP 125 SWAP_RA, 126 SWAP_RA_HIT, 127 #endif 128 #ifdef CONFIG_SPECULATIVE_PAGE_FAULT 129 SPECULATIVE_PGFAULT_ANON, 130 SPECULATIVE_PGFAULT_FILE, 131 #endif 132 NR_VM_EVENT_ITEMS 133 }; 134 135 #ifndef CONFIG_TRANSPARENT_HUGEPAGE 136 #define THP_FILE_ALLOC ({ BUILD_BUG(); 0; }) 137 #define THP_FILE_FALLBACK ({ BUILD_BUG(); 0; }) 138 #define THP_FILE_FALLBACK_CHARGE ({ BUILD_BUG(); 0; }) 139 #define THP_FILE_MAPPED ({ BUILD_BUG(); 0; }) 140 #endif 141 142 #endif /* VM_EVENT_ITEM_H_INCLUDED */ 143