[kas:collapse/rfc-v1 26/76] include/linux/swapops.h:88:21: error: use of undeclared identifier 'MAX_SWAPFILES_SHIFT'
kernel test robot <[email protected]>
| Newsgroups | dev.linux.lists.oe-kbuild-all |
|---|---|
| Message-ID | <[email protected]> |
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git collapse/rfc-v1 head: efac4ce42bf9ea34a32d1563fe3370ee837a751f commit: 056b294111d8d94a963c8e885186a1a723a59808 [26/76] mm/collapse: sketch the new anonymous collapse engine config: i386-randconfig-141-20260818 (https://download.01.org/0day-ci/archive/20260818/[email protected]/config) compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211) smatch: v0.5.0-9187-g5189e3fb reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260818/[email protected]/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <[email protected]> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ All errors (new ones prefixed by >>): In file included from mm/collapse.c:8: In file included from include/linux/leafops.h:11: >> include/linux/swapops.h:88:21: error: use of undeclared identifier 'MAX_SWAPFILES_SHIFT' 88 | ret.val = (type << SWP_TYPE_SHIFT) | (offset & SWP_OFFSET_MASK); | ^~~~~~~~~~~~~~ include/linux/swapops.h:27:45: note: expanded from macro 'SWP_TYPE_SHIFT' 27 | #define SWP_TYPE_SHIFT (BITS_PER_XA_VALUE - MAX_SWAPFILES_SHIFT) | ^~~~~~~~~~~~~~~~~~~ include/linux/swapops.h:88:49: error: use of undeclared identifier 'MAX_SWAPFILES_SHIFT' 88 | ret.val = (type << SWP_TYPE_SHIFT) | (offset & SWP_OFFSET_MASK); | ^~~~~~~~~~~~~~~ include/linux/swapops.h:28:34: note: expanded from macro 'SWP_OFFSET_MASK' 28 | #define SWP_OFFSET_MASK ((1UL << SWP_TYPE_SHIFT) - 1) | ^~~~~~~~~~~~~~ include/linux/swapops.h:27:45: note: expanded from macro 'SWP_TYPE_SHIFT' 27 | #define SWP_TYPE_SHIFT (BITS_PER_XA_VALUE - MAX_SWAPFILES_SHIFT) | ^~~~~~~~~~~~~~~~~~~ include/linux/swapops.h:98:23: error: use of undeclared identifier 'MAX_SWAPFILES_SHIFT' 98 | return (entry.val >> SWP_TYPE_SHIFT); | ^~~~~~~~~~~~~~ include/linux/swapops.h:27:45: note: expanded from macro 'SWP_TYPE_SHIFT' 27 | #define SWP_TYPE_SHIFT (BITS_PER_XA_VALUE - MAX_SWAPFILES_SHIFT) | ^~~~~~~~~~~~~~~~~~~ include/linux/swapops.h:107:21: error: use of undeclared identifier 'MAX_SWAPFILES_SHIFT' 107 | return entry.val & SWP_OFFSET_MASK; | ^~~~~~~~~~~~~~~ include/linux/swapops.h:28:34: note: expanded from macro 'SWP_OFFSET_MASK' 28 | #define SWP_OFFSET_MASK ((1UL << SWP_TYPE_SHIFT) - 1) | ^~~~~~~~~~~~~~ include/linux/swapops.h:27:45: note: expanded from macro 'SWP_TYPE_SHIFT' 27 | #define SWP_TYPE_SHIFT (BITS_PER_XA_VALUE - MAX_SWAPFILES_SHIFT) | ^~~~~~~~~~~~~~~~~~~ >> include/linux/swapops.h:173:19: error: use of undeclared identifier 'SWP_MIGRATION_READ'; did you mean 'THP_MIGRATION_FAIL'? 173 | return swp_entry(SWP_MIGRATION_READ, offset); | ^~~~~~~~~~~~~~~~~~ | THP_MIGRATION_FAIL include/linux/vm_event_item.h:62:3: note: 'THP_MIGRATION_FAIL' declared here 62 | THP_MIGRATION_FAIL, | ^ In file included from mm/collapse.c:8: In file included from include/linux/leafops.h:11: >> include/linux/swapops.h:178:19: error: use of undeclared identifier 'SWP_MIGRATION_READ_EXCLUSIVE' 178 | return swp_entry(SWP_MIGRATION_READ_EXCLUSIVE, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> include/linux/swapops.h:183:19: error: use of undeclared identifier 'SWP_MIGRATION_WRITE' 183 | return swp_entry(SWP_MIGRATION_WRITE, offset); | ^~~~~~~~~~~~~~~~~~~ >> include/linux/swapops.h:304:19: error: use of undeclared identifier 'SWP_PTE_MARKER' 304 | return swp_entry(SWP_PTE_MARKER, marker); | ^~~~~~~~~~~~~~ 8 errors generated. vim +/MAX_SWAPFILES_SHIFT +88 include/linux/swapops.h 099dd6878b9b12 Peter Xu 2021-06-15 80 ^1da177e4c3f41 Linus Torvalds 2005-04-16 81 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 82 * Store a type+offset into a swp_entry_t in an arch-independent format ^1da177e4c3f41 Linus Torvalds 2005-04-16 83 */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 84 static inline swp_entry_t swp_entry(unsigned long type, pgoff_t offset) ^1da177e4c3f41 Linus Torvalds 2005-04-16 85 { ^1da177e4c3f41 Linus Torvalds 2005-04-16 86 swp_entry_t ret; ^1da177e4c3f41 Linus Torvalds 2005-04-16 87 3159f943aafdba Matthew Wilcox 2017-11-03 @88 ret.val = (type << SWP_TYPE_SHIFT) | (offset & SWP_OFFSET_MASK); ^1da177e4c3f41 Linus Torvalds 2005-04-16 89 return ret; ^1da177e4c3f41 Linus Torvalds 2005-04-16 90 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 91 ^1da177e4c3f41 Linus Torvalds 2005-04-16 92 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 93 * Extract the `type' field from a swp_entry_t. The swp_entry_t is in ^1da177e4c3f41 Linus Torvalds 2005-04-16 94 * arch-independent format ^1da177e4c3f41 Linus Torvalds 2005-04-16 95 */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 96 static inline unsigned swp_type(swp_entry_t entry) ^1da177e4c3f41 Linus Torvalds 2005-04-16 97 { 3159f943aafdba Matthew Wilcox 2017-11-03 98 return (entry.val >> SWP_TYPE_SHIFT); ^1da177e4c3f41 Linus Torvalds 2005-04-16 99 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 100 ^1da177e4c3f41 Linus Torvalds 2005-04-16 101 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 102 * Extract the `offset' field from a swp_entry_t. The swp_entry_t is in ^1da177e4c3f41 Linus Torvalds 2005-04-16 103 * arch-independent format ^1da177e4c3f41 Linus Torvalds 2005-04-16 104 */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 105 static inline pgoff_t swp_offset(swp_entry_t entry) ^1da177e4c3f41 Linus Torvalds 2005-04-16 106 { 3159f943aafdba Matthew Wilcox 2017-11-03 @107 return entry.val & SWP_OFFSET_MASK; ^1da177e4c3f41 Linus Torvalds 2005-04-16 108 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 109 ^1da177e4c3f41 Linus Torvalds 2005-04-16 110 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 111 * Convert the arch-independent representation of a swp_entry_t into the ^1da177e4c3f41 Linus Torvalds 2005-04-16 112 * arch-dependent pte representation. ^1da177e4c3f41 Linus Torvalds 2005-04-16 113 */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 114 static inline pte_t swp_entry_to_pte(swp_entry_t entry) ^1da177e4c3f41 Linus Torvalds 2005-04-16 115 { ^1da177e4c3f41 Linus Torvalds 2005-04-16 116 swp_entry_t arch_entry; ^1da177e4c3f41 Linus Torvalds 2005-04-16 117 ^1da177e4c3f41 Linus Torvalds 2005-04-16 118 arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); ^1da177e4c3f41 Linus Torvalds 2005-04-16 119 return __swp_entry_to_pte(arch_entry); ^1da177e4c3f41 Linus Torvalds 2005-04-16 120 } 0697212a411c1d Christoph Lameter 2006-06-23 121 a2c16d6cb0e478 Hugh Dickins 2011-08-03 122 static inline swp_entry_t radix_to_swp_entry(void *arg) a2c16d6cb0e478 Hugh Dickins 2011-08-03 123 { a2c16d6cb0e478 Hugh Dickins 2011-08-03 124 swp_entry_t entry; a2c16d6cb0e478 Hugh Dickins 2011-08-03 125 3159f943aafdba Matthew Wilcox 2017-11-03 126 entry.val = xa_to_value(arg); a2c16d6cb0e478 Hugh Dickins 2011-08-03 127 return entry; a2c16d6cb0e478 Hugh Dickins 2011-08-03 128 } a2c16d6cb0e478 Hugh Dickins 2011-08-03 129 a2c16d6cb0e478 Hugh Dickins 2011-08-03 130 static inline void *swp_to_radix_entry(swp_entry_t entry) a2c16d6cb0e478 Hugh Dickins 2011-08-03 131 { 3159f943aafdba Matthew Wilcox 2017-11-03 132 return xa_mk_value(entry.val); a2c16d6cb0e478 Hugh Dickins 2011-08-03 133 } a2c16d6cb0e478 Hugh Dickins 2011-08-03 134 5042db43cc26f5 Jérôme Glisse 2017-09-08 135 #if IS_ENABLED(CONFIG_DEVICE_PRIVATE) 4dd845b5a3e57a Alistair Popple 2021-06-30 136 static inline swp_entry_t make_readable_device_private_entry(pgoff_t offset) 5042db43cc26f5 Jérôme Glisse 2017-09-08 137 { 4dd845b5a3e57a Alistair Popple 2021-06-30 138 return swp_entry(SWP_DEVICE_READ, offset); 5042db43cc26f5 Jérôme Glisse 2017-09-08 139 } 5042db43cc26f5 Jérôme Glisse 2017-09-08 140 4dd845b5a3e57a Alistair Popple 2021-06-30 141 static inline swp_entry_t make_writable_device_private_entry(pgoff_t offset) 5042db43cc26f5 Jérôme Glisse 2017-09-08 142 { 4dd845b5a3e57a Alistair Popple 2021-06-30 143 return swp_entry(SWP_DEVICE_WRITE, offset); 5042db43cc26f5 Jérôme Glisse 2017-09-08 144 } 5042db43cc26f5 Jérôme Glisse 2017-09-08 145 c25465eb7630ff David Hildenbrand 2025-02-10 146 static inline swp_entry_t make_device_exclusive_entry(pgoff_t offset) b756a3b5e7ead8 Alistair Popple 2021-06-30 147 { c25465eb7630ff David Hildenbrand 2025-02-10 148 return swp_entry(SWP_DEVICE_EXCLUSIVE, offset); b756a3b5e7ead8 Alistair Popple 2021-06-30 149 } b756a3b5e7ead8 Alistair Popple 2021-06-30 150 5042db43cc26f5 Jérôme Glisse 2017-09-08 151 #else /* CONFIG_DEVICE_PRIVATE */ 4dd845b5a3e57a Alistair Popple 2021-06-30 152 static inline swp_entry_t make_readable_device_private_entry(pgoff_t offset) 5042db43cc26f5 Jérôme Glisse 2017-09-08 153 { 5042db43cc26f5 Jérôme Glisse 2017-09-08 154 return swp_entry(0, 0); 5042db43cc26f5 Jérôme Glisse 2017-09-08 155 } 5042db43cc26f5 Jérôme Glisse 2017-09-08 156 4dd845b5a3e57a Alistair Popple 2021-06-30 157 static inline swp_entry_t make_writable_device_private_entry(pgoff_t offset) 5042db43cc26f5 Jérôme Glisse 2017-09-08 158 { 4dd845b5a3e57a Alistair Popple 2021-06-30 159 return swp_entry(0, 0); 5042db43cc26f5 Jérôme Glisse 2017-09-08 160 } 5042db43cc26f5 Jérôme Glisse 2017-09-08 161 c25465eb7630ff David Hildenbrand 2025-02-10 162 static inline swp_entry_t make_device_exclusive_entry(pgoff_t offset) b756a3b5e7ead8 Alistair Popple 2021-06-30 163 { b756a3b5e7ead8 Alistair Popple 2021-06-30 164 return swp_entry(0, 0); b756a3b5e7ead8 Alistair Popple 2021-06-30 165 } b756a3b5e7ead8 Alistair Popple 2021-06-30 166 5042db43cc26f5 Jérôme Glisse 2017-09-08 167 #endif /* CONFIG_DEVICE_PRIVATE */ 5042db43cc26f5 Jérôme Glisse 2017-09-08 168 0697212a411c1d Christoph Lameter 2006-06-23 169 #ifdef CONFIG_MIGRATION 6c287605fd5646 David Hildenbrand 2022-05-09 170 4dd845b5a3e57a Alistair Popple 2021-06-30 171 static inline swp_entry_t make_readable_migration_entry(pgoff_t offset) 0697212a411c1d Christoph Lameter 2006-06-23 172 { 4dd845b5a3e57a Alistair Popple 2021-06-30 @173 return swp_entry(SWP_MIGRATION_READ, offset); 4dd845b5a3e57a Alistair Popple 2021-06-30 174 } 4dd845b5a3e57a Alistair Popple 2021-06-30 175 6c287605fd5646 David Hildenbrand 2022-05-09 176 static inline swp_entry_t make_readable_exclusive_migration_entry(pgoff_t offset) 6c287605fd5646 David Hildenbrand 2022-05-09 177 { 6c287605fd5646 David Hildenbrand 2022-05-09 @178 return swp_entry(SWP_MIGRATION_READ_EXCLUSIVE, offset); 6c287605fd5646 David Hildenbrand 2022-05-09 179 } 6c287605fd5646 David Hildenbrand 2022-05-09 180 4dd845b5a3e57a Alistair Popple 2021-06-30 181 static inline swp_entry_t make_writable_migration_entry(pgoff_t offset) 4dd845b5a3e57a Alistair Popple 2021-06-30 182 { 4dd845b5a3e57a Alistair Popple 2021-06-30 @183 return swp_entry(SWP_MIGRATION_WRITE, offset); 0697212a411c1d Christoph Lameter 2006-06-23 184 } 0697212a411c1d Christoph Lameter 2006-06-23 185 :::::: The code at line 88 was first introduced by commit :::::: 3159f943aafdbacb2f94c38fdaadabf2bbde2a14 xarray: Replace exceptional entries :::::: TO: Matthew Wilcox <[email protected]> :::::: CC: Matthew Wilcox <[email protected]> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki