diff mbox series

[linux-next:pending-fixes,301/373] mm/vmscan.c:3498: undefined reference to `pmdp_test_and_clear_young'

Message ID 20241025192106.957236-1-jthoughton@google.com (mailing list archive)
State New
Headers show
Series None | expand

Commit Message

James Houghton Oct. 25, 2024, 7:21 p.m. UTC
Hi Andrew,

The following diff applied to the second patch[1] fixes this error. The

Comments

Arnd Bergmann Oct. 30, 2024, 11:28 a.m. UTC | #1
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();
      |         ^~~~~~~~~
diff mbox series

Patch

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);