

Convert all pmd_alloc_one() implementations to use __GFP_REPEAT


 /dev/null                       |    0 
 arch/sparc/mm/sun4c.c           |    2 +-
 include/asm-alpha/pgalloc.h     |    2 +-
 include/asm-ia64/pgalloc.h      |    2 +-
 include/asm-m68k/sun3_pgalloc.h |    2 +-
 include/asm-mips64/pgalloc.h    |    2 +-
 include/asm-parisc/pgalloc.h    |    2 +-
 include/asm-ppc64/pgalloc.h     |   14 +++-----------
 include/asm-sparc64/pgalloc.h   |    2 +-
 include/asm-x86_64/pgalloc.h    |    4 ++--
 10 files changed, 12 insertions(+), 20 deletions(-)

diff -puN arch/sparc/mm/sun4c.c~pmd_alloc_one-use-gfp_repeat arch/sparc/mm/sun4c.c
--- 25/arch/sparc/mm/sun4c.c~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/arch/sparc/mm/sun4c.c	2003-04-14 19:11:43.000000000 -0700
@@ -2194,7 +2194,7 @@ void __init ld_mmu_sun4c(void)
 	BTFIXUPSET_CALL(pte_alloc_one_kernel, sun4c_pte_alloc_one_kernel, BTFIXUPCALL_NORM);
 	BTFIXUPSET_CALL(pte_alloc_one, sun4c_pte_alloc_one, BTFIXUPCALL_NORM);
 	BTFIXUPSET_CALL(free_pmd_fast, sun4c_free_pmd_fast, BTFIXUPCALL_NOP);
-	BTFIXUPSET_CALL(pmd_alloc_one, sun4c_pmd_alloc_one, BTFIXUPCALL_RETO0);
+	BTFIXUPSET_CALL(pmd_alloc_one, sun4c_lpmd_alloc_one, BTFIXUPCALL_RETO0);
 	BTFIXUPSET_CALL(free_pgd_fast, sun4c_free_pgd_fast, BTFIXUPCALL_NORM);
 	BTFIXUPSET_CALL(get_pgd_fast, sun4c_get_pgd_fast, BTFIXUPCALL_NORM);
 
diff -puN include/asm-alpha/pgalloc.h~pmd_alloc_one-use-gfp_repeat include/asm-alpha/pgalloc.h
--- 25/include/asm-alpha/pgalloc.h~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/include/asm-alpha/pgalloc.h	2003-04-14 19:11:43.000000000 -0700
@@ -40,7 +40,7 @@ pgd_free(pgd_t *pgd)
 static inline pmd_t *
 pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL);
+	pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (ret)
 		clear_page(ret);
 	return ret;
diff -puN include/asm-ia64/pgalloc.h~pmd_alloc_one-use-gfp_repeat include/asm-ia64/pgalloc.h
--- 25/include/asm-ia64/pgalloc.h~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/include/asm-ia64/pgalloc.h	2003-04-14 19:11:43.000000000 -0700
@@ -93,7 +93,7 @@ pmd_alloc_one_fast (struct mm_struct *mm
 static inline pmd_t*
 pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
 {
-	pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);
+	pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 
 	if (likely(pmd != NULL))
 		clear_page(pmd);
diff -puN include/asm-m68k/sun3_pgalloc.h~pmd_alloc_one-use-gfp_repeat include/asm-m68k/sun3_pgalloc.h
--- 25/include/asm-m68k/sun3_pgalloc.h~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/include/asm-m68k/sun3_pgalloc.h	2003-04-14 19:11:43.000000000 -0700
@@ -18,7 +18,7 @@
 
 extern const char bad_pmd_string[];
 
-#define pmd_alloc_one(mm,address)       ({ BUG(); ((pmd_t *)2); })
+#define lpmd_alloc_one(mm,address)       ({ BUG(); ((pmd_t *)2); })
 
 
 static inline void pte_free_kernel(pte_t * pte)
diff -puN include/asm-mips64/pgalloc.h~pmd_alloc_one-use-gfp_repeat include/asm-mips64/pgalloc.h
--- 25/include/asm-mips64/pgalloc.h~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/include/asm-mips64/pgalloc.h	2003-04-14 19:11:43.000000000 -0700
@@ -141,7 +141,7 @@ static inline pmd_t *pmd_alloc_one(struc
 {
 	pmd_t *pmd;
 
-	pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, 1);
+	pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT, 1);
 	if (pmd)
 		pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table);
 	return pmd;
diff -puN include/asm-parisc/pgalloc.h~pmd_alloc_one-use-gfp_repeat include/asm-parisc/pgalloc.h
--- 25/include/asm-parisc/pgalloc.h~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/include/asm-parisc/pgalloc.h	2003-04-14 19:11:43.000000000 -0700
@@ -35,7 +35,7 @@ static inline void pgd_populate(struct m
 
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);
+	pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pmd)
 		clear_page(pmd);
 	return pmd;
diff -puN include/asm-ppc64/pgalloc.h~pmd_alloc_one-use-gfp_repeat include/asm-ppc64/pgalloc.h
--- 25/include/asm-ppc64/pgalloc.h~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/include/asm-ppc64/pgalloc.h	2003-04-14 19:11:43.000000000 -0700
@@ -31,19 +31,11 @@ pgd_free(pgd_t *pgd)
 static inline pmd_t *
 pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
-	int count = 0;
 	pmd_t *pmd;
 
-	do {
-		pmd = (pmd_t *)__get_free_page(GFP_KERNEL);
-		if (pmd)
-			clear_page(pmd);
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pmd && (count++ < 10));
-
+	pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	if (pmd)
+		clear_page(pmd);
 	return pmd;
 }
 
diff -puN -L include/asm-s390x/pgalloc.h /dev/null /dev/null
diff -puN include/asm-sparc64/pgalloc.h~pmd_alloc_one-use-gfp_repeat include/asm-sparc64/pgalloc.h
--- 25/include/asm-sparc64/pgalloc.h~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/include/asm-sparc64/pgalloc.h	2003-04-14 19:11:46.000000000 -0700
@@ -159,7 +159,7 @@ static __inline__ pmd_t *pmd_alloc_one(s
 
 	pmd = pmd_alloc_one_fast(mm, address);
 	if (!pmd) {
-		pmd = (pmd_t *)__get_free_page(GFP_KERNEL);
+		pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 		if (pmd)
 			memset(pmd, 0, PAGE_SIZE);
 	}
diff -puN include/asm-x86_64/pgalloc.h~pmd_alloc_one-use-gfp_repeat include/asm-x86_64/pgalloc.h
--- 25/include/asm-x86_64/pgalloc.h~pmd_alloc_one-use-gfp_repeat	2003-04-14 19:11:43.000000000 -0700
+++ 25-akpm/include/asm-x86_64/pgalloc.h	2003-04-14 19:11:46.000000000 -0700
@@ -31,12 +31,12 @@ extern __inline__ void pmd_free(pmd_t *p
 
 static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
 {
-	return (pmd_t *) get_zeroed_page(GFP_KERNEL); 
+	return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
 }
 
 static inline pgd_t *pgd_alloc (struct mm_struct *mm)
 {
-	return (pgd_t *)get_zeroed_page(GFP_KERNEL);
+	return (pgd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
 }
 
 static inline void pgd_free (pgd_t *pgd)

_
