Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 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 |
yalin wang | f7ae3a9 | 2015-11-05 18:48:50 -0800 | [diff] [blame] | 18 | #define HIGHMEM_ZONE(xx) xx##_HIGH, |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 19 | #else |
| 20 | #define HIGHMEM_ZONE(xx) |
| 21 | #endif |
| 22 | |
yalin wang | f7ae3a9 | 2015-11-05 18:48:50 -0800 | [diff] [blame] | 23 | #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL, HIGHMEM_ZONE(xx) xx##_MOVABLE |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 24 | |
| 25 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, |
| 26 | FOR_ALL_ZONES(PGALLOC), |
Mel Gorman | 7cc30fc | 2016-07-28 15:46:59 -0700 | [diff] [blame] | 27 | FOR_ALL_ZONES(ALLOCSTALL), |
| 28 | FOR_ALL_ZONES(PGSCAN_SKIP), |
Shaohua Li | f7ad2a6 | 2017-05-03 14:52:29 -0700 | [diff] [blame] | 29 | PGFREE, PGACTIVATE, PGDEACTIVATE, PGLAZYFREE, |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 30 | PGFAULT, PGMAJFAULT, |
Minchan Kim | 854e9ed | 2016-01-15 16:54:53 -0800 | [diff] [blame] | 31 | PGLAZYFREED, |
Mel Gorman | 599d0c9 | 2016-07-28 15:45:31 -0700 | [diff] [blame] | 32 | PGREFILL, |
| 33 | PGSTEAL_KSWAPD, |
| 34 | PGSTEAL_DIRECT, |
| 35 | PGSCAN_KSWAPD, |
| 36 | PGSCAN_DIRECT, |
Mel Gorman | 68243e7 | 2012-07-31 16:44:39 -0700 | [diff] [blame] | 37 | PGSCAN_DIRECT_THROTTLE, |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 38 | #ifdef CONFIG_NUMA |
| 39 | PGSCAN_ZONE_RECLAIM_FAILED, |
| 40 | #endif |
Ying Han | 904249a | 2012-04-25 16:01:48 -0700 | [diff] [blame] | 41 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 42 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, |
Mel Gorman | 7cc30fc | 2016-07-28 15:46:59 -0700 | [diff] [blame] | 43 | PAGEOUTRUN, PGROTATED, |
Dave Hansen | 5509a5d | 2014-04-03 14:48:19 -0700 | [diff] [blame] | 44 | DROP_PAGECACHE, DROP_SLAB, |
Konstantin Khlebnikov | 8e675f7 | 2017-07-06 15:40:28 -0700 | [diff] [blame] | 45 | OOM_KILL, |
Mel Gorman | 03c5a6e | 2012-11-02 14:52:48 +0000 | [diff] [blame] | 46 | #ifdef CONFIG_NUMA_BALANCING |
| 47 | NUMA_PTE_UPDATES, |
Mel Gorman | 72403b4 | 2013-11-12 15:08:32 -0800 | [diff] [blame] | 48 | NUMA_HUGE_PTE_UPDATES, |
Mel Gorman | 03c5a6e | 2012-11-02 14:52:48 +0000 | [diff] [blame] | 49 | NUMA_HINT_FAULTS, |
| 50 | NUMA_HINT_FAULTS_LOCAL, |
| 51 | NUMA_PAGE_MIGRATE, |
| 52 | #endif |
Mel Gorman | 5647bc2 | 2012-10-19 10:46:20 +0100 | [diff] [blame] | 53 | #ifdef CONFIG_MIGRATION |
| 54 | PGMIGRATE_SUCCESS, PGMIGRATE_FAIL, |
| 55 | #endif |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 56 | #ifdef CONFIG_COMPACTION |
Mel Gorman | 397487d | 2012-10-19 12:00:10 +0100 | [diff] [blame] | 57 | COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED, |
| 58 | COMPACTISOLATED, |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 59 | COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS, |
Vlastimil Babka | 698b1b3 | 2016-03-17 14:18:08 -0700 | [diff] [blame] | 60 | KCOMPACTD_WAKE, |
David Rientjes | 7f354a5 | 2017-02-22 15:44:50 -0800 | [diff] [blame] | 61 | KCOMPACTD_MIGRATE_SCANNED, KCOMPACTD_FREE_SCANNED, |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 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 */ |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 73 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 74 | THP_FAULT_ALLOC, |
| 75 | THP_FAULT_FALLBACK, |
| 76 | THP_COLLAPSE_ALLOC, |
| 77 | THP_COLLAPSE_ALLOC_FAILED, |
Kirill A. Shutemov | 95ecedc | 2016-07-26 15:25:31 -0700 | [diff] [blame] | 78 | THP_FILE_ALLOC, |
| 79 | THP_FILE_MAPPED, |
Kirill A. Shutemov | 122afea | 2016-01-15 16:52:46 -0800 | [diff] [blame] | 80 | THP_SPLIT_PAGE, |
| 81 | THP_SPLIT_PAGE_FAILED, |
Kirill A. Shutemov | f9719a0 | 2016-03-17 14:18:45 -0700 | [diff] [blame] | 82 | THP_DEFERRED_SPLIT_PAGE, |
Kirill A. Shutemov | 122afea | 2016-01-15 16:52:46 -0800 | [diff] [blame] | 83 | THP_SPLIT_PMD, |
Yisheng Xie | ce9311c | 2017-03-09 16:17:00 -0800 | [diff] [blame] | 84 | #ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD |
| 85 | THP_SPLIT_PUD, |
| 86 | #endif |
Kirill A. Shutemov | d8a8e1f | 2012-12-12 13:51:09 -0800 | [diff] [blame] | 87 | THP_ZERO_PAGE_ALLOC, |
| 88 | THP_ZERO_PAGE_ALLOC_FAILED, |
Huang Ying | 225311a | 2017-09-06 16:22:30 -0700 | [diff] [blame] | 89 | THP_SWPOUT, |
Huang Ying | fe490cc | 2017-09-06 16:22:52 -0700 | [diff] [blame] | 90 | THP_SWPOUT_FALLBACK, |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 91 | #endif |
Konstantin Khlebnikov | 09316c0 | 2014-10-09 15:29:32 -0700 | [diff] [blame] | 92 | #ifdef CONFIG_MEMORY_BALLOON |
| 93 | BALLOON_INFLATE, |
| 94 | BALLOON_DEFLATE, |
| 95 | #ifdef CONFIG_BALLOON_COMPACTION |
| 96 | BALLOON_MIGRATE, |
| 97 | #endif |
| 98 | #endif |
Mel Gorman | ec65993 | 2014-01-21 14:33:16 -0800 | [diff] [blame] | 99 | #ifdef CONFIG_DEBUG_TLBFLUSH |
Dave Hansen | 9824cf9 | 2013-09-11 14:20:23 -0700 | [diff] [blame] | 100 | NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */ |
| 101 | NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */ |
| 102 | NR_TLB_LOCAL_FLUSH_ALL, |
| 103 | NR_TLB_LOCAL_FLUSH_ONE, |
Mel Gorman | ec65993 | 2014-01-21 14:33:16 -0800 | [diff] [blame] | 104 | #endif /* CONFIG_DEBUG_TLBFLUSH */ |
Davidlohr Bueso | 4f11514 | 2014-06-04 16:06:46 -0700 | [diff] [blame] | 105 | #ifdef CONFIG_DEBUG_VM_VMACACHE |
| 106 | VMACACHE_FIND_CALLS, |
| 107 | VMACACHE_FIND_HITS, |
| 108 | #endif |
Huang Ying | cbc65df | 2017-09-06 16:24:29 -0700 | [diff] [blame] | 109 | #ifdef CONFIG_SWAP |
| 110 | SWAP_RA, |
| 111 | SWAP_RA_HIT, |
| 112 | #endif |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 113 | NR_VM_EVENT_ITEMS |
| 114 | }; |
| 115 | |
Kirill A. Shutemov | 95ecedc | 2016-07-26 15:25:31 -0700 | [diff] [blame] | 116 | #ifndef CONFIG_TRANSPARENT_HUGEPAGE |
| 117 | #define THP_FILE_ALLOC ({ BUILD_BUG(); 0; }) |
| 118 | #define THP_FILE_MAPPED ({ BUILD_BUG(); 0; }) |
| 119 | #endif |
| 120 | |
Andrew Morton | f042e70 | 2011-05-26 16:25:24 -0700 | [diff] [blame] | 121 | #endif /* VM_EVENT_ITEM_H_INCLUDED */ |