Skip to content

Commit

Permalink
parisc: rename PGD_ORDER to PGD_TABLE_ORDER
Browse files Browse the repository at this point in the history
This is the order of the page table allocation, not the order of a PGD.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: "Matthew Wilcox (Oracle)" <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: Xuerui Wang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
rppt authored and akpm00 committed Jul 18, 2022
1 parent 418d5da commit 4501a7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions arch/parisc/include/asm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
{
pgd_t *pgd;

pgd = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
pgd = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_TABLE_ORDER);
if (unlikely(pgd == NULL))
return NULL;

memset(pgd, 0, PAGE_SIZE << PGD_ORDER);
memset(pgd, 0, PAGE_SIZE << PGD_TABLE_ORDER);

return pgd;
}

static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
free_pages((unsigned long)pgd, PGD_ORDER);
free_pages((unsigned long)pgd, PGD_TABLE_ORDER);
}

#if CONFIG_PGTABLE_LEVELS == 3
Expand Down
8 changes: 4 additions & 4 deletions arch/parisc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ extern void __update_cache(pte_t pte);

#if CONFIG_PGTABLE_LEVELS == 3
#define PMD_TABLE_ORDER 1
#define PGD_ORDER 0
#define PGD_TABLE_ORDER 0
#else
#define PGD_ORDER 1
#define PGD_TABLE_ORDER 1
#endif

/* Definitions for 3rd level (we use PLD here for Page Lower directory
Expand All @@ -144,10 +144,10 @@ extern void __update_cache(pte_t pte);

/* Definitions for 1st level */
#define PGDIR_SHIFT (PLD_SHIFT + BITS_PER_PTE + BITS_PER_PMD)
#if (PGDIR_SHIFT + PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY) > BITS_PER_LONG
#if (PGDIR_SHIFT + PAGE_SHIFT + PGD_TABLE_ORDER - BITS_PER_PGD_ENTRY) > BITS_PER_LONG
#define BITS_PER_PGD (BITS_PER_LONG - PGDIR_SHIFT)
#else
#define BITS_PER_PGD (PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY)
#define BITS_PER_PGD (PAGE_SHIFT + PGD_TABLE_ORDER - BITS_PER_PGD_ENTRY)
#endif
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
#define PGDIR_MASK (~(PGDIR_SIZE-1))
Expand Down

0 comments on commit 4501a7a

Please sign in to comment.