Skip to contentSkip to conversation

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

PATCH In review Stephen Rothwell 3 participants 6 messages Dec 17, 2011 – Dec 19, 2011

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

Hi ,

After merging the final tree, today's linux-next build (sh edosk7705_defconfig and lots of other sh configs) failed like this:

mm/pgtable-generic.c: In function 'pmdp_clear_flush_young':
mm/pgtable-generic.c:76: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed

This is the

	VM_BUG_ON(address & ~HPAGE_PMD_MASK);

in pmdp_clear_flush_young().

Exposed by commit 835cea45a4a0 ("hugetlb: replace BUG() with BUILD_BUG() for dummy definitions") from the akpm tree but I don't know the root cause.

This may have a fix somewhere (if it is sh specific) but the current sh tree in linux-next
(git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git) does not exist.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#1 lore raw

Hi,

Quoted 13 lines · On Sat, 17 Dec 2011 15:22:53 +1100 Stephen Rothwell <[email protected]>…

After merging the final tree, today's linux-next build (sh edosk7705_defconfig and lots of other sh configs) failed like this:

mm/pgtable-generic.c: In function 'pmdp_clear_flush_young':
mm/pgtable-generic.c:76: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed

This is the

	VM_BUG_ON(address & ~HPAGE_PMD_MASK);

in pmdp_clear_flush_young().

Quoted 8 lines

Exposed by commit 835cea45a4a0 ("hugetlb: replace BUG() with BUILD_BUG() for dummy definitions") from the akpm tree but I don't know the root cause.

This may have a fix somewhere (if it is sh specific) but the current sh tree in linux-next
(git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git) does not exist.

We are getting the same for all the cris config builds.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#2 lore raw

PATCH 1/1 mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young()

In reply to Stephen Rothwell

From: David Daney <[email protected]>

It has been reported that when building for sh:

mm/pgtable-generic.c: In function 'pmdp_clear_flush_young':
mm/pgtable-generic.c:76: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed

Adding some ugle #ifdeffery will probably fix this issue.

---

This is completely untested, but may be the best fix for this. Linus and others have expressed a dislike for using BUG() to detect what should be dead code paths at runtime, but it seems to be the state of the art here.

 mm/pgtable-generic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/pgtable-generic.c +1 -1
index eb663fb..73784c8 100644
@@ -70,7 +70,7 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,
 			   unsigned long address, pmd_t *pmdp)
 {
 	int young;
-#ifndef CONFIG_TRANSPARENT_HUGEPAGE
+#if !defined(CONFIG_HUGETLB_PAGE) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
 	BUG();
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 	VM_BUG_ON(address & ~HPAGE_PMD_MASK);
Signature · 1 line
1.7.2.3
#3 lore raw

Re: [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young()

Quoted 9 lines · David Daney

From: David Daney <[email protected]>

It has been reported that when building for sh:

mm/pgtable-generic.c: In function 'pmdp_clear_flush_young':
mm/pgtable-generic.c:76: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed

Adding some ugle #ifdeffery will probably fix this issue.

It won't, CONFIG_HUGETLB_PAGE has nothing at all to do with this.

Quoted 8 lines

---

This is completely untested, but may be the best fix for this. Linus and others have expressed a dislike for using BUG() to detect what should be dead code paths at runtime, but it seems to be the state of the art here.

The problem here is that HPAGE_PMD_MASK is being referenced without CONFIG_TRANSPARENT_HUGEPAGE. pmdp_clear_flush_young() is only applicable with that config option enabled. So rather than trying to minimize lines captured under an #ifdef by placing the BUG() directly in the function for asm-generic, you'll need to wrap pmd_clear_flush_young() with #ifdef CONFIG_TRANSPARENT_HUGEPAGE and define its equivalent for CONFIG_TRANSPARENT_HUGEPAGE=n that breaks the build if not enabled.

Quoted 16 lines
 mm/pgtable-generic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/pgtable-generic.c +1 -1
index eb663fb..73784c8 100644
@@ -70,7 +70,7 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,
 			   unsigned long address, pmd_t *pmdp)
 {
 	int young;
-#ifndef CONFIG_TRANSPARENT_HUGEPAGE
+#if !defined(CONFIG_HUGETLB_PAGE) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
 	BUG();
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 	VM_BUG_ON(address & ~HPAGE_PMD_MASK);
#4 lore raw

Re: [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young()

Quoted 6 lines · David Rientjes
Quoted 4 lines · David Daney

From: David Daney<[email protected]>

It has been reported that when building for sh:

Quoted 8 lines
Quoted 5 lines

mm/pgtable-generic.c: In function 'pmdp_clear_flush_young':
mm/pgtable-generic.c:76: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed

Adding some ugle #ifdeffery will probably fix this issue.

It won't, CONFIG_HUGETLB_PAGE has nothing at all to do with this.

Sorry for the noise. You are correct.

Quoted 9 lines
Quoted 8 lines

---

This is completely untested, but may be the best fix for this. Linus and others have expressed a dislike for using BUG() to detect what should be dead code paths at runtime, but it seems to be the state of the art here.

Quoted 8 lines

The problem here is that HPAGE_PMD_MASK is being referenced without CONFIG_TRANSPARENT_HUGEPAGE. pmdp_clear_flush_young() is only applicable with that config option enabled. So rather than trying to minimize lines captured under an #ifdef by placing the BUG() directly in the function for asm-generic, you'll need to wrap pmd_clear_flush_young() with #ifdef CONFIG_TRANSPARENT_HUGEPAGE and define its equivalent for CONFIG_TRANSPARENT_HUGEPAGE=n that breaks the build if not enabled.

That does sound like a better option.

I still think having the BUILD_BUG defined as we do in Andrew Morton's tree is the correct approach, and I don't want to see that reverted because of this ugliness.

Really this is hackery that should be cleaned up as you suggest, instead of being papered over with this BUG() thing. I can't test SH things, otherwise I might look at it. The SH maintainers should probably take a look instead.

David Daney

Quoted 16 lines
Quoted 16 lines
  mm/pgtable-generic.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
mm/pgtable-generic.c +1 -1
index eb663fb..73784c8 100644
@@ -70,7 +70,7 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,
  			   unsigned long address, pmd_t *pmdp)
  {
  	int young;
-#ifndef CONFIG_TRANSPARENT_HUGEPAGE
+#if !defined(CONFIG_HUGETLB_PAGE) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
  	BUG();
  #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
  	VM_BUG_ON(address&  ~HPAGE_PMD_MASK);
#5 lore raw

Re: [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young()

Quoted 9 lines · David Daney
Quoted 8 lines

The problem here is that HPAGE_PMD_MASK is being referenced without CONFIG_TRANSPARENT_HUGEPAGE. pmdp_clear_flush_young() is only applicable with that config option enabled. So rather than trying to minimize lines captured under an #ifdef by placing the BUG() directly in the function for asm-generic, you'll need to wrap pmd_clear_flush_young() with #ifdef CONFIG_TRANSPARENT_HUGEPAGE and define its equivalent for CONFIG_TRANSPARENT_HUGEPAGE=n that breaks the build if not enabled.

Quoted 6 lines

That does sound like a better option.

I still think having the BUILD_BUG defined as we do in Andrew Morton's tree is the correct approach, and I don't want to see that reverted because of this ugliness.

Agreed, the problem here is that we have existing code, such as pmdp_clear_flush_young() that is calling BUG() at runtime for non-supported configurations. So when BUILD_BUG_ON() for HPAGE_PMD_MASK and friends was introduced, it detects improper use that needs to be fixed and you've found one of those cases.

Quoted 4 lines

Really this is hackery that should be cleaned up as you suggest, instead of being papered over with this BUG() thing. I can't test SH things, otherwise I might look at it. The SH maintainers should probably take a look instead.

It's not only about sh, this will affect any architecture that uses the generic version of pmdp_clear_flush_young(), which is everything except x86.