Skip to content

Commit 6f6aea7

Browse files
rppttorvalds
authored andcommitted
parisc: fix PMD pages allocation by restoring pmd_alloc_one()
Commit 1355c31 ("asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()") converted parisc to use generic version of pmd_alloc_one() but it missed the fact that parisc uses order-1 pages for PMD. Restore the original version of pmd_alloc_one() for parisc, just use GFP_PGTABLE_KERNEL that implies __GFP_ZERO instead of GFP_KERNEL and memset. Fixes: 1355c31 ("asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()") Reported-by: Meelis Roos <[email protected]> Signed-off-by: Mike Rapoport <[email protected]> Tested-by: Meelis Roos <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4b6c093 commit 6f6aea7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/parisc/include/asm/pgalloc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <asm/cache.h>
1212

13+
#define __HAVE_ARCH_PMD_ALLOC_ONE
1314
#define __HAVE_ARCH_PMD_FREE
1415
#define __HAVE_ARCH_PGD_FREE
1516
#include <asm-generic/pgalloc.h>
@@ -67,6 +68,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
6768
(__u32)(__pa((unsigned long)pmd) >> PxD_VALUE_SHIFT)));
6869
}
6970

71+
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
72+
{
73+
return (pmd_t *)__get_free_pages(GFP_PGTABLE_KERNEL, PMD_ORDER);
74+
}
75+
7076
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
7177
{
7278
if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED) {

0 commit comments

Comments
 (0)