All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the final tree
@ 2011-12-17  4:22 Stephen Rothwell
  2011-12-17  4:27 ` Stephen Rothwell
  2011-12-19 17:38 ` [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young() David Daney
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Rothwell @ 2011-12-17  4:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-next, linux-kernel, David Daney, Paul Mundt

[-- Attachment #1: Type: text/plain, Size: 839 bytes --]

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.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: build failure after merge of the final tree
  2011-12-17  4:22 linux-next: build failure after merge of the final tree Stephen Rothwell
@ 2011-12-17  4:27 ` Stephen Rothwell
  2011-12-19 17:38 ` [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young() David Daney
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2011-12-17  4:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-next, linux-kernel, David Daney, Paul Mundt

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

Hi,

On Sat, 17 Dec 2011 15:22:53 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> 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.

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

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young()
  2011-12-17  4:22 linux-next: build failure after merge of the final tree Stephen Rothwell
  2011-12-17  4:27 ` Stephen Rothwell
@ 2011-12-19 17:38 ` David Daney
  2011-12-19 19:29   ` David Rientjes
  1 sibling, 1 reply; 6+ messages in thread
From: David Daney @ 2011-12-19 17:38 UTC (permalink / raw)
  To: Andrew Morton, Stephen Rothwell, Paul Mundt
  Cc: linux-kernel, David Rientjes, David Daney

From: David Daney <david.daney@cavium.com>

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.

Signed-off-by: David Daney <david.daney@cavium.com>
---

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

diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index eb663fb..73784c8 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -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);
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young()
  2011-12-19 17:38 ` [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young() David Daney
@ 2011-12-19 19:29   ` David Rientjes
  2011-12-19 19:52     ` David Daney
  0 siblings, 1 reply; 6+ messages in thread
From: David Rientjes @ 2011-12-19 19:29 UTC (permalink / raw)
  To: David Daney
  Cc: Andrew Morton, Stephen Rothwell, Paul Mundt, linux-kernel, David Daney

On Mon, 19 Dec 2011, David Daney wrote:

> From: David Daney <david.daney@cavium.com>
> 
> 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.

> Signed-off-by: David Daney <david.daney@cavium.com>
> ---
> 
> 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.

>  mm/pgtable-generic.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
> index eb663fb..73784c8 100644
> --- a/mm/pgtable-generic.c
> +++ b/mm/pgtable-generic.c
> @@ -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);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young()
  2011-12-19 19:29   ` David Rientjes
@ 2011-12-19 19:52     ` David Daney
  2011-12-19 20:34       ` David Rientjes
  0 siblings, 1 reply; 6+ messages in thread
From: David Daney @ 2011-12-19 19:52 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Stephen Rothwell, Paul Mundt, linux-kernel, David Daney

On 12/19/2011 11:29 AM, David Rientjes wrote:
> On Mon, 19 Dec 2011, David Daney wrote:
>
>> From: David Daney<david.daney@cavium.com>
>>
>> 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.
>

Sorry for the noise.  You are correct.


>> Signed-off-by: David Daney<david.daney@cavium.com>
>> ---
>>
>> 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.
>

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

>>   mm/pgtable-generic.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
>> index eb663fb..73784c8 100644
>> --- a/mm/pgtable-generic.c
>> +++ b/mm/pgtable-generic.c
>> @@ -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);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young()
  2011-12-19 19:52     ` David Daney
@ 2011-12-19 20:34       ` David Rientjes
  0 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2011-12-19 20:34 UTC (permalink / raw)
  To: David Daney
  Cc: Andrew Morton, Stephen Rothwell, Paul Mundt, linux-kernel, David Daney

On Mon, 19 Dec 2011, David Daney wrote:

> > 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.
> 

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.

> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-19 20:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-17  4:22 linux-next: build failure after merge of the final tree Stephen Rothwell
2011-12-17  4:27 ` Stephen Rothwell
2011-12-19 17:38 ` [PATCH] mm: Fix BUILD_BUG assertion in pmdp_clear_flush_young() David Daney
2011-12-19 19:29   ` David Rientjes
2011-12-19 19:52     ` David Daney
2011-12-19 20:34       ` David Rientjes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.