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

Stephen Rothwell posted 1 patch 11 months, 2 weeks ago
There is a newer version of this series
mm/rmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
linux-next: build failure after merge of the mm tree
Posted by Stephen Rothwell 11 months, 2 weeks ago
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 <sfr@canb.auug.org.au>
Date: Thu, 9 Jan 2025 15:39:17 +1100
Subject: [PATCH] fix up for "rmap: add support for PUD sized mappings to rmap"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 mm/rmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 227c60e38261..721d4f7b7570 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -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);
-- 
2.45.2

-- 
Cheers,
Stephen Rothwell
Re: linux-next: build failure after merge of the mm tree
Posted by Stephen Rothwell 11 months, 2 weeks ago
Hi all,

On Thu, 9 Jan 2025 15:59:54 +1100 Stephen Rothwell <sfr@canb.auug.org.au> 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);
      |                                          ^~~~~~~~~~~~

> 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 <sfr@canb.auug.org.au>
> Date: Thu, 9 Jan 2025 15:39:17 +1100
> Subject: [PATCH] fix up for "rmap: add support for PUD sized mappings to rmap"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  mm/rmap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 227c60e38261..721d4f7b7570 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -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);

-- 
Cheers,
Stephen Rothwell
Re: linux-next: build failure after merge of the mm tree
Posted by Andrew Morton 11 months, 2 weeks ago
On Thu, 9 Jan 2025 16:01:26 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> On Thu, 9 Jan 2025 15:59:54 +1100 Stephen Rothwell <sfr@canb.auug.org.au> 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.
Re: linux-next: build failure after merge of the mm tree
Posted by Alistair Popple 11 months, 2 weeks ago
On Wed, Jan 08, 2025 at 09:32:59PM -0800, Andrew Morton wrote:
> On Thu, 9 Jan 2025 16:01:26 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> > On Thu, 9 Jan 2025 15:59:54 +1100 Stephen Rothwell <sfr@canb.auug.org.au> 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.

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