Skip to contentSkip to conversation

linux-next: build failure after merge of the mm tree

PATCH Stephen Rothwell 3 participants 4 messages Jan 9, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the mm tree, today's linux-next build (x86_64 allnoconfig) failed like this:

Caused by commit

ce9c7ffcf303 ("rmap: add support for PUD sized mappings to rmap")

$ grep CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD .config
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
$ grep CONFIG_PGTABLE_HAS_HUGE_LEAVES .config
$

from include/linux/huge_mm.h:

#ifdef CONFIG_PGTABLE_HAS_HUGE_LEAVES
#define HPAGE_PMD_SHIFT PMD_SHIFT
#define HPAGE_PUD_SHIFT PUD_SHIFT
#else
#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
#define HPAGE_PUD_SHIFT ({ BUILD_BUG(); 0; })
#endif

I have applied this hack for today:

From: Stephen Rothwell <[email protected]>
Date: Thu, 9 Jan 2025 15:39:17 +1100
Subject: [PATCH] fix up for "rmap: add support for PUD sized mappings to rmap"

---
 mm/rmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/rmap.c +2 -2
index 227c60e38261..721d4f7b7570 100644
@@ -1558,7 +1558,7 @@ void folio_add_file_rmap_pmd(struct folio *folio, struct page *page,
 void folio_add_file_rmap_pud(struct folio *folio, struct page *page,
 		struct vm_area_struct *vma)
 {
-#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
+#if defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) && defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)
 	__folio_add_file_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
 #else
 	WARN_ON_ONCE(true);
@@ -1690,7 +1690,7 @@ void folio_remove_rmap_pmd(struct folio *folio, struct page *page,
 void folio_remove_rmap_pud(struct folio *folio, struct page *page,
 		struct vm_area_struct *vma)
 {
-#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
+#if defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) && defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)
 	__folio_remove_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
 #else
 	WARN_ON_ONCE(true);
Signature · 5 lines
2.45.2

-- 
Cheers,
Stephen Rothwell
#1 lore raw

Hi all,

Quoted 3 lines · On Thu, 9 Jan 2025 15:59:54 +1100 Stephen Rothwell <[email protected]> wrote:

After merging the mm tree, today's linux-next build (x86_64 allnoconfig) failed like this:

In file included from <command-line>:
mm/rmap.c: In function 'folio_add_file_rmap_pud':
include/linux/compiler_types.h:542:45: error: call to '__compiletime_assert_328' declared with attribute error: BUILD_BUG failed
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:523:25: note: in definition of macro '__compiletime_assert'

  523 |                         prefix ## suffix();                             \
      |                         ^~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
  542 |         _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/huge_mm.h:107:28: note: in expansion of macro 'BUILD_BUG'
  107 | #define HPAGE_PUD_SHIFT ({ BUILD_BUG(); 0; })
      |                            ^~~~~~~~~
include/linux/huge_mm.h:115:26: note: in expansion of macro 'HPAGE_PUD_SHIFT'
  115 | #define HPAGE_PUD_ORDER (HPAGE_PUD_SHIFT-PAGE_SHIFT)
      |                          ^~~~~~~~~~~~~~~
include/linux/huge_mm.h:116:26: note: in expansion of macro 'HPAGE_PUD_ORDER'
  116 | #define HPAGE_PUD_NR (1<<HPAGE_PUD_ORDER)
      |                          ^~~~~~~~~~~~~~~

mm/rmap.c:1562:44: note: in expansion of macro 'HPAGE_PUD_NR'
1562 | __folio_add_file_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
| ^~~~~~~~~~~~
mm/rmap.c: In function 'folio_remove_rmap_pud':
include/linux/compiler_types.h:542:45: error: call to '__compiletime_assert_329' declared with attribute error: BUILD_BUG failed
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:523:25: note: in definition of macro '__compiletime_assert'

  523 |                         prefix ## suffix();                             \
      |                         ^~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
  542 |         _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/huge_mm.h:107:28: note: in expansion of macro 'BUILD_BUG'
  107 | #define HPAGE_PUD_SHIFT ({ BUILD_BUG(); 0; })
      |                            ^~~~~~~~~
include/linux/huge_mm.h:115:26: note: in expansion of macro 'HPAGE_PUD_SHIFT'
  115 | #define HPAGE_PUD_ORDER (HPAGE_PUD_SHIFT-PAGE_SHIFT)
      |                          ^~~~~~~~~~~~~~~
include/linux/huge_mm.h:116:26: note: in expansion of macro 'HPAGE_PUD_ORDER'
  116 | #define HPAGE_PUD_NR (1<<HPAGE_PUD_ORDER)
      |                          ^~~~~~~~~~~~~~~

mm/rmap.c:1694:42: note: in expansion of macro 'HPAGE_PUD_NR'
1694 | __folio_remove_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
| ^~~~~~~~~~~~

Quoted 52 lines

Caused by commit

ce9c7ffcf303 ("rmap: add support for PUD sized mappings to rmap")

$ grep CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD .config
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
$ grep CONFIG_PGTABLE_HAS_HUGE_LEAVES .config
$

from include/linux/huge_mm.h:

#ifdef CONFIG_PGTABLE_HAS_HUGE_LEAVES
#define HPAGE_PMD_SHIFT PMD_SHIFT
#define HPAGE_PUD_SHIFT PUD_SHIFT
#else
#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
#define HPAGE_PUD_SHIFT ({ BUILD_BUG(); 0; })
#endif

I have applied this hack for today:

From: Stephen Rothwell <[email protected]>
Date: Thu, 9 Jan 2025 15:39:17 +1100
Subject: [PATCH] fix up for "rmap: add support for PUD sized mappings to rmap"

---
 mm/rmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/rmap.c +2 -2
index 227c60e38261..721d4f7b7570 100644
@@ -1558,7 +1558,7 @@ void folio_add_file_rmap_pmd(struct folio *folio, struct page *page,
 void folio_add_file_rmap_pud(struct folio *folio, struct page *page,
 		struct vm_area_struct *vma)
 {
-#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
+#if defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) && defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)
 	__folio_add_file_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
 #else
 	WARN_ON_ONCE(true);
@@ -1690,7 +1690,7 @@ void folio_remove_rmap_pmd(struct folio *folio, struct page *page,
 void folio_remove_rmap_pud(struct folio *folio, struct page *page,
 		struct vm_area_struct *vma)
 {
-#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
+#if defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) && defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)
 	__folio_remove_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
 #else
 	WARN_ON_ONCE(true);
Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#2 lore raw
Quoted 8 lines · On Thu, 9 Jan 2025 16:01:26 +1100 Stephen Rothwell <[email protected]> wrote:
Quoted 3 lines · On Thu, 9 Jan 2025 15:59:54 +1100 Stephen Rothwell <[email protected]> wrote:

After merging the mm tree, today's linux-next build (x86_64 allnoconfig) failed like this:

In file included from <command-line>:
mm/rmap.c: In function 'folio_add_file_rmap_pud':
include/linux/compiler_types.h:542:45: error: call to '__compiletime_assert_328' declared with attribute error: BUILD_BUG failed

Thanks ;(

I'll drop the series "fs/dax: Fix ZONE_DEVICE page reference counts", v5 from mm.git.

#3 lore raw
Quoted 7 lines · Andrew Morton
Quoted 5 lines · On Thu, 9 Jan 2025 16:01:26 +1100 Stephen Rothwell <[email protected]> wrote:
Quoted 3 lines · On Thu, 9 Jan 2025 15:59:54 +1100 Stephen Rothwell <[email protected]> wrote:

After merging the mm tree, today's linux-next build (x86_64 allnoconfig) failed like this:

Quoted 8 lines
Quoted 3 lines

In file included from <command-line>:
mm/rmap.c: In function 'folio_add_file_rmap_pud':
include/linux/compiler_types.h:542:45: error: call to '__compiletime_assert_328' declared with attribute error: BUILD_BUG failed

Thanks ;(

I'll drop the series "fs/dax: Fix ZONE_DEVICE page reference counts", v5 from mm.git.

Sorry about that. I'm doing a local test build across more architectures and configs now. There are a few other minor fixups that are needed too so will respin with those in the morning.

- Alistair