Re: ia64 broken by transparent huge pages - other arches too?

Andrea Arcangeli
2011-01-14T18:31:13Z

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

On Fri, Jan 14, 2011 at 09:50:45AM -0800, Luck, Tony wrote:
> In file included from /home/aegl/generic-smp/arch/ia64/include/asm/pgtable.h:611,
> from include/linux/mm.h:41,
> from /home/aegl/generic-smp/arch/ia64/include/asm/uaccess.h:39,
> from include/linux/poll.h:14,
> from include/linux/rtc.h:117,
> from include/linux/efi.h:19,
> from /home/aegl/generic-smp/arch/ia64/include/asm/sal.h:40,
> from /home/aegl/generic-smp/arch/ia64/include/asm/mca.h:20,
> from arch/ia64/kernel/asm-offsets.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 in return
> make[1]: *** [arch/ia64/kernel/asm-offsets.s] Error 1
>
>
> Looks like arch/*/include/pgtable.h needs to define __pmd() but only x86
> was blessed with it.

So I fixed powerpc build and sparc but broke ia64 with this change
sorry, hard to make all archs build consistent. See the attached mails.

Would you be willing to implement __pmd for ia64 to fix this? Can you
check if this works?

Thanks a lot,
Andrea

========
Subject: fix ia64 build failure in pmdp_get_and_clear

From: Andrea Arcangeli <aarcange@redhat.com>

Implement __pmd macro for ia64 too.

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

diff --git a/arch/ia64/include/asm/page.h b/arch/ia64/include/asm/page.h
index 41b6d31..961a16f 100644
--- a/arch/ia64/include/asm/page.h
+++ b/arch/ia64/include/asm/page.h
@@ -189,6 +189,7 @@ get_order (unsigned long size)
# define pgprot_val(x) ((x).pgprot)

# define __pte(x) ((pte_t) { (x) } )
+# define __pmd(x) ((pmd_t) { (x) } )
# define __pgprot(x) ((pgprot_t) { (x) } )

#else /* !STRICT_MM_TYPECHECKS */

[-- Attachment #2: Type: message/rfc822, Size: 1212 bytes --]

From: Andrea Arcangeli <aarcange@redhat.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH -mm] fix powerpc/sparc build
Date: Mon, 10 Jan 2011 19:04:25 +0100
Message-ID: <20110110180425.GK9506@random.random>

This would become
thp-add-pmd-mangling-generic-functions-fix-pgtableh-build-for-um-2.patch

=====
Subject: thp: build fix for pmdp_get_and_clear

From: Andrea Arcangeli <aarcange@redhat.com>

__pmd should return a valid pmd_t for every arch.

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

diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -93,7 +93,7 @@ static inline pmd_t pmdp_get_and_clear(s
pmd_t *pmdp)
{
BUG();
- return (pmd_t){ 0 };
+ return __pmd(0);
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
#endif

[-- Attachment #3: Type: message/rfc822, Size: 5024 bytes --]

[-- Attachment #3.1.1: Type: text/plain, Size: 1458 bytes --]

Hi Andrew,

On Thu, 06 Jan 2011 15:41:14 -0800 akpm@linux-foundation.org wrote:
>
> The mm-of-the-moment snapshot 2011-01-06-15-41 has been uploaded to
>
> http://userweb.kernel.org/~akpm/mmotm/

Build results here: http://kisskb.ellerman.id.au/kisskb/head/3605/

Notably:

powerpc pmac32_defconfig:

In file included from arch/powerpc/include/asm/pgtable.h:200,
from include/linux/mm.h:41,
from include/linux/mman.h:14,
from arch/powerpc/kernel/asm-offsets.c:22:
include/asm-generic/pgtable.h: In function 'pmdp_get_and_clear':
include/asm-generic/pgtable.h:96: warning: missing braces around initializer
include/asm-generic/pgtable.h:96: warning: (near initialization for '(anonymous).pud')

sparc defconfig:

In file included from arch/sparc/include/asm/pgtable_32.h:456,
from arch/sparc/include/asm/pgtable.h:7,
from include/linux/mm.h:42,
from arch/sparc/kernel/sys_sparc_32.c:12:
include/asm-generic/pgtable.h: In function 'pmdp_get_and_clear':
include/asm-generic/pgtable.h:96: error: missing braces around initializer
include/asm-generic/pgtable.h:96: error: (near initialization for '(anonymous).pmdv')

Probably a side effect of
thp-add-pmd-mangling-generic-functions-fix-pgtableh-build-for-um.patch.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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