* [linux-next:pending-fixes 301/373] mm/vmscan.c:3498: undefined reference to `pmdp_test_and_clear_young'
@ 2024-10-25 13:12 kernel test robot
2024-10-25 19:21 ` James Houghton
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2024-10-25 13:12 UTC (permalink / raw)
To: Yu Zhao
Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List,
James Houghton
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git pending-fixes
head: a06df994e3b96f0f6b97e5d2679c41f60d182bbe
commit: 1ee09e54a76f75dcf5d59737d81bec1624bf4764 [301/373] mm: multi-gen LRU: use {ptep,pmdp}_clear_young_notify()
config: i386-buildonly-randconfig-004-20241025 (https://download.01.org/0day-ci/archive/20241025/202410252141.djLwbAYF-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410252141.djLwbAYF-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/202410252141.djLwbAYF-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: mm/vmscan.o: in function `walk_pmd_range_locked':
>> mm/vmscan.c:3498: undefined reference to `pmdp_test_and_clear_young'
vim +3498 mm/vmscan.c
3440
3441 static void walk_pmd_range_locked(pud_t *pud, unsigned long addr, struct vm_area_struct *vma,
3442 struct mm_walk *args, unsigned long *bitmap, unsigned long *first)
3443 {
3444 int i;
3445 pmd_t *pmd;
3446 spinlock_t *ptl;
3447 struct lru_gen_mm_walk *walk = args->private;
3448 struct mem_cgroup *memcg = lruvec_memcg(walk->lruvec);
3449 struct pglist_data *pgdat = lruvec_pgdat(walk->lruvec);
3450 DEFINE_MAX_SEQ(walk->lruvec);
3451 int old_gen, new_gen = lru_gen_from_seq(max_seq);
3452
3453 VM_WARN_ON_ONCE(pud_leaf(*pud));
3454
3455 /* try to batch at most 1+MIN_LRU_BATCH+1 entries */
3456 if (*first == -1) {
3457 *first = addr;
3458 bitmap_zero(bitmap, MIN_LRU_BATCH);
3459 return;
3460 }
3461
3462 i = addr == -1 ? 0 : pmd_index(addr) - pmd_index(*first);
3463 if (i && i <= MIN_LRU_BATCH) {
3464 __set_bit(i - 1, bitmap);
3465 return;
3466 }
3467
3468 pmd = pmd_offset(pud, *first);
3469
3470 ptl = pmd_lockptr(args->mm, pmd);
3471 if (!spin_trylock(ptl))
3472 goto done;
3473
3474 arch_enter_lazy_mmu_mode();
3475
3476 do {
3477 unsigned long pfn;
3478 struct folio *folio;
3479
3480 /* don't round down the first address */
3481 addr = i ? (*first & PMD_MASK) + i * PMD_SIZE : *first;
3482
3483 if (pmd_present(pmd[i]) && !pmd_trans_huge(pmd[i])) {
3484 if (!walk->force_scan && should_clear_pmd_young() &&
3485 !mm_has_notifiers(args->mm))
3486 pmdp_test_and_clear_young(vma, addr, pmd + i);
3487 goto next;
3488 }
3489
3490 pfn = get_pmd_pfn(pmd[i], vma, addr, pgdat);
3491 if (pfn == -1)
3492 goto next;
3493
3494 folio = get_pfn_folio(pfn, memcg, pgdat, walk->can_swap);
3495 if (!folio)
3496 goto next;
3497
> 3498 if (!pmdp_clear_young_notify(vma, addr, pmd + i))
3499 goto next;
3500
3501 walk->mm_stats[MM_LEAF_YOUNG]++;
3502
3503 if (pmd_dirty(pmd[i]) && !folio_test_dirty(folio) &&
3504 !(folio_test_anon(folio) && folio_test_swapbacked(folio) &&
3505 !folio_test_swapcache(folio)))
3506 folio_mark_dirty(folio);
3507
3508 old_gen = folio_update_gen(folio, new_gen);
3509 if (old_gen >= 0 && old_gen != new_gen)
3510 update_batch_size(walk, folio, old_gen, new_gen);
3511 next:
3512 i = i > MIN_LRU_BATCH ? 0 : find_next_bit(bitmap, MIN_LRU_BATCH, i) + 1;
3513 } while (i <= MIN_LRU_BATCH);
3514
3515 arch_leave_lazy_mmu_mode();
3516 spin_unlock(ptl);
3517 done:
3518 *first = -1;
3519 }
3520
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
* [linux-next:pending-fixes 301/373] mm/vmscan.c:3498: undefined reference to `pmdp_test_and_clear_young'
2024-10-25 13:12 [linux-next:pending-fixes 301/373] mm/vmscan.c:3498: undefined reference to `pmdp_test_and_clear_young' kernel test robot
@ 2024-10-25 19:21 ` James Houghton
2024-10-30 11:28 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: James Houghton @ 2024-10-25 19:21 UTC (permalink / raw)
To: akpm; +Cc: lkp, jthoughton, linux-mm, oe-kbuild-all, yuzhao
Hi Andrew,
The following diff applied to the second patch[1] fixes this error. The
diff is functionally a no-op; the get_pmd_pfn() immediately following
the code here would return -1 in the !pmd_present() case.
I can send a brand new patch if you'd prefer.
[1]: https://lore.kernel.org/linux-mm/20241019012940.3656292-3-jthoughton@google.com/
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 29c098790b01..70604eef0dd3 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3486,7 +3486,10 @@ static void walk_pmd_range_locked(pud_t *pud, unsigned long addr, struct vm_area
/* don't round down the first address */
addr = i ? (*first & PMD_MASK) + i * PMD_SIZE : *first;
- if (pmd_present(pmd[i]) && !pmd_trans_huge(pmd[i])) {
+ if (!pmd_present(pmd[i]))
+ goto next;
+
+ if (!pmd_trans_huge(pmd[i])) {
if (!walk->force_scan && should_clear_pmd_young() &&
!mm_has_notifiers(args->mm))
pmdp_test_and_clear_young(vma, addr, pmd + i);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-next:pending-fixes 301/373] mm/vmscan.c:3498: undefined reference to `pmdp_test_and_clear_young'
2024-10-25 19:21 ` James Houghton
@ 2024-10-30 11:28 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2024-10-30 11:28 UTC (permalink / raw)
To: James Houghton, Andrew Morton
Cc: kernel test robot, linux-mm, oe-kbuild-all, Yu Zhao
On Fri, Oct 25, 2024, at 19:21, James Houghton wrote:
> Hi Andrew,
>
> The following diff applied to the second patch[1] fixes this error. The
> diff is functionally a no-op; the get_pmd_pfn() immediately following
> the code here would return -1 in the !pmd_present() case.
>
> I can send a brand new patch if you'd prefer.
>
> [1]:
> https://lore.kernel.org/linux-mm/20241019012940.3656292-3-jthoughton@google.com/
I ran into another problem with the build failure below, and found
that your fixup address this as well.
Arnd
In file included from <command-line>:
In function 'pmdp_test_and_clear_young',
inlined from 'walk_pmd_range_locked.constprop.isra' at mm/vmscan.c:3504:8:
include/linux/compiler_types.h:517:45: error: call to '__compiletime_assert_401' declared with attribute error: BUILD_BUG failed
517 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:498:25: note: in definition of macro '__compiletime_assert'
498 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler_types.h:517:9: note: in expansion of macro '_compiletime_assert'
517 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
| ^~~~~~~~~~~~~~~~
include/linux/pgtable.h:383:9: note: in expansion of macro 'BUILD_BUG'
383 | BUILD_BUG();
| ^~~~~~~~~
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-30 11:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-25 13:12 [linux-next:pending-fixes 301/373] mm/vmscan.c:3498: undefined reference to `pmdp_test_and_clear_young' kernel test robot
2024-10-25 19:21 ` James Houghton
2024-10-30 11:28 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox