linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the final tree
@ 2011-01-15  2:10 Stephen Rothwell
  2011-01-15  4:27 ` Andrea Arcangeli
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2011-01-15  2:10 UTC (permalink / raw)
  To: Andrea Arcangeli
  Cc: linux-next, linux-kernel, Andrew Morton, Linus Torvalds, David S. Miller

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

Hi all,

After merging the final tree, today's linux-next build (sparc32 defconfig)
failed like this:

In file included from arch/sparc/include/asm/pgtable_32.h:455,
                 from arch/sparc/include/asm/pgtable.h:6,
                 from include/linux/mm.h:41,
                 from arch/sparc/kernel/process_32.c:17:
include/asm-generic/pgtable.h: In function 'pmdp_get_and_clear':
include/asm-generic/pgtable.h:96: error: implicit declaration of function '__pmd'
include/asm-generic/pgtable.h:96: error: incompatible types when returning type 'int' but 'pmd_t' was expected

and *lots* more.

Caused by commit e2cda322648122dc400c85ada80eaddbc612ef6a ("thp: add pmd
mangling generic functions").  This has already been reported broken in
other architectures as well.

I have just left it for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

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

* Re: linux-next: build failure after merge of the final tree
  2011-01-15  2:10 linux-next: build failure after merge of the final tree Stephen Rothwell
@ 2011-01-15  4:27 ` Andrea Arcangeli
  2011-01-15 16:20   ` sparc32 build failure [Was: linux-next: build failure after merge of the final tree] Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea Arcangeli @ 2011-01-15  4:27 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, Andrew Morton, Linus Torvalds, David S. Miller

Hello,

On Sat, Jan 15, 2011 at 01:10:27PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the final tree, today's linux-next build (sparc32 defconfig)
> failed like this:
> 
> In file included from arch/sparc/include/asm/pgtable_32.h:455,
>                  from arch/sparc/include/asm/pgtable.h:6,
>                  from include/linux/mm.h:41,
>                  from arch/sparc/kernel/process_32.c:17:
> include/asm-generic/pgtable.h: In function 'pmdp_get_and_clear':
> include/asm-generic/pgtable.h:96: error: implicit declaration of function '__pmd'
> include/asm-generic/pgtable.h:96: error: incompatible types when returning type 'int' but 'pmd_t' was expected
> 
> and *lots* more.
> 
> Caused by commit e2cda322648122dc400c85ada80eaddbc612ef6a ("thp: add pmd
> mangling generic functions").  This has already been reported broken in
> other architectures as well.
> 
> I have just left it for today.

See arch/sparc/include/asm/page_32.h

/* #define __pmd(x)        ((pmd_t) { (x) } ) */ /* XXX procedure with loop */
/* #define __pmd(x)        (x) */ /* XXX later */


Not sure why __pmd is commented out on sparc32 (it isn't in sparc64,
this is why sparc looked like building ok in a earlier report).

Removing those two comments at first glance should fix the build, but
I don't understand the comment, so I'm unsure if it's safe and what
"XXX later" means. Overall this __pmd(0) thing is just a fake.  We've
to return some dummy pmd_t structure to build, because the function
returns a pmd_t, there's a BUG() before __pmd is evaluated, but I
didn't think of a better way yet than to return __pmd(0).

static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
       	      	    			             unsigned long
       	      	    			             address,
						     pmd_t *pmdp)
{
	BUG();
	return __pmd(0);
}

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

* sparc32 build failure [Was: linux-next: build failure after merge of the final tree]
  2011-01-15  4:27 ` Andrea Arcangeli
@ 2011-01-15 16:20   ` Sam Ravnborg
  2011-01-15 18:26     ` Andrea Arcangeli
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2011-01-15 16:20 UTC (permalink / raw)
  To: Andrea Arcangeli
  Cc: Stephen Rothwell, linux-next, linux-kernel, Andrew Morton,
	Linus Torvalds, David S. Miller, sparclinux

On Sat, Jan 15, 2011 at 05:27:53AM +0100, Andrea Arcangeli wrote:
> Hello,
> 
> On Sat, Jan 15, 2011 at 01:10:27PM +1100, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the final tree, today's linux-next build (sparc32 defconfig)
> > failed like this:
> > 
> > In file included from arch/sparc/include/asm/pgtable_32.h:455,
> >                  from arch/sparc/include/asm/pgtable.h:6,
> >                  from include/linux/mm.h:41,
> >                  from arch/sparc/kernel/process_32.c:17:
> > include/asm-generic/pgtable.h: In function 'pmdp_get_and_clear':
> > include/asm-generic/pgtable.h:96: error: implicit declaration of function '__pmd'
> > include/asm-generic/pgtable.h:96: error: incompatible types when returning type 'int' but 'pmd_t' was expected
> > 
> > and *lots* more.
> > 
> > Caused by commit e2cda322648122dc400c85ada80eaddbc612ef6a ("thp: add pmd
> > mangling generic functions").  This has already been reported broken in
> > other architectures as well.
> > 
> > I have just left it for today.
> 
> See arch/sparc/include/asm/page_32.h
> 
> /* #define __pmd(x)        ((pmd_t) { (x) } ) */ /* XXX procedure with loop */
> /* #define __pmd(x)        (x) */ /* XXX later */
> 
> 
> Not sure why __pmd is commented out on sparc32 (it isn't in sparc64,
> this is why sparc looked like building ok in a earlier report).
> 
> Removing those two comments at first glance should fix the build, but
> I don't understand the comment, so I'm unsure if it's safe and what
> "XXX later" means. Overall this __pmd(0) thing is just a fake.  We've
> to return some dummy pmd_t structure to build, because the function
> returns a pmd_t, there's a BUG() before __pmd is evaluated, but I
> didn't think of a better way yet than to return __pmd(0).
> 
> static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
>        	      	    			             unsigned long
>        	      	    			             address,
> 						     pmd_t *pmdp)
> {
> 	BUG();
> 	return __pmd(0);
> }

Hi Andrea.

Can we get the build fixed ASAP or do we wait for David to comment on this?

	Sam

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

* Re: sparc32 build failure [Was: linux-next: build failure after merge of the final tree]
  2011-01-15 16:20   ` sparc32 build failure [Was: linux-next: build failure after merge of the final tree] Sam Ravnborg
@ 2011-01-15 18:26     ` Andrea Arcangeli
  0 siblings, 0 replies; 4+ messages in thread
From: Andrea Arcangeli @ 2011-01-15 18:26 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Stephen Rothwell, linux-next, linux-kernel, Andrew Morton,
	Linus Torvalds, David S. Miller, sparclinux,
	Benjamin Herrenschmidt, Luck, Tony, linux-arch, James Bottomley

Hello everyone,

On Sat, Jan 15, 2011 at 05:20:20PM +0100, Sam Ravnborg wrote:
> Can we get the build fixed ASAP or do we wait for David to comment on this?

I think sparc32 problem is pmd is an array. So now I built a sparc64
compiler and built with ARCH=sparc32.

$ file vmlinux
vmlinux: ELF 32-bit MSB relocatable, SPARC, version 1 (SYSV), not stripped

I got it to build (the zImage won't build on my environment for some
assembly issue in arch/sparc/boot/btfix.S but that shall not be
related to this, all it matters is the final linking of vmlinux is
successful).

So to fix this once and for all, please apply this below patch. If
this works no change to any arch is required (ia64 could also revert
the __pmd definition if they prefer, not that it makes any relevant
difference for ia64 other than being more consistent with most other
archs).

Only the arm build fix from James most certainly is still needed in
addition to this.

Sorry again for this build issue.
Andrea

==========
Subject: remove pmdp_get_and_clear/pmdp_clear_flush/pmdp_splitting_flush methods when THP=n

From: Andrea Arcangeli <aarcange@redhat.com>

pmdp_get_and_clear/pmdp_clear_flush/pmdp_splitting_flush were trapped
as BUG() and they were defined only to diminish the risk of build
issues on not-x86 archs and to be consistent with the generic pte
methods previously defined in include/asm-generic/pgtable.h.

But they are causing more trouble than they were supposed to solve, so
it's simpler not to define them when THP is off.

This is also correcting the export of pmdp_splitting_flush which is
currently unused (x86 isn't using the generic implementation in
mm/pgtable-generic.c and no other arch needs that [yet]).

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---

diff --git a/drivers/staging/vme/bridges/Module.symvers b/drivers/staging/vme/bridges/Module.symvers
deleted file mode 100644
index e69de29..0000000
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f1eddf7..31b6188 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -87,14 +87,6 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
 	pmd_clear(mm, address, pmdp);
 	return pmd;
 })
-#else /* CONFIG_TRANSPARENT_HUGEPAGE */
-static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
-				       unsigned long address,
-				       pmd_t *pmdp)
-{
-	BUG();
-	return __pmd(0);
-}
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 #endif
 
@@ -163,9 +155,9 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
 #endif
 
 #ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH
-extern pmd_t pmdp_clear_flush(struct vm_area_struct *vma,
-			      unsigned long address,
-			      pmd_t *pmdp);
+extern pmd_t pmdp_splitting_flush(struct vm_area_struct *vma,
+				  unsigned long address,
+				  pmd_t *pmdp);
 #endif
 
 #ifndef __HAVE_ARCH_PTE_SAME
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index d030548..0369f5b 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -92,32 +92,29 @@ pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
 #endif
 
 #ifndef __HAVE_ARCH_PMDP_CLEAR_FLUSH
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 pmd_t pmdp_clear_flush(struct vm_area_struct *vma, unsigned long address,
 		       pmd_t *pmdp)
 {
 	pmd_t pmd;
-#ifndef CONFIG_TRANSPARENT_HUGEPAGE
-	BUG();
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 	VM_BUG_ON(address & ~HPAGE_PMD_MASK);
 	pmd = pmdp_get_and_clear(vma->vm_mm, address, pmdp);
 	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
 	return pmd;
 }
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 #endif
 
 #ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 pmd_t pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address,
 			   pmd_t *pmdp)
 {
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	pmd_t pmd = pmd_mksplitting(*pmdp);
 	VM_BUG_ON(address & ~HPAGE_PMD_MASK);
 	set_pmd_at(vma->vm_mm, address, pmdp, pmd);
 	/* tlb flush only to serialize against gup-fast */
 	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
-#else /* CONFIG_TRANSPARENT_HUGEPAGE */
-	BUG();
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 }
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 #endif

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

end of thread, other threads:[~2011-01-15 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-15  2:10 linux-next: build failure after merge of the final tree Stephen Rothwell
2011-01-15  4:27 ` Andrea Arcangeli
2011-01-15 16:20   ` sparc32 build failure [Was: linux-next: build failure after merge of the final tree] Sam Ravnborg
2011-01-15 18:26     ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).