Re: [PATCH] mm: mglru: use pte_table_clamped_end() helper to calculate the end
From: kernel test robot
Date: Fri Nov 13 2026 - 15:05:56 EST
Hi Baolin,
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/Baolin-Wang/mm-mglru-use-pte_table_clamped_end-helper-to-calculate-the-end/20261112-191239
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/b2386c5da61f9a15e60daa421b033bc1e0bcdd41.1794481498.git.baolin.wang%40linux.alibaba.com
patch subject: [PATCH] mm: mglru: use pte_table_clamped_end() helper to calculate the end
config: x86_64-randconfig-1008-20261113 (https://download.01.org/0day-ci/archive/20261114/202611140210.uZmu9pV3-lkp@xxxxxxxxx/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261114/202611140210.uZmu9pV3-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202611140210.uZmu9pV3-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
>> mm/vmscan.c:4343:8: error: call to undeclared function 'pte_table_clamped_end'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
4343 | end = pte_table_clamped_end(addr, vma->vm_end);
| ^
1 error generated.
vim +/pte_table_clamped_end +4343 mm/vmscan.c
4296
4297 /******************************************************************************
4298 * rmap/PT walk feedback
4299 ******************************************************************************/
4300
4301 /*
4302 * This function exploits spatial locality when shrink_folio_list() walks the
4303 * rmap. It scans the adjacent PTEs of a young PTE and promotes hot pages. If
4304 * the scan was done cacheline efficiently, it adds the PMD entry pointing to
4305 * the PTE table to the Bloom filter. This forms a feedback loop between the
4306 * eviction and the aging.
4307 */
4308 bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw, unsigned int nr)
4309 {
4310 int i;
4311 bool dirty;
4312 unsigned long start;
4313 unsigned long end;
4314 struct lru_gen_mm_walk *walk;
4315 struct folio *last = NULL;
4316 int young = nr;
4317 pte_t *pte = pvmw->pte;
4318 unsigned long addr = pvmw->address;
4319 struct vm_area_struct *vma = pvmw->vma;
4320 struct folio *folio = pfn_folio(pvmw->pfn);
4321 struct mem_cgroup *memcg;
4322 struct pglist_data *pgdat = folio_pgdat(folio);
4323 struct lruvec *lruvec;
4324 struct lru_gen_mm_state *mm_state;
4325
4326 lockdep_assert_held(pvmw->ptl);
4327 VM_WARN_ON_ONCE_FOLIO(folio_test_lru(folio), folio);
4328
4329 if (!test_and_clear_young_ptes_notify(vma, addr, pte, nr))
4330 return false;
4331
4332 if (spin_is_contended(pvmw->ptl))
4333 return true;
4334
4335 /* exclude non-mm-backed VMAs containing anon pages from COW */
4336 if (!vma_is_mm_backed(vma))
4337 return true;
4338
4339 /* avoid taking the LRU lock under the PTL when possible */
4340 walk = current->reclaim_state ? current->reclaim_state->mm_walk : NULL;
4341
4342 start = max(addr & PMD_MASK, vma->vm_start);
> 4343 end = pte_table_clamped_end(addr, vma->vm_end);
4344
4345 if (end - start == PAGE_SIZE)
4346 return true;
4347
4348 if (end - start > MIN_LRU_BATCH * PAGE_SIZE) {
4349 if (addr - start < MIN_LRU_BATCH * PAGE_SIZE / 2)
4350 end = start + MIN_LRU_BATCH * PAGE_SIZE;
4351 else if (end - addr < MIN_LRU_BATCH * PAGE_SIZE / 2)
4352 start = end - MIN_LRU_BATCH * PAGE_SIZE;
4353 else {
4354 start = addr - MIN_LRU_BATCH * PAGE_SIZE / 2;
4355 end = addr + MIN_LRU_BATCH * PAGE_SIZE / 2;
4356 }
4357 }
4358
4359 memcg = get_mem_cgroup_from_folio(folio);
4360 lruvec = mem_cgroup_lruvec(memcg, pgdat);
4361 mm_state = get_mm_state(lruvec);
4362
4363 lazy_mmu_mode_enable();
4364
4365 pte -= (addr - start) / PAGE_SIZE;
4366
4367 for (i = 0, addr = start; addr != end;
4368 i += nr, pte += nr, addr += nr * PAGE_SIZE) {
4369 unsigned long pfn;
4370 pte_t ptent = ptep_get(pte);
4371
4372 nr = 1;
4373 pfn = get_pte_pfn(ptent, vma, addr, pgdat);
4374 if (pfn == -1)
4375 continue;
4376
4377 folio = get_pfn_folio(pfn, memcg, pgdat);
4378 if (!folio)
4379 continue;
4380
4381 if (folio_test_large(folio)) {
4382 const unsigned int max_nr = (end - addr) >> PAGE_SHIFT;
4383
4384 nr = folio_pte_batch_flags(folio, NULL, pte, &ptent,
4385 max_nr, FPB_MERGE_YOUNG_DIRTY);
4386 }
4387
4388 if (!test_and_clear_young_ptes_notify(vma, addr, pte, nr))
4389 continue;
4390
4391 if (last != folio) {
4392 walk_update_folio(walk, vma, lruvec, last, dirty);
4393
4394 last = folio;
4395 dirty = false;
4396 }
4397
4398 if (pte_dirty(ptent))
4399 dirty = true;
4400
4401 young += nr;
4402 }
4403
4404 walk_update_folio(walk, vma, lruvec, last, dirty);
4405
4406 lazy_mmu_mode_disable();
4407
4408 /* feedback from rmap walkers to page table walkers */
4409 if (mm_state && suitable_to_scan(i, young))
4410 update_bloom_filter(mm_state, READ_ONCE(lruvec->lrugen.max_seq),
4411 pvmw->pmd);
4412
4413 mem_cgroup_put(memcg);
4414
4415 return true;
4416 }
4417
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki