Hi JP, 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/JP-Kobryn-Meta/mm-move-pgscan-pgsteal-pgrefill-to-node-stats/20260219-063016 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20260218222652.108411-1-jp.kobryn%40linux.dev patch subject: [PATCH v3] mm: move pgscan, pgsteal, pgrefill to node stats config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260219/[email protected]/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260219/[email protected]/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 <[email protected]> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ All warnings (new ones prefixed by >>): mm/vmscan.c: In function 'scan_folios': >> mm/vmscan.c:4542:28: warning: unused variable 'memcg' [-Wunused-variable] 4542 | struct mem_cgroup *memcg = lruvec_memcg(lruvec); | ^~~~~ vim +/memcg +4542 mm/vmscan.c ac35a490237446 Yu Zhao 2022-09-18 4527 af827e0904899f Koichiro Den 2025-05-31 4528 static int scan_folios(unsigned long nr_to_scan, struct lruvec *lruvec, af827e0904899f Koichiro Den 2025-05-31 4529 struct scan_control *sc, int type, int tier, af827e0904899f Koichiro Den 2025-05-31 4530 struct list_head *list) ac35a490237446 Yu Zhao 2022-09-18 4531 { 669281ee7ef731 Kalesh Singh 2023-08-01 4532 int i; 669281ee7ef731 Kalesh Singh 2023-08-01 4533 int gen; b0e9e710c6bb5a JP Kobryn 2026-02-18 4534 enum node_stat_item item; ac35a490237446 Yu Zhao 2022-09-18 4535 int sorted = 0; ac35a490237446 Yu Zhao 2022-09-18 4536 int scanned = 0; ac35a490237446 Yu Zhao 2022-09-18 4537 int isolated = 0; 8c2214fc9a470a Jaewon Kim 2023-10-03 4538 int skipped = 0; 49d921b471c513 Chen Ridong 2025-12-04 4539 int scan_batch = min(nr_to_scan, MAX_LRU_BATCH); 49d921b471c513 Chen Ridong 2025-12-04 4540 int remaining = scan_batch; 391655fe08d1f9 Yu Zhao 2022-12-21 4541 struct lru_gen_folio *lrugen = &lruvec->lrugen; ac35a490237446 Yu Zhao 2022-09-18 @4542 struct mem_cgroup *memcg = lruvec_memcg(lruvec); ac35a490237446 Yu Zhao 2022-09-18 4543 ac35a490237446 Yu Zhao 2022-09-18 4544 VM_WARN_ON_ONCE(!list_empty(list)); ac35a490237446 Yu Zhao 2022-09-18 4545 ac35a490237446 Yu Zhao 2022-09-18 4546 if (get_nr_gens(lruvec, type) == MIN_NR_GENS) ac35a490237446 Yu Zhao 2022-09-18 4547 return 0; ac35a490237446 Yu Zhao 2022-09-18 4548 ac35a490237446 Yu Zhao 2022-09-18 4549 gen = lru_gen_from_seq(lrugen->min_seq[type]); ac35a490237446 Yu Zhao 2022-09-18 4550 669281ee7ef731 Kalesh Singh 2023-08-01 4551 for (i = MAX_NR_ZONES; i > 0; i--) { ac35a490237446 Yu Zhao 2022-09-18 4552 LIST_HEAD(moved); 8c2214fc9a470a Jaewon Kim 2023-10-03 4553 int skipped_zone = 0; 669281ee7ef731 Kalesh Singh 2023-08-01 4554 int zone = (sc->reclaim_idx + i) % MAX_NR_ZONES; 6df1b2212950aa Yu Zhao 2022-12-21 4555 struct list_head *head = &lrugen->folios[gen][type][zone]; ac35a490237446 Yu Zhao 2022-09-18 4556 ac35a490237446 Yu Zhao 2022-09-18 4557 while (!list_empty(head)) { ac35a490237446 Yu Zhao 2022-09-18 4558 struct folio *folio = lru_to_folio(head); ac35a490237446 Yu Zhao 2022-09-18 4559 int delta = folio_nr_pages(folio); ac35a490237446 Yu Zhao 2022-09-18 4560 ac35a490237446 Yu Zhao 2022-09-18 4561 VM_WARN_ON_ONCE_FOLIO(folio_test_unevictable(folio), folio); ac35a490237446 Yu Zhao 2022-09-18 4562 VM_WARN_ON_ONCE_FOLIO(folio_test_active(folio), folio); ac35a490237446 Yu Zhao 2022-09-18 4563 VM_WARN_ON_ONCE_FOLIO(folio_is_file_lru(folio) != type, folio); ac35a490237446 Yu Zhao 2022-09-18 4564 VM_WARN_ON_ONCE_FOLIO(folio_zonenum(folio) != zone, folio); ac35a490237446 Yu Zhao 2022-09-18 4565 ac35a490237446 Yu Zhao 2022-09-18 4566 scanned += delta; ac35a490237446 Yu Zhao 2022-09-18 4567 669281ee7ef731 Kalesh Singh 2023-08-01 4568 if (sort_folio(lruvec, folio, sc, tier)) ac35a490237446 Yu Zhao 2022-09-18 4569 sorted += delta; ac35a490237446 Yu Zhao 2022-09-18 4570 else if (isolate_folio(lruvec, folio, sc)) { ac35a490237446 Yu Zhao 2022-09-18 4571 list_add(&folio->lru, list); ac35a490237446 Yu Zhao 2022-09-18 4572 isolated += delta; ac35a490237446 Yu Zhao 2022-09-18 4573 } else { ac35a490237446 Yu Zhao 2022-09-18 4574 list_move(&folio->lru, &moved); 8c2214fc9a470a Jaewon Kim 2023-10-03 4575 skipped_zone += delta; ac35a490237446 Yu Zhao 2022-09-18 4576 } ac35a490237446 Yu Zhao 2022-09-18 4577 8c2214fc9a470a Jaewon Kim 2023-10-03 4578 if (!--remaining || max(isolated, skipped_zone) >= MIN_LRU_BATCH) ac35a490237446 Yu Zhao 2022-09-18 4579 break; ac35a490237446 Yu Zhao 2022-09-18 4580 } ac35a490237446 Yu Zhao 2022-09-18 4581 8c2214fc9a470a Jaewon Kim 2023-10-03 4582 if (skipped_zone) { ac35a490237446 Yu Zhao 2022-09-18 4583 list_splice(&moved, head); 8c2214fc9a470a Jaewon Kim 2023-10-03 4584 __count_zid_vm_events(PGSCAN_SKIP, zone, skipped_zone); 8c2214fc9a470a Jaewon Kim 2023-10-03 4585 skipped += skipped_zone; ac35a490237446 Yu Zhao 2022-09-18 4586 } ac35a490237446 Yu Zhao 2022-09-18 4587 ac35a490237446 Yu Zhao 2022-09-18 4588 if (!remaining || isolated >= MIN_LRU_BATCH) ac35a490237446 Yu Zhao 2022-09-18 4589 break; ac35a490237446 Yu Zhao 2022-09-18 4590 } ac35a490237446 Yu Zhao 2022-09-18 4591 e452872b40e3f1 Hao Jia 2025-03-18 4592 item = PGSCAN_KSWAPD + reclaimer_offset(sc); b0e9e710c6bb5a JP Kobryn 2026-02-18 4593 mod_lruvec_state(lruvec, item, isolated); b0e9e710c6bb5a JP Kobryn 2026-02-18 4594 mod_lruvec_state(lruvec, PGREFILL, sorted); b0e9e710c6bb5a JP Kobryn 2026-02-18 4595 mod_lruvec_state(lruvec, PGSCAN_ANON + type, isolated); 49d921b471c513 Chen Ridong 2025-12-04 4596 trace_mm_vmscan_lru_isolate(sc->reclaim_idx, sc->order, scan_batch, 8c2214fc9a470a Jaewon Kim 2023-10-03 4597 scanned, skipped, isolated, 8c2214fc9a470a Jaewon Kim 2023-10-03 4598 type ? LRU_INACTIVE_FILE : LRU_INACTIVE_ANON); 1bc542c6a0d144 Zeng Jingxiang 2024-10-26 4599 if (type == LRU_GEN_FILE) 1bc542c6a0d144 Zeng Jingxiang 2024-10-26 4600 sc->nr.file_taken += isolated; ac35a490237446 Yu Zhao 2022-09-18 4601 /* e9d4e1ee788097 Yu Zhao 2022-12-21 4602 * There might not be eligible folios due to reclaim_idx. Check the e9d4e1ee788097 Yu Zhao 2022-12-21 4603 * remaining to prevent livelock if it's not making progress. ac35a490237446 Yu Zhao 2022-09-18 4604 */ ac35a490237446 Yu Zhao 2022-09-18 4605 return isolated || !remaining ? scanned : 0; ac35a490237446 Yu Zhao 2022-09-18 4606 } ac35a490237446 Yu Zhao 2022-09-18 4607 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki

