Commit 36f6aa1b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] use __GFP_REPEAT in pmd_alloc_one()

Convert all pmd_alloc_one() implementations to use __GFP_REPEAT
parent 68b5a30f
......@@ -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);
......
......@@ -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;
......
......@@ -93,7 +93,7 @@ pmd_alloc_one_fast (struct mm_struct *mm, unsigned long addr)
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);
......
......@@ -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)
......
......@@ -141,7 +141,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
{
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;
......
......@@ -35,7 +35,7 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
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;
......
......@@ -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);
pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
if (pmd)
clear_page(pmd);
else {
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ);
}
} while (!pmd && (count++ < 10));
return pmd;
}
......
......@@ -159,7 +159,7 @@ static __inline__ pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addre
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);
}
......
......@@ -31,12 +31,12 @@ extern __inline__ void pmd_free(pmd_t *pmd)
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment