linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Yu Zhao <yuzhao@google.com>,
	linux-kernel@vger.kernel.org,
	Zhaoyang Huang <huangzhaoyang@gmail.com>,
	steve.kang@unisoc.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH] mm: bail out when the PMD has been set in bloom filter
Date: Fri, 27 Feb 2026 19:42:33 +0800	[thread overview]
Message-ID: <202602271916.OBNa34QU-lkp@intel.com> (raw)
In-Reply-To: <20260227075250.1128175-1-zhaoyang.huang@unisoc.com>

Hi zhaoyang.huang,

kernel test robot noticed the following build warnings:

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

url:    https://github.com/intel-lab-lkp/linux/commits/zhaoyang-huang/mm-bail-out-when-the-PMD-has-been-set-in-bloom-filter/20260227-155729
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20260227075250.1128175-1-zhaoyang.huang%40unisoc.com
patch subject: [PATCH] mm: bail out when the PMD has been set in bloom filter
config: sparc64-randconfig-002-20260227 (https://download.01.org/0day-ci/archive/20260227/202602271916.OBNa34QU-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 9a109fbb6e184ec9bcce10615949f598f4c974a9)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260227/202602271916.OBNa34QU-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/202602271916.OBNa34QU-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/vmscan.c:4206:24: warning: variable 'mm_state' is uninitialized when used here [-Wuninitialized]
    4206 |         if (test_bloom_filter(mm_state, max_seq, pvmw->pmd))
         |                               ^~~~~~~~
   mm/vmscan.c:4185:35: note: initialize the variable 'mm_state' to silence this warning
    4185 |         struct lru_gen_mm_state *mm_state;
         |                                          ^
         |                                           = NULL
>> mm/vmscan.c:4206:34: warning: variable 'max_seq' is uninitialized when used here [-Wuninitialized]
    4206 |         if (test_bloom_filter(mm_state, max_seq, pvmw->pmd))
         |                                         ^~~~~~~
   mm/vmscan.c:4186:23: note: initialize the variable 'max_seq' to silence this warning
    4186 |         unsigned long max_seq;
         |                              ^
         |                               = 0
   2 warnings generated.


vim +/mm_state +4206 mm/vmscan.c

  4157	
  4158	/******************************************************************************
  4159	 *                          rmap/PT walk feedback
  4160	 ******************************************************************************/
  4161	
  4162	/*
  4163	 * This function exploits spatial locality when shrink_folio_list() walks the
  4164	 * rmap. It scans the adjacent PTEs of a young PTE and promotes hot pages. If
  4165	 * the scan was done cacheline efficiently, it adds the PMD entry pointing to
  4166	 * the PTE table to the Bloom filter. This forms a feedback loop between the
  4167	 * eviction and the aging.
  4168	 */
  4169	bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw)
  4170	{
  4171		int i;
  4172		bool dirty;
  4173		unsigned long start;
  4174		unsigned long end;
  4175		struct lru_gen_mm_walk *walk;
  4176		struct folio *last = NULL;
  4177		int young = 1;
  4178		pte_t *pte = pvmw->pte;
  4179		unsigned long addr = pvmw->address;
  4180		struct vm_area_struct *vma = pvmw->vma;
  4181		struct folio *folio = pfn_folio(pvmw->pfn);
  4182		struct mem_cgroup *memcg;
  4183		struct pglist_data *pgdat = folio_pgdat(folio);
  4184		struct lruvec *lruvec;
  4185		struct lru_gen_mm_state *mm_state;
  4186		unsigned long max_seq;
  4187		int gen;
  4188	
  4189		lockdep_assert_held(pvmw->ptl);
  4190		VM_WARN_ON_ONCE_FOLIO(folio_test_lru(folio), folio);
  4191	
  4192		if (!ptep_clear_young_notify(vma, addr, pte))
  4193			return false;
  4194	
  4195		if (spin_is_contended(pvmw->ptl))
  4196			return true;
  4197	
  4198		/* exclude special VMAs containing anon pages from COW */
  4199		if (vma->vm_flags & VM_SPECIAL)
  4200			return true;
  4201	
  4202		/* avoid taking the LRU lock under the PTL when possible */
  4203		walk = current->reclaim_state ? current->reclaim_state->mm_walk : NULL;
  4204	
  4205		/* may the pmd has been set in bloom filter */
> 4206		if (test_bloom_filter(mm_state, max_seq, pvmw->pmd))
  4207			return true;
  4208	
  4209		start = max(addr & PMD_MASK, vma->vm_start);
  4210		end = min(addr | ~PMD_MASK, vma->vm_end - 1) + 1;
  4211	
  4212		if (end - start == PAGE_SIZE)
  4213			return true;
  4214	
  4215		if (end - start > MIN_LRU_BATCH * PAGE_SIZE) {
  4216			if (addr - start < MIN_LRU_BATCH * PAGE_SIZE / 2)
  4217				end = start + MIN_LRU_BATCH * PAGE_SIZE;
  4218			else if (end - addr < MIN_LRU_BATCH * PAGE_SIZE / 2)
  4219				start = end - MIN_LRU_BATCH * PAGE_SIZE;
  4220			else {
  4221				start = addr - MIN_LRU_BATCH * PAGE_SIZE / 2;
  4222				end = addr + MIN_LRU_BATCH * PAGE_SIZE / 2;
  4223			}
  4224		}
  4225	
  4226		memcg = get_mem_cgroup_from_folio(folio);
  4227		lruvec = mem_cgroup_lruvec(memcg, pgdat);
  4228		max_seq = READ_ONCE((lruvec)->lrugen.max_seq);
  4229		gen = lru_gen_from_seq(max_seq);
  4230		mm_state = get_mm_state(lruvec);
  4231	
  4232		lazy_mmu_mode_enable();
  4233	
  4234		pte -= (addr - start) / PAGE_SIZE;
  4235	
  4236		for (i = 0, addr = start; addr != end; i++, addr += PAGE_SIZE) {
  4237			unsigned long pfn;
  4238			pte_t ptent = ptep_get(pte + i);
  4239	
  4240			pfn = get_pte_pfn(ptent, vma, addr, pgdat);
  4241			if (pfn == -1)
  4242				continue;
  4243	
  4244			folio = get_pfn_folio(pfn, memcg, pgdat);
  4245			if (!folio)
  4246				continue;
  4247	
  4248			if (!ptep_clear_young_notify(vma, addr, pte + i))
  4249				continue;
  4250	
  4251			if (last != folio) {
  4252				walk_update_folio(walk, last, gen, dirty);
  4253	
  4254				last = folio;
  4255				dirty = false;
  4256			}
  4257	
  4258			if (pte_dirty(ptent))
  4259				dirty = true;
  4260	
  4261			young++;
  4262		}
  4263	
  4264		walk_update_folio(walk, last, gen, dirty);
  4265	
  4266		lazy_mmu_mode_disable();
  4267	
  4268		/* feedback from rmap walkers to page table walkers */
  4269		if (mm_state && suitable_to_scan(i, young))
  4270			update_bloom_filter(mm_state, max_seq, pvmw->pmd);
  4271	
  4272		mem_cgroup_put(memcg);
  4273	
  4274		return true;
  4275	}
  4276	

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


      reply	other threads:[~2026-02-27 11:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27  7:52 zhaoyang.huang
2026-02-27 11:42 ` kernel test robot [this message]

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=202602271916.OBNa34QU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=huangzhaoyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=steve.kang@unisoc.com \
    --cc=yuzhao@google.com \
    --cc=zhaoyang.huang@unisoc.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