All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chen Ridong <chenridong@huaweicloud.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH -next 1/7] vmscan: add memcg heat level for reclaim
Date: Wed, 21 Jan 2026 19:30:45 +0800	[thread overview]
Message-ID: <202601211944.R2nx1Vd1-lkp@intel.com> (raw)
In-Reply-To: <20260120134256.2271710-2-chenridong@huaweicloud.com>

Hi Chen,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on next-20260119]

url:    https://github.com/intel-lab-lkp/linux/commits/Chen-Ridong/vmscan-add-memcg-heat-level-for-reclaim/20260120-220026
base:   next-20260119
patch link:    https://lore.kernel.org/r/20260120134256.2271710-2-chenridong%40huaweicloud.com
patch subject: [RFC PATCH -next 1/7] vmscan: add memcg heat level for reclaim
config: alpha-allnoconfig (https://download.01.org/0day-ci/archive/20260121/202601211944.R2nx1Vd1-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260121/202601211944.R2nx1Vd1-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/202601211944.R2nx1Vd1-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> mm/vmscan.c:5994:38: warning: 'struct mem_cgroup_per_node' declared inside parameter list will not be visible outside of this definition or declaration
    5994 | static void memcg_adjust_heat(struct mem_cgroup_per_node *pn, long delta)
         |                                      ^~~~~~~~~~~~~~~~~~~
   mm/vmscan.c: In function 'memcg_adjust_heat':
>> mm/vmscan.c:5998:34: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    5998 |         if (mem_cgroup_is_root(pn->memcg))
         |                                  ^~
   mm/vmscan.c:6001:36: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6001 |         heat = atomic_long_read(&pn->reclaim.heat);
         |                                    ^~
   mm/vmscan.c:6004:44: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6004 |                 if (atomic_long_cmpxchg(&pn->reclaim.heat, heat, new_heat) == heat)
         |                                            ^~
   mm/vmscan.c:6006:44: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6006 |                 heat = atomic_long_read(&pn->reclaim.heat);
         |                                            ^~
   mm/vmscan.c: At top level:
   mm/vmscan.c:6010:37: warning: 'struct mem_cgroup_per_node' declared inside parameter list will not be visible outside of this definition or declaration
    6010 | static void memcg_decay_heat(struct mem_cgroup_per_node *pn)
         |                                     ^~~~~~~~~~~~~~~~~~~
   mm/vmscan.c: In function 'memcg_decay_heat':
   mm/vmscan.c:6015:34: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6015 |         if (mem_cgroup_is_root(pn->memcg))
         |                                  ^~
   In file included from <command-line>:
   mm/vmscan.c:6018:28: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                            ^~
   include/linux/compiler_types.h:676:23: note: in definition of macro '__compiletime_assert'
     676 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:696:9: note: in expansion of macro '_compiletime_assert'
     696 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                            ^~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c:6018:16: note: in expansion of macro 'READ_ONCE'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                ^~~~~~~~~
   mm/vmscan.c:6018:28: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                            ^~
   include/linux/compiler_types.h:676:23: note: in definition of macro '__compiletime_assert'
     676 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:696:9: note: in expansion of macro '_compiletime_assert'
     696 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                            ^~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c:6018:16: note: in expansion of macro 'READ_ONCE'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                ^~~~~~~~~
   mm/vmscan.c:6018:28: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                            ^~
   include/linux/compiler_types.h:676:23: note: in definition of macro '__compiletime_assert'
     676 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:696:9: note: in expansion of macro '_compiletime_assert'
     696 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                            ^~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c:6018:16: note: in expansion of macro 'READ_ONCE'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                ^~~~~~~~~
   mm/vmscan.c:6018:28: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                            ^~
   include/linux/compiler_types.h:676:23: note: in definition of macro '__compiletime_assert'
     676 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:696:9: note: in expansion of macro '_compiletime_assert'
     696 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                            ^~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c:6018:16: note: in expansion of macro 'READ_ONCE'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                ^~~~~~~~~
   mm/vmscan.c:6018:28: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                            ^~
   include/linux/compiler_types.h:676:23: note: in definition of macro '__compiletime_assert'
     676 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:696:9: note: in expansion of macro '_compiletime_assert'
     696 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c:6018:16: note: in expansion of macro 'READ_ONCE'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                ^~~~~~~~~
   mm/vmscan.c:6018:28: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                            ^~
   include/linux/compiler_types.h:632:53: note: in definition of macro '__unqual_scalar_typeof'
     632 | #define __unqual_scalar_typeof(x) __typeof_unqual__(x)
         |                                                     ^
   include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
      50 |         __READ_ONCE(x);                                                 \
         |         ^~~~~~~~~~~
   mm/vmscan.c:6018:16: note: in expansion of macro 'READ_ONCE'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                ^~~~~~~~~
   In file included from arch/alpha/include/asm/rwonce.h:33,
                    from include/linux/compiler.h:372,
                    from include/linux/export.h:5,
                    from include/linux/linkage.h:7,
                    from arch/alpha/include/asm/bug.h:5,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:6,
                    from mm/vmscan.c:15:
   mm/vmscan.c:6018:28: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                            ^~
   include/asm-generic/rwonce.h:44:73: note: in definition of macro '__READ_ONCE'
      44 | #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
         |                                                                         ^
   mm/vmscan.c:6018:16: note: in expansion of macro 'READ_ONCE'
    6018 |         last = READ_ONCE(pn->reclaim.last_decay);
         |                ^~~~~~~~~
   In file included from include/linux/atomic.h:82,
                    from include/linux/cpumask.h:10,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/spinlock.h:63,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:7,
                    from include/linux/mm.h:7:
   mm/vmscan.c:6022:24: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |                        ^~
   include/linux/atomic/atomic-instrumented.h:4785:16: note: in definition of macro 'cmpxchg'
    4785 |         typeof(ptr) __ai_ptr = (ptr); \
         |                ^~~
   mm/vmscan.c:6022:24: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |                        ^~
   include/linux/atomic/atomic-instrumented.h:4785:33: note: in definition of macro 'cmpxchg'
    4785 |         typeof(ptr) __ai_ptr = (ptr); \
         |                                 ^~~
>> include/linux/atomic/atomic-instrumented.h:4787:55: error: invalid type argument of unary '*' (have 'int')
    4787 |         instrument_atomic_read_write(__ai_ptr, sizeof(*__ai_ptr)); \
         |                                                       ^~~~~~~~~
   mm/vmscan.c:6022:13: note: in expansion of macro 'cmpxchg'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |             ^~~~~~~
   include/linux/atomic/atomic-instrumented.h:4787:38: error: passing argument 1 of 'instrument_atomic_read_write' makes pointer from integer without a cast [-Wint-conversion]
    4787 |         instrument_atomic_read_write(__ai_ptr, sizeof(*__ai_ptr)); \
         |                                      ^~~~~~~~
         |                                      |
         |                                      int
   mm/vmscan.c:6022:13: note: in expansion of macro 'cmpxchg'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |             ^~~~~~~
   In file included from include/linux/atomic/atomic-instrumented.h:17:
   include/linux/instrumented.h:110:79: note: expected 'const volatile void *' but argument is of type 'int'
     110 | static __always_inline void instrument_atomic_read_write(const volatile void *v, size_t size)
         |                                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/alpha/include/asm/atomic.h:7,
                    from include/linux/atomic.h:7:
>> arch/alpha/include/asm/cmpxchg.h:267:20: error: invalid type argument of unary '*' (have 'int')
     267 |         __typeof__(*(ptr)) __ret;                                       \
         |                    ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg'
    4788 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~
   mm/vmscan.c:6022:13: note: in expansion of macro 'cmpxchg'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |             ^~~~~~~
   arch/alpha/include/asm/cmpxchg.h:268:20: error: invalid type argument of unary '*' (have 'int')
     268 |         __typeof__(*(ptr)) _o_ = (o);                                   \
         |                    ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg'
    4788 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~
   mm/vmscan.c:6022:13: note: in expansion of macro 'cmpxchg'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |             ^~~~~~~
   arch/alpha/include/asm/cmpxchg.h:269:20: error: invalid type argument of unary '*' (have 'int')
     269 |         __typeof__(*(ptr)) _n_ = (n);                                   \
         |                    ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg'
    4788 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~
   mm/vmscan.c:6022:13: note: in expansion of macro 'cmpxchg'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |             ^~~~~~~
   arch/alpha/include/asm/cmpxchg.h:271:29: error: invalid type argument of unary '*' (have 'int')
     271 |         __ret = (__typeof__(*(ptr))) ____cmpxchg((ptr),                 \
         |                             ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg'
    4788 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~
   mm/vmscan.c:6022:13: note: in expansion of macro 'cmpxchg'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |             ^~~~~~~
   arch/alpha/include/asm/cmpxchg.h:272:64: error: invalid type argument of unary '*' (have 'int')
     272 |                 (unsigned long)_o_, (unsigned long)_n_, sizeof(*(ptr)));\
         |                                                                ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg'
    4788 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~
   mm/vmscan.c:6022:13: note: in expansion of macro 'cmpxchg'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |             ^~~~~~~
>> arch/alpha/include/asm/cmpxchg.h:271:50: error: passing argument 1 of '____cmpxchg' makes pointer from integer without a cast [-Wint-conversion]
     271 |         __ret = (__typeof__(*(ptr))) ____cmpxchg((ptr),                 \
         |                                                  ^~~~~
         |                                                  |
         |                                                  int
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg'
    4788 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~
   mm/vmscan.c:6022:13: note: in expansion of macro 'cmpxchg'
    6022 |         if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
         |             ^~~~~~~
   arch/alpha/include/asm/cmpxchg.h:217:28: note: expected 'volatile void *' but argument is of type 'int'
     217 | ____cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
         |             ~~~~~~~~~~~~~~~^~~
>> mm/vmscan.c:6025:27: error: passing argument 1 of 'memcg_adjust_heat' from incompatible pointer type [-Wincompatible-pointer-types]
    6025 |         memcg_adjust_heat(pn, -MEMCG_HEAT_DECAY_STEP);
         |                           ^~
         |                           |
         |                           struct mem_cgroup_per_node *
   mm/vmscan.c:5994:59: note: expected 'struct mem_cgroup_per_node *' but argument is of type 'struct mem_cgroup_per_node *'
    5994 | static void memcg_adjust_heat(struct mem_cgroup_per_node *pn, long delta)
         |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
   mm/vmscan.c: At top level:
   mm/vmscan.c:6028:36: warning: 'struct mem_cgroup_per_node' declared inside parameter list will not be visible outside of this definition or declaration
    6028 | static int memcg_heat_level(struct mem_cgroup_per_node *pn)
         |                                    ^~~~~~~~~~~~~~~~~~~
   mm/vmscan.c: In function 'memcg_heat_level':
   mm/vmscan.c:6032:34: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6032 |         if (mem_cgroup_is_root(pn->memcg))
         |                                  ^~
>> mm/vmscan.c:6035:26: error: passing argument 1 of 'memcg_decay_heat' from incompatible pointer type [-Wincompatible-pointer-types]
    6035 |         memcg_decay_heat(pn);
         |                          ^~
         |                          |
         |                          struct mem_cgroup_per_node *
   mm/vmscan.c:6010:58: note: expected 'struct mem_cgroup_per_node *' but argument is of type 'struct mem_cgroup_per_node *'
    6010 | static void memcg_decay_heat(struct mem_cgroup_per_node *pn)
         |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
   mm/vmscan.c:6036:36: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6036 |         heat = atomic_long_read(&pn->reclaim.heat);
         |                                    ^~
   mm/vmscan.c: At top level:
   mm/vmscan.c:6045:48: warning: 'struct mem_cgroup_per_node' declared inside parameter list will not be visible outside of this definition or declaration
    6045 | static void memcg_record_reclaim_result(struct mem_cgroup_per_node *pn,
         |                                                ^~~~~~~~~~~~~~~~~~~
   mm/vmscan.c: In function 'memcg_record_reclaim_result':
   mm/vmscan.c:6052:34: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6052 |         if (mem_cgroup_is_root(pn->memcg))
         |                                  ^~
   mm/vmscan.c:6055:26: error: passing argument 1 of 'memcg_decay_heat' from incompatible pointer type [-Wincompatible-pointer-types]
    6055 |         memcg_decay_heat(pn);
         |                          ^~
         |                          |
         |                          struct mem_cgroup_per_node *
   mm/vmscan.c:6010:58: note: expected 'struct mem_cgroup_per_node *' but argument is of type 'struct mem_cgroup_per_node *'
    6010 | static void memcg_decay_heat(struct mem_cgroup_per_node *pn)
         |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
   mm/vmscan.c:6087:44: error: invalid use of undefined type 'struct mem_cgroup_per_node'
    6087 |                 prev = atomic_long_xchg(&pn->reclaim.last_refault, total_refaults);
         |                                            ^~
   mm/vmscan.c:6096:27: error: passing argument 1 of 'memcg_adjust_heat' from incompatible pointer type [-Wincompatible-pointer-types]
    6096 |         memcg_adjust_heat(pn, delta);
         |                           ^~
         |                           |
         |                           struct mem_cgroup_per_node *
   mm/vmscan.c:5994:59: note: expected 'struct mem_cgroup_per_node *' but argument is of type 'struct mem_cgroup_per_node *'
    5994 | static void memcg_adjust_heat(struct mem_cgroup_per_node *pn, long delta)
         |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
   mm/vmscan.c: In function 'shrink_node_memcgs':
>> mm/vmscan.c:6129:63: error: invalid use of undefined type 'struct mem_cgroup'
    6129 |                         struct mem_cgroup_per_node *pn = memcg->nodeinfo[pgdat->node_id];
         |                                                               ^~
>> mm/vmscan.c:6161:66: error: passing argument 1 of 'memcg_heat_level' from incompatible pointer type [-Wincompatible-pointer-types]
    6161 |                         if (root_reclaim(sc) && memcg_heat_level(pn) > level) {
         |                                                                  ^~
         |                                                                  |
         |                                                                  struct mem_cgroup_per_node *
   mm/vmscan.c:6028:57: note: expected 'struct mem_cgroup_per_node *' but argument is of type 'struct mem_cgroup_per_node *'
    6028 | static int memcg_heat_level(struct mem_cgroup_per_node *pn)
         |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
>> mm/vmscan.c:6175:61: error: passing argument 1 of 'memcg_record_reclaim_result' from incompatible pointer type [-Wincompatible-pointer-types]
    6175 |                                 memcg_record_reclaim_result(pn, lruvec,
         |                                                             ^~
         |                                                             |
         |                                                             struct mem_cgroup_per_node *
   mm/vmscan.c:6045:69: note: expected 'struct mem_cgroup_per_node *' but argument is of type 'struct mem_cgroup_per_node *'
    6045 | static void memcg_record_reclaim_result(struct mem_cgroup_per_node *pn,
         |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~


vim +5998 mm/vmscan.c

  5993	
> 5994	static void memcg_adjust_heat(struct mem_cgroup_per_node *pn, long delta)
  5995	{
  5996		long heat, new_heat;
  5997	
> 5998		if (mem_cgroup_is_root(pn->memcg))
  5999			return;
  6000	
  6001		heat = atomic_long_read(&pn->reclaim.heat);
  6002		do {
  6003			new_heat = clamp_t(long, heat + delta, 0, MEMCG_HEAT_MAX);
  6004			if (atomic_long_cmpxchg(&pn->reclaim.heat, heat, new_heat) == heat)
  6005				break;
  6006			heat = atomic_long_read(&pn->reclaim.heat);
  6007		} while (1);
  6008	}
  6009	
  6010	static void memcg_decay_heat(struct mem_cgroup_per_node *pn)
  6011	{
  6012		unsigned long last;
  6013		unsigned long now = jiffies;
  6014	
  6015		if (mem_cgroup_is_root(pn->memcg))
  6016			return;
  6017	
  6018		last = READ_ONCE(pn->reclaim.last_decay);
  6019		if (!time_after(now, last + MEMCG_HEAT_DECAY_INTERVAL))
  6020			return;
  6021	
  6022		if (cmpxchg(&pn->reclaim.last_decay, last, now) != last)
  6023			return;
  6024	
> 6025		memcg_adjust_heat(pn, -MEMCG_HEAT_DECAY_STEP);
  6026	}
  6027	
  6028	static int memcg_heat_level(struct mem_cgroup_per_node *pn)
  6029	{
  6030		long heat;
  6031	
  6032		if (mem_cgroup_is_root(pn->memcg))
  6033			return MEMCG_LEVEL_COLD;
  6034	
> 6035		memcg_decay_heat(pn);
  6036		heat = atomic_long_read(&pn->reclaim.heat);
  6037	
  6038		if (heat >= MEMCG_HEAT_HOT)
  6039			return MEMCG_LEVEL_HOT;
  6040		if (heat >= MEMCG_HEAT_WARM)
  6041			return MEMCG_LEVEL_WARM;
  6042		return MEMCG_LEVEL_COLD;
  6043	}
  6044	
  6045	static void memcg_record_reclaim_result(struct mem_cgroup_per_node *pn,
  6046						struct lruvec *lruvec,
  6047						unsigned long scanned,
  6048						unsigned long reclaimed)
  6049	{
  6050		long delta;
  6051	
  6052		if (mem_cgroup_is_root(pn->memcg))
  6053			return;
  6054	
  6055		memcg_decay_heat(pn);
  6056	
  6057		/*
  6058		 * Memory cgroup heat adjustment algorithm:
  6059		 * - If scanned == 0: mark as hottest (+MAX_HEAT)
  6060		 * - If reclaimed >= 50% * scanned: strong cool (-2)
  6061		 * - If reclaimed >= 25% * scanned: mild cool (-1)
  6062		 * - Otherwise:  warm up (+1)
  6063		 */
  6064		if (!scanned)
  6065			delta = MEMCG_HEAT_MAX;
  6066		else if (reclaimed * 2 >= scanned)
  6067			delta = -2;
  6068		else if (reclaimed * 4 >= scanned)
  6069			delta = -1;
  6070		else
  6071			delta = 1;
  6072	
  6073		/*
  6074		 * Refault-based heat adjustment:
  6075		 * - If refault increase > reclaimed pages: heat up (more cautious reclaim)
  6076		 * - If no refaults and currently warm:     cool down (allow more reclaim)
  6077		 * This prevents thrashing by backing off when refaults indicate over-reclaim.
  6078		 */
  6079		if (lruvec) {
  6080			unsigned long total_refaults;
  6081			unsigned long prev;
  6082			long refault_delta;
  6083	
  6084			total_refaults = lruvec_page_state(lruvec, WORKINGSET_ACTIVATE_ANON);
  6085			total_refaults += lruvec_page_state(lruvec, WORKINGSET_ACTIVATE_FILE);
  6086	
  6087			prev = atomic_long_xchg(&pn->reclaim.last_refault, total_refaults);
  6088			refault_delta = total_refaults - prev;
  6089	
  6090			if (refault_delta > reclaimed)
  6091				delta++;
  6092			else if (!refault_delta && delta > 0)
  6093				delta--;
  6094		}
  6095	
  6096		memcg_adjust_heat(pn, delta);
  6097	}
  6098	
  6099	static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
  6100	{
  6101		struct mem_cgroup *target_memcg = sc->target_mem_cgroup;
  6102		struct mem_cgroup_reclaim_cookie reclaim = {
  6103			.pgdat = pgdat,
  6104		};
  6105		struct mem_cgroup_reclaim_cookie *partial = &reclaim;
  6106		struct mem_cgroup *memcg;
  6107		int level;
  6108		int max_level = root_reclaim(sc) ? MEMCG_LEVEL_MAX : MEMCG_LEVEL_WARM;
  6109		/*
  6110		 * In most cases, direct reclaimers can do partial walks
  6111		 * through the cgroup tree, using an iterator state that
  6112		 * persists across invocations. This strikes a balance between
  6113		 * fairness and allocation latency.
  6114		 *
  6115		 * For kswapd, reliable forward progress is more important
  6116		 * than a quick return to idle. Always do full walks.
  6117		 */
  6118		if (current_is_kswapd() || sc->memcg_full_walk)
  6119			partial = NULL;
  6120	
  6121		for (level = MEMCG_LEVEL_COLD; level < max_level; level++) {
  6122			bool need_next_level = false;
  6123	
  6124			memcg = mem_cgroup_iter(target_memcg, NULL, partial);
  6125			do {
  6126				struct lruvec *lruvec = mem_cgroup_lruvec(memcg, pgdat);
  6127				unsigned long reclaimed;
  6128				unsigned long scanned;
> 6129				struct mem_cgroup_per_node *pn = memcg->nodeinfo[pgdat->node_id];
  6130	
  6131				/*
  6132				 * This loop can become CPU-bound when target memcgs
  6133				 * aren't eligible for reclaim - either because they
  6134				 * don't have any reclaimable pages, or because their
  6135				 * memory is explicitly protected. Avoid soft lockups.
  6136				 */
  6137				cond_resched();
  6138	
  6139				mem_cgroup_calculate_protection(target_memcg, memcg);
  6140	
  6141				if (mem_cgroup_below_min(target_memcg, memcg)) {
  6142					/*
  6143					 * Hard protection.
  6144					 * If there is no reclaimable memory, OOM.
  6145					 */
  6146					continue;
  6147				} else if (mem_cgroup_below_low(target_memcg, memcg)) {
  6148					/*
  6149					 * Soft protection.
  6150					 * Respect the protection only as long as
  6151					 * there is an unprotected supply
  6152					 * of reclaimable memory from other cgroups.
  6153					 */
  6154					if (!sc->memcg_low_reclaim) {
  6155						sc->memcg_low_skipped = 1;
  6156						continue;
  6157					}
  6158					memcg_memory_event(memcg, MEMCG_LOW);
  6159				}
  6160	
> 6161				if (root_reclaim(sc) && memcg_heat_level(pn) > level) {
  6162					need_next_level = true;
  6163					continue;
  6164				}
  6165	
  6166				reclaimed = sc->nr_reclaimed;
  6167				scanned = sc->nr_scanned;
  6168	
  6169				shrink_lruvec(lruvec, sc);
  6170				if (!memcg || memcg_page_state(memcg, NR_SLAB_RECLAIMABLE_B))
  6171					shrink_slab(sc->gfp_mask, pgdat->node_id, memcg,
  6172						    sc->priority);
  6173	
  6174				if (root_reclaim(sc))
> 6175					memcg_record_reclaim_result(pn, lruvec,
  6176							    sc->nr_scanned - scanned,
  6177							    sc->nr_reclaimed - reclaimed);
  6178	
  6179				/* Record the group's reclaim efficiency */
  6180				if (!sc->proactive)
  6181					vmpressure(sc->gfp_mask, memcg, false,
  6182						   sc->nr_scanned - scanned,
  6183						   sc->nr_reclaimed - reclaimed);
  6184	
  6185				/* If partial walks are allowed, bail once goal is reached */
  6186				if (partial && sc->nr_reclaimed >= sc->nr_to_reclaim) {
  6187					mem_cgroup_iter_break(target_memcg, memcg);
  6188					break;
  6189				}
  6190			} while ((memcg = mem_cgroup_iter(target_memcg, memcg, partial)));
  6191	
  6192			if (!need_next_level)
  6193				break;
  6194		}
  6195	}
  6196	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2026-01-21 11:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 13:42 [RFC PATCH -next 0/7] Introduce heat-level memcg reclaim Chen Ridong
2026-01-20 13:42 ` [RFC PATCH -next 1/7] vmscan: add memcg heat level for reclaim Chen Ridong
2026-01-21  7:53   ` Chen Ridong
2026-01-21 11:30   ` kernel test robot [this message]
2026-01-21 14:58   ` Kairui Song
2026-01-22  2:32     ` Chen Ridong
2026-02-06 22:47   ` Yuanchu Xie
2026-02-09  8:17     ` Chen Ridong
2026-01-20 13:42 ` [RFC PATCH -next 2/7] mm/mglru: make calls to flush_reclaim_state() similar for MGLRU and non-MGLRU Chen Ridong
2026-01-20 13:42 ` [RFC PATCH -next 3/7] mm/mglru: rename should_abort_scan to lru_gen_should_abort_scan Chen Ridong
2026-01-20 13:42 ` [RFC PATCH -next 4/7] mm/mglru: extend lru_gen_shrink_lruvec to support root reclaim Chen Ridong
2026-01-20 13:42 ` [RFC PATCH -next 5/7] mm/mglru: combine shrink_many into shrink_node_memcgs Chen Ridong
2026-01-21  8:13   ` Chen Ridong
2026-01-20 13:42 ` [RFC PATCH -next 6/7] mm/mglru: remove memcg disable handling from lru_gen_shrink_node Chen Ridong
2026-01-20 13:42 ` [RFC PATCH -next 7/7] mm/mglru: remove memcg lru Chen Ridong
2026-01-29 11:25 ` [RFC PATCH -next 0/7] Introduce heat-level memcg reclaim Chen Ridong

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=202601211944.R2nx1Vd1-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chenridong@huaweicloud.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.