linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v1] mm/memcg: scale memory.high penalty based on refault recency
       [not found] <20251226064257.245581-1-jiayuan.chen@linux.dev>
@ 2025-12-26 20:40 ` kernel test robot
  2025-12-26 20:51 ` kernel test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-12-26 20:40 UTC (permalink / raw)
  To: Jiayuan Chen, linux-mm, akpm
  Cc: oe-kbuild-all, Jiayuan Chen, Johannes Weiner, Michal Hocko,
	Roman Gushchin, Shakeel Butt, Muchun Song, Axel Rasmussen,
	Yuanchu Xie, Wei Xu, David Hildenbrand, Qi Zheng,
	Lorenzo Stoakes, cgroups, linux-kernel

Hi Jiayuan,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Jiayuan-Chen/mm-memcg-scale-memory-high-penalty-based-on-refault-recency/20251226-144331
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251226064257.245581-1-jiayuan.chen%40linux.dev
patch subject: [PATCH v1] mm/memcg: scale memory.high penalty based on refault recency
config: nios2-allnoconfig (https://download.01.org/0day-ci/archive/20251227/202512270457.MunhjmYM-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251227/202512270457.MunhjmYM-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/202512270457.MunhjmYM-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from <command-line>:
   mm/workingset.c: In function 'workingset_refault':
>> mm/workingset.c:570:33: error: invalid use of undefined type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                                 ^~
   include/linux/compiler_types.h:611:23: note: in definition of macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:631:9: note: in expansion of macro '_compiletime_assert'
     631 |         _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:60:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/workingset.c:570:17: note: in expansion of macro 'WRITE_ONCE'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                 ^~~~~~~~~~
>> mm/workingset.c:570:33: error: invalid use of undefined type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                                 ^~
   include/linux/compiler_types.h:611:23: note: in definition of macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:631:9: note: in expansion of macro '_compiletime_assert'
     631 |         _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:60:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/workingset.c:570:17: note: in expansion of macro 'WRITE_ONCE'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                 ^~~~~~~~~~
>> mm/workingset.c:570:33: error: invalid use of undefined type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                                 ^~
   include/linux/compiler_types.h:611:23: note: in definition of macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:631:9: note: in expansion of macro '_compiletime_assert'
     631 |         _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:60:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/workingset.c:570:17: note: in expansion of macro 'WRITE_ONCE'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                 ^~~~~~~~~~
>> mm/workingset.c:570:33: error: invalid use of undefined type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                                 ^~
   include/linux/compiler_types.h:611:23: note: in definition of macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:631:9: note: in expansion of macro '_compiletime_assert'
     631 |         _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:60:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/workingset.c:570:17: note: in expansion of macro 'WRITE_ONCE'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                 ^~~~~~~~~~
>> mm/workingset.c:570:33: error: invalid use of undefined type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                                 ^~
   include/linux/compiler_types.h:611:23: note: in definition of macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:631:9: note: in expansion of macro '_compiletime_assert'
     631 |         _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:60:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/workingset.c:570:17: note: in expansion of macro 'WRITE_ONCE'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                 ^~~~~~~~~~
   In file included from ./arch/nios2/include/generated/asm/rwonce.h:1,
                    from include/linux/compiler.h:380,
                    from include/asm-generic/bug.h:5,
                    from ./arch/nios2/include/generated/asm/bug.h:1,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/current.h:6,
                    from ./arch/nios2/include/generated/asm/current.h:1,
                    from include/linux/sched.h:12,
                    from include/linux/cgroup.h:12,
                    from include/linux/memcontrol.h:13,
                    from mm/workingset.c:8:
>> mm/workingset.c:570:33: error: invalid use of undefined type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                                 ^~
   include/asm-generic/rwonce.h:55:27: note: in definition of macro '__WRITE_ONCE'
      55 |         *(volatile typeof(x) *)&(x) = (val);                            \
         |                           ^
   mm/workingset.c:570:17: note: in expansion of macro 'WRITE_ONCE'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                 ^~~~~~~~~~
>> mm/workingset.c:570:33: error: invalid use of undefined type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                                 ^~
   include/asm-generic/rwonce.h:55:34: note: in definition of macro '__WRITE_ONCE'
      55 |         *(volatile typeof(x) *)&(x) = (val);                            \
         |                                  ^
   mm/workingset.c:570:17: note: in expansion of macro 'WRITE_ONCE'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                 ^~~~~~~~~~


vim +570 mm/workingset.c

   529	
   530	/**
   531	 * workingset_refault - Evaluate the refault of a previously evicted folio.
   532	 * @folio: The freshly allocated replacement folio.
   533	 * @shadow: Shadow entry of the evicted folio.
   534	 *
   535	 * Calculates and evaluates the refault distance of the previously
   536	 * evicted folio in the context of the node and the memcg whose memory
   537	 * pressure caused the eviction.
   538	 */
   539	void workingset_refault(struct folio *folio, void *shadow)
   540	{
   541		bool file = folio_is_file_lru(folio);
   542		struct pglist_data *pgdat;
   543		struct mem_cgroup *memcg;
   544		struct lruvec *lruvec;
   545		bool workingset;
   546		long nr;
   547	
   548		VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
   549	
   550		if (lru_gen_enabled()) {
   551			lru_gen_refault(folio, shadow);
   552			return;
   553		}
   554	
   555		/*
   556		 * The activation decision for this folio is made at the level
   557		 * where the eviction occurred, as that is where the LRU order
   558		 * during folio reclaim is being determined.
   559		 *
   560		 * However, the cgroup that will own the folio is the one that
   561		 * is actually experiencing the refault event. Make sure the folio is
   562		 * locked to guarantee folio_memcg() stability throughout.
   563		 */
   564		nr = folio_nr_pages(folio);
   565		memcg = folio_memcg(folio);
   566		pgdat = folio_pgdat(folio);
   567		lruvec = mem_cgroup_lruvec(memcg, pgdat);
   568	
   569		if (memcg)
 > 570			WRITE_ONCE(memcg->last_refault, jiffies);
   571	
   572		mod_lruvec_state(lruvec, WORKINGSET_REFAULT_BASE + file, nr);
   573	
   574		if (!workingset_test_recent(shadow, file, &workingset, true))
   575			return;
   576	
   577		folio_set_active(folio);
   578		workingset_age_nonresident(lruvec, nr);
   579		mod_lruvec_state(lruvec, WORKINGSET_ACTIVATE_BASE + file, nr);
   580	
   581		/* Folio was active prior to eviction */
   582		if (workingset) {
   583			folio_set_workingset(folio);
   584			/*
   585			 * XXX: Move to folio_add_lru() when it supports new vs
   586			 * putback
   587			 */
   588			lru_note_cost_refault(folio);
   589			mod_lruvec_state(lruvec, WORKINGSET_RESTORE_BASE + file, nr);
   590		}
   591	}
   592	

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] mm/memcg: scale memory.high penalty based on refault recency
       [not found] <20251226064257.245581-1-jiayuan.chen@linux.dev>
  2025-12-26 20:40 ` [PATCH v1] mm/memcg: scale memory.high penalty based on refault recency kernel test robot
@ 2025-12-26 20:51 ` kernel test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-12-26 20:51 UTC (permalink / raw)
  To: Jiayuan Chen, linux-mm, akpm
  Cc: llvm, oe-kbuild-all, Jiayuan Chen, Johannes Weiner, Michal Hocko,
	Roman Gushchin, Shakeel Butt, Muchun Song, Axel Rasmussen,
	Yuanchu Xie, Wei Xu, David Hildenbrand, Qi Zheng,
	Lorenzo Stoakes, cgroups, linux-kernel

Hi Jiayuan,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Jiayuan-Chen/mm-memcg-scale-memory-high-penalty-based-on-refault-recency/20251226-144331
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251226064257.245581-1-jiayuan.chen%40linux.dev
patch subject: [PATCH v1] mm/memcg: scale memory.high penalty based on refault recency
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20251227/202512270405.sx7TY5MG-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251227/202512270405.sx7TY5MG-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/202512270405.sx7TY5MG-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/workingset.c:570:19: error: incomplete definition of type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                            ~~~~~^
   include/asm-generic/rwonce.h:60:33: note: expanded from macro 'WRITE_ONCE'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |                                        ^
   include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compiletime_assert_rwonce_type'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                                          ^
   include/linux/compiler_types.h:592:10: note: expanded from macro '__native_word'
     592 |         (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
         |                 ^
   include/linux/compiler_types.h:631:22: note: expanded from macro 'compiletime_assert'
     631 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                             ^~~~~~~~~
   include/linux/compiler_types.h:619:23: note: expanded from macro '_compiletime_assert'
     619 |         __compiletime_assert(condition, msg, prefix, suffix)
         |                              ^~~~~~~~~
   include/linux/compiler_types.h:611:9: note: expanded from macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/shrinker.h:55:9: note: forward declaration of 'struct mem_cgroup'
      55 |         struct mem_cgroup *memcg;
         |                ^
>> mm/workingset.c:570:19: error: incomplete definition of type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                            ~~~~~^
   include/asm-generic/rwonce.h:60:33: note: expanded from macro 'WRITE_ONCE'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |                                        ^
   include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compiletime_assert_rwonce_type'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                                          ^
   include/linux/compiler_types.h:592:39: note: expanded from macro '__native_word'
     592 |         (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
         |                                              ^
   include/linux/compiler_types.h:631:22: note: expanded from macro 'compiletime_assert'
     631 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                             ^~~~~~~~~
   include/linux/compiler_types.h:619:23: note: expanded from macro '_compiletime_assert'
     619 |         __compiletime_assert(condition, msg, prefix, suffix)
         |                              ^~~~~~~~~
   include/linux/compiler_types.h:611:9: note: expanded from macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/shrinker.h:55:9: note: forward declaration of 'struct mem_cgroup'
      55 |         struct mem_cgroup *memcg;
         |                ^
>> mm/workingset.c:570:19: error: incomplete definition of type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                            ~~~~~^
   include/asm-generic/rwonce.h:60:33: note: expanded from macro 'WRITE_ONCE'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |                                        ^
   include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compiletime_assert_rwonce_type'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                                          ^
   include/linux/compiler_types.h:593:10: note: expanded from macro '__native_word'
     593 |          sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
         |                 ^
   include/linux/compiler_types.h:631:22: note: expanded from macro 'compiletime_assert'
     631 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                             ^~~~~~~~~
   include/linux/compiler_types.h:619:23: note: expanded from macro '_compiletime_assert'
     619 |         __compiletime_assert(condition, msg, prefix, suffix)
         |                              ^~~~~~~~~
   include/linux/compiler_types.h:611:9: note: expanded from macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/shrinker.h:55:9: note: forward declaration of 'struct mem_cgroup'
      55 |         struct mem_cgroup *memcg;
         |                ^
>> mm/workingset.c:570:19: error: incomplete definition of type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                            ~~~~~^
   include/asm-generic/rwonce.h:60:33: note: expanded from macro 'WRITE_ONCE'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |                                        ^
   include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compiletime_assert_rwonce_type'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                                          ^
   include/linux/compiler_types.h:593:38: note: expanded from macro '__native_word'
     593 |          sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
         |                                             ^
   include/linux/compiler_types.h:631:22: note: expanded from macro 'compiletime_assert'
     631 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                             ^~~~~~~~~
   include/linux/compiler_types.h:619:23: note: expanded from macro '_compiletime_assert'
     619 |         __compiletime_assert(condition, msg, prefix, suffix)
         |                              ^~~~~~~~~
   include/linux/compiler_types.h:611:9: note: expanded from macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/shrinker.h:55:9: note: forward declaration of 'struct mem_cgroup'
      55 |         struct mem_cgroup *memcg;
         |                ^
>> mm/workingset.c:570:19: error: incomplete definition of type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                            ~~~~~^
   include/asm-generic/rwonce.h:60:33: note: expanded from macro 'WRITE_ONCE'
      60 |         compiletime_assert_rwonce_type(x);                              \
         |                                        ^
   include/asm-generic/rwonce.h:36:48: note: expanded from macro 'compiletime_assert_rwonce_type'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                                                       ^
   include/linux/compiler_types.h:631:22: note: expanded from macro 'compiletime_assert'
     631 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                             ^~~~~~~~~
   include/linux/compiler_types.h:619:23: note: expanded from macro '_compiletime_assert'
     619 |         __compiletime_assert(condition, msg, prefix, suffix)
         |                              ^~~~~~~~~
   include/linux/compiler_types.h:611:9: note: expanded from macro '__compiletime_assert'
     611 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/shrinker.h:55:9: note: forward declaration of 'struct mem_cgroup'
      55 |         struct mem_cgroup *memcg;
         |                ^
>> mm/workingset.c:570:19: error: incomplete definition of type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                            ~~~~~^
   include/asm-generic/rwonce.h:61:15: note: expanded from macro 'WRITE_ONCE'
      61 |         __WRITE_ONCE(x, val);                                           \
         |                      ^
   include/asm-generic/rwonce.h:55:20: note: expanded from macro '__WRITE_ONCE'
      55 |         *(volatile typeof(x) *)&(x) = (val);                            \
         |                           ^
   include/linux/shrinker.h:55:9: note: forward declaration of 'struct mem_cgroup'
      55 |         struct mem_cgroup *memcg;
         |                ^
>> mm/workingset.c:570:19: error: incomplete definition of type 'struct mem_cgroup'
     570 |                 WRITE_ONCE(memcg->last_refault, jiffies);
         |                            ~~~~~^
   include/asm-generic/rwonce.h:61:15: note: expanded from macro 'WRITE_ONCE'
      61 |         __WRITE_ONCE(x, val);                                           \
         |                      ^
   include/asm-generic/rwonce.h:55:27: note: expanded from macro '__WRITE_ONCE'
      55 |         *(volatile typeof(x) *)&(x) = (val);                            \
         |                                  ^
   include/linux/shrinker.h:55:9: note: forward declaration of 'struct mem_cgroup'
      55 |         struct mem_cgroup *memcg;
         |                ^
   7 errors generated.


vim +570 mm/workingset.c

   529	
   530	/**
   531	 * workingset_refault - Evaluate the refault of a previously evicted folio.
   532	 * @folio: The freshly allocated replacement folio.
   533	 * @shadow: Shadow entry of the evicted folio.
   534	 *
   535	 * Calculates and evaluates the refault distance of the previously
   536	 * evicted folio in the context of the node and the memcg whose memory
   537	 * pressure caused the eviction.
   538	 */
   539	void workingset_refault(struct folio *folio, void *shadow)
   540	{
   541		bool file = folio_is_file_lru(folio);
   542		struct pglist_data *pgdat;
   543		struct mem_cgroup *memcg;
   544		struct lruvec *lruvec;
   545		bool workingset;
   546		long nr;
   547	
   548		VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
   549	
   550		if (lru_gen_enabled()) {
   551			lru_gen_refault(folio, shadow);
   552			return;
   553		}
   554	
   555		/*
   556		 * The activation decision for this folio is made at the level
   557		 * where the eviction occurred, as that is where the LRU order
   558		 * during folio reclaim is being determined.
   559		 *
   560		 * However, the cgroup that will own the folio is the one that
   561		 * is actually experiencing the refault event. Make sure the folio is
   562		 * locked to guarantee folio_memcg() stability throughout.
   563		 */
   564		nr = folio_nr_pages(folio);
   565		memcg = folio_memcg(folio);
   566		pgdat = folio_pgdat(folio);
   567		lruvec = mem_cgroup_lruvec(memcg, pgdat);
   568	
   569		if (memcg)
 > 570			WRITE_ONCE(memcg->last_refault, jiffies);
   571	
   572		mod_lruvec_state(lruvec, WORKINGSET_REFAULT_BASE + file, nr);
   573	
   574		if (!workingset_test_recent(shadow, file, &workingset, true))
   575			return;
   576	
   577		folio_set_active(folio);
   578		workingset_age_nonresident(lruvec, nr);
   579		mod_lruvec_state(lruvec, WORKINGSET_ACTIVATE_BASE + file, nr);
   580	
   581		/* Folio was active prior to eviction */
   582		if (workingset) {
   583			folio_set_workingset(folio);
   584			/*
   585			 * XXX: Move to folio_add_lru() when it supports new vs
   586			 * putback
   587			 */
   588			lru_note_cost_refault(folio);
   589			mod_lruvec_state(lruvec, WORKINGSET_RESTORE_BASE + file, nr);
   590		}
   591	}
   592	

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-26 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20251226064257.245581-1-jiayuan.chen@linux.dev>
2025-12-26 20:40 ` [PATCH v1] mm/memcg: scale memory.high penalty based on refault recency kernel test robot
2025-12-26 20:51 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox