From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with SMTP id B82656B0044 for ; Wed, 28 Jan 2009 18:04:39 -0500 (EST) Received: by fg-out-1718.google.com with SMTP id 13so734545fge.4 for ; Wed, 28 Jan 2009 15:04:37 -0800 (PST) From: Andrea Righi Subject: [PATCH -mmotm] mm: unify some pmd_*() functions fix Date: Thu, 29 Jan 2009 00:04:34 +0100 Message-Id: <1233183874-26066-1-git-send-email-righi.andrea@gmail.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Roman Zippel , David Howells , Hirokazu Takata , Andrea Righi List-ID: Also unify implementations of pmd_*() functions in arch/*. This patch must be applied on top of mm-unify-some-pmd_-functions.patch. Signed-off-by: Andrea Righi --- arch/alpha/include/asm/pgalloc.h | 2 ++ arch/arm/include/asm/pgalloc.h | 3 +-- arch/ia64/include/asm/pgalloc.h | 2 ++ arch/mips/include/asm/pgalloc.h | 13 ++----------- arch/parisc/include/asm/pgalloc.h | 5 +++-- arch/powerpc/include/asm/pgalloc-32.h | 9 --------- arch/powerpc/include/asm/pgalloc-64.h | 2 ++ arch/s390/include/asm/pgalloc.h | 3 +-- arch/sh/include/asm/pgalloc.h | 8 -------- arch/sparc/include/asm/pgalloc_64.h | 2 ++ arch/um/include/asm/pgalloc.h | 1 + arch/um/include/asm/pgtable-3level.h | 1 + arch/x86/include/asm/pgalloc.h | 3 +++ 13 files changed, 20 insertions(+), 34 deletions(-) diff --git a/arch/alpha/include/asm/pgalloc.h b/arch/alpha/include/asm/pgalloc.h index fd09015..b372295 100644 --- a/arch/alpha/include/asm/pgalloc.h +++ b/arch/alpha/include/asm/pgalloc.h @@ -43,12 +43,14 @@ pmd_alloc_one(struct mm_struct *mm, unsigned long address) pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); return ret; } +#define pmd_alloc_one pmd_alloc_one static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) { free_page((unsigned long)pmd); } +#define pmd_free pmd_free extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h index 3dcd64b..2f241c8 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h @@ -26,8 +26,7 @@ /* * Since we have only two-level page tables, these are trivial */ -#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) -#define pmd_free(mm, pmd) do { } while (0) +#define pmd_alloc_one pmd_alloc_one_bug #define pgd_populate(mm,pmd,pte) BUG() extern pgd_t *get_pgd_slow(struct mm_struct *mm); diff --git a/arch/ia64/include/asm/pgalloc.h b/arch/ia64/include/asm/pgalloc.h index b9ac1a6..660b128 100644 --- a/arch/ia64/include/asm/pgalloc.h +++ b/arch/ia64/include/asm/pgalloc.h @@ -61,11 +61,13 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) { return quicklist_alloc(0, GFP_KERNEL, NULL); } +#define pmd_alloc_one pmd_alloc_one static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) { quicklist_free(0, NULL, pmd); } +#define pmd_free pmd_free #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h index 1275831..139b127 100644 --- a/arch/mips/include/asm/pgalloc.h +++ b/arch/mips/include/asm/pgalloc.h @@ -104,17 +104,6 @@ do { \ tlb_remove_page((tlb), pte); \ } while (0) -#ifdef CONFIG_32BIT - -/* - * allocating and freeing a pmd is trivial: the 1-entry pmd is - * inside the pgd, so has no extra memory associated with it. - */ -#define pmd_free(mm, x) do { } while (0) -#define __pmd_free_tlb(tlb, x) do { } while (0) - -#endif - #ifdef CONFIG_64BIT static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) @@ -126,11 +115,13 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); return pmd; } +#define pmd_alloc_one pmd_alloc_one static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) { free_pages((unsigned long)pmd, PMD_ORDER); } +#define pmd_free pmd_free #define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x) diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h index fc987a1..dbb8bc2 100644 --- a/arch/parisc/include/asm/pgalloc.h +++ b/arch/parisc/include/asm/pgalloc.h @@ -69,6 +69,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) memset(pmd, 0, PAGE_SIZE< email@kvack.org