From: kernel test robot <lkp@intel.com>
To: Kairui Song <kasong@tencent.com>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Huang, Ying" <ying.huang@intel.com>
Subject: [linux-next:master 6386/7397] mm/swap_state.c:256:46: error: 'SWAP_ADDRESS_SPACE_MASK' undeclared
Date: Fri, 21 Jun 2024 17:53:00 +0800 [thread overview]
Message-ID: <202406211750.Ks4k82Gi-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b992b79ca8bc336fa8e2c80990b5af80ed8f36fd
commit: 23c593d8220af52504cff1d99fbd39ab56a02c82 [6386/7397] mm/swap: reduce swap cache search space
config: x86_64-randconfig-014-20240202 (https://download.01.org/0day-ci/archive/20240621/202406211750.Ks4k82Gi-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240621/202406211750.Ks4k82Gi-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406211750.Ks4k82Gi-lkp@intel.com/
All errors (new ones prefixed by >>):
mm/swap_state.c:65:6: error: redefinition of 'show_swap_cache_info'
65 | void show_swap_cache_info(void)
| ^~~~~~~~~~~~~~~~~~~~
In file included from mm/swap_state.c:27:
mm/swap.h:104:20: note: previous definition of 'show_swap_cache_info' with type 'void(void)'
104 | static inline void show_swap_cache_info(void)
| ^~~~~~~~~~~~~~~~~~~~
mm/swap_state.c:72:7: error: redefinition of 'get_shadow_from_swap_cache'
72 | void *get_shadow_from_swap_cache(swp_entry_t entry)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
mm/swap.h:147:21: note: previous definition of 'get_shadow_from_swap_cache' with type 'void *(swp_entry_t)'
147 | static inline void *get_shadow_from_swap_cache(swp_entry_t entry)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
mm/swap_state.c:88:5: error: redefinition of 'add_to_swap_cache'
88 | int add_to_swap_cache(struct folio *folio, swp_entry_t entry,
| ^~~~~~~~~~~~~~~~~
mm/swap.h:152:19: note: previous definition of 'add_to_swap_cache' with type 'int(struct folio *, swp_entry_t, gfp_t, void **)' {aka 'int(struct folio *, swp_entry_t, unsigned int, void **)'}
152 | static inline int add_to_swap_cache(struct folio *folio, swp_entry_t entry,
| ^~~~~~~~~~~~~~~~~
mm/swap_state.c: In function 'add_to_swap_cache':
mm/swap_state.c:124:48: error: 'NR_SWAPCACHE' undeclared (first use in this function)
124 | __lruvec_stat_mod_folio(folio, NR_SWAPCACHE, nr);
| ^~~~~~~~~~~~
mm/swap_state.c:124:48: note: each undeclared identifier is reported only once for each function it appears in
mm/swap_state.c: At top level:
mm/swap_state.c:141:6: error: redefinition of '__delete_from_swap_cache'
141 | void __delete_from_swap_cache(struct folio *folio,
| ^~~~~~~~~~~~~~~~~~~~~~~~
mm/swap.h:158:20: note: previous definition of '__delete_from_swap_cache' with type 'void(struct folio *, swp_entry_t, void *)'
158 | static inline void __delete_from_swap_cache(struct folio *folio,
| ^~~~~~~~~~~~~~~~~~~~~~~~
mm/swap_state.c: In function '__delete_from_swap_cache':
mm/swap_state.c:165:40: error: 'NR_SWAPCACHE' undeclared (first use in this function)
165 | __lruvec_stat_mod_folio(folio, NR_SWAPCACHE, -nr);
| ^~~~~~~~~~~~
mm/swap_state.c: At top level:
mm/swap_state.c:178:6: error: redefinition of 'add_to_swap'
178 | bool add_to_swap(struct folio *folio)
| ^~~~~~~~~~~
mm/swap.h:142:20: note: previous definition of 'add_to_swap' with type 'bool(struct folio *)' {aka '_Bool(struct folio *)'}
142 | static inline bool add_to_swap(struct folio *folio)
| ^~~~~~~~~~~
mm/swap_state.c:235:6: error: redefinition of 'delete_from_swap_cache'
235 | void delete_from_swap_cache(struct folio *folio)
| ^~~~~~~~~~~~~~~~~~~~~~
mm/swap.h:163:20: note: previous definition of 'delete_from_swap_cache' with type 'void(struct folio *)'
163 | static inline void delete_from_swap_cache(struct folio *folio)
| ^~~~~~~~~~~~~~~~~~~~~~
mm/swap_state.c:248:6: error: redefinition of 'clear_shadow_from_swap_cache'
248 | void clear_shadow_from_swap_cache(int type, unsigned long begin,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/swap.h:167:20: note: previous definition of 'clear_shadow_from_swap_cache' with type 'void(int, long unsigned int, long unsigned int)'
167 | static inline void clear_shadow_from_swap_cache(int type, unsigned long begin,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/swap_state.c: In function 'clear_shadow_from_swap_cache':
>> mm/swap_state.c:256:46: error: 'SWAP_ADDRESS_SPACE_MASK' undeclared (first use in this function)
256 | unsigned long index = curr & SWAP_ADDRESS_SPACE_MASK;
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/list_lru.h:14,
from include/linux/fs.h:13,
from include/linux/huge_mm.h:8,
from include/linux/mm.h:1120,
from mm/swap_state.c:10:
mm/swap_state.c:263:67: error: 'SWAP_ADDRESS_SPACE_PAGES' undeclared (first use in this function)
263 | xas_for_each(&xas, old, min(index + (end - curr), SWAP_ADDRESS_SPACE_PAGES)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/xarray.h:1799:36: note: in definition of macro 'xas_for_each'
1799 | for (entry = xas_find(xas, max); entry; \
| ^~~
include/linux/minmax.h:56:31: note: in expansion of macro '__is_constexpr'
56 | __builtin_choose_expr(__is_constexpr((x) - (y)), \
| ^~~~~~~~~~~~~~
include/linux/minmax.h:85:25: note: in expansion of macro '__careful_cmp'
85 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
mm/swap_state.c:263:41: note: in expansion of macro 'min'
263 | xas_for_each(&xas, old, min(index + (end - curr), SWAP_ADDRESS_SPACE_PAGES)) {
| ^~~
include/linux/minmax.h:31:9: error: first argument to '__builtin_choose_expr' not a constant
31 | __builtin_choose_expr(__is_constexpr(is_signed_type(typeof(x))), \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/xarray.h:1799:36: note: in definition of macro 'xas_for_each'
1799 | for (entry = xas_find(xas, max); entry; \
| ^~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/minmax.h:51:9: note: in expansion of macro 'static_assert'
51 | static_assert(__types_ok(x, y), \
| ^~~~~~~~~~~~~
include/linux/minmax.h:39:28: note: in expansion of macro '__is_signed'
39 | (__is_signed(x) == __is_signed(y) || \
| ^~~~~~~~~~~
include/linux/minmax.h:51:23: note: in expansion of macro '__types_ok'
51 | static_assert(__types_ok(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:58:17: note: in expansion of macro '__cmp_once'
58 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
| ^~~~~~~~~~
include/linux/minmax.h:85:25: note: in expansion of macro '__careful_cmp'
85 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
mm/swap_state.c:263:41: note: in expansion of macro 'min'
263 | xas_for_each(&xas, old, min(index + (end - curr), SWAP_ADDRESS_SPACE_PAGES)) {
| ^~~
include/linux/minmax.h:31:9: error: first argument to '__builtin_choose_expr' not a constant
31 | __builtin_choose_expr(__is_constexpr(is_signed_type(typeof(x))), \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/xarray.h:1799:36: note: in definition of macro 'xas_for_each'
1799 | for (entry = xas_find(xas, max); entry; \
| ^~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/minmax.h:51:9: note: in expansion of macro 'static_assert'
51 | static_assert(__types_ok(x, y), \
| ^~~~~~~~~~~~~
include/linux/minmax.h:40:41: note: in expansion of macro '__is_signed'
40 | __is_signed((x) + 0) == __is_signed((y) + 0) || \
| ^~~~~~~~~~~
include/linux/minmax.h:51:23: note: in expansion of macro '__types_ok'
51 | static_assert(__types_ok(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:58:17: note: in expansion of macro '__cmp_once'
58 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
| ^~~~~~~~~~
include/linux/minmax.h:85:25: note: in expansion of macro '__careful_cmp'
85 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
mm/swap_state.c:263:41: note: in expansion of macro 'min'
263 | xas_for_each(&xas, old, min(index + (end - curr), SWAP_ADDRESS_SPACE_PAGES)) {
| ^~~
include/linux/minmax.h:31:9: error: first argument to '__builtin_choose_expr' not a constant
31 | __builtin_choose_expr(__is_constexpr(is_signed_type(typeof(x))), \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/xarray.h:1799:36: note: in definition of macro 'xas_for_each'
1799 | for (entry = xas_find(xas, max); entry; \
| ^~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/minmax.h:51:9: note: in expansion of macro 'static_assert'
51 | static_assert(__types_ok(x, y), \
| ^~~~~~~~~~~~~
include/linux/minmax.h:36:53: note: in expansion of macro '__is_signed'
36 | (__builtin_choose_expr(__is_constexpr(x) && __is_signed(x), x, -1) >= 0)
| ^~~~~~~~~~~
include/linux/minmax.h:41:38: note: in expansion of macro '__is_noneg_int'
41 | __is_noneg_int(x) || __is_noneg_int(y))
| ^~~~~~~~~~~~~~
include/linux/minmax.h:51:23: note: in expansion of macro '__types_ok'
51 | static_assert(__types_ok(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:58:17: note: in expansion of macro '__cmp_once'
58 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
| ^~~~~~~~~~
vim +/SWAP_ADDRESS_SPACE_MASK +256 mm/swap_state.c
247
248 void clear_shadow_from_swap_cache(int type, unsigned long begin,
249 unsigned long end)
250 {
251 unsigned long curr = begin;
252 void *old;
253
254 for (;;) {
255 swp_entry_t entry = swp_entry(type, curr);
> 256 unsigned long index = curr & SWAP_ADDRESS_SPACE_MASK;
257 struct address_space *address_space = swap_address_space(entry);
258 XA_STATE(xas, &address_space->i_pages, index);
259
260 xas_set_update(&xas, workingset_update_node);
261
262 xa_lock_irq(&address_space->i_pages);
263 xas_for_each(&xas, old, min(index + (end - curr), SWAP_ADDRESS_SPACE_PAGES)) {
264 if (!xa_is_value(old))
265 continue;
266 xas_store(&xas, NULL);
267 }
268 xa_unlock_irq(&address_space->i_pages);
269
270 /* search the next swapcache until we meet end */
271 curr >>= SWAP_ADDRESS_SPACE_SHIFT;
272 curr++;
273 curr <<= SWAP_ADDRESS_SPACE_SHIFT;
274 if (curr > end)
275 break;
276 }
277 }
278
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-06-21 9:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 9:53 kernel test robot [this message]
2024-06-21 12:44 ` Philip Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202406211750.Ks4k82Gi-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=kasong@tencent.com \
--cc=linux-mm@kvack.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox