linux-mips
[Top] [All Lists]

[PATCH] Fixed the definition of PTRS_PER_PGD

To: ralf@linux-mips.com
Subject: [PATCH] Fixed the definition of PTRS_PER_PGD
From: jack.tan@windriver.com
Date: Tue, 23 Sep 2008 22:52:34 +0800
Cc: linux-mips@linux-mips.org, jack.tan@windriver.com, Dajie Tan <jiankemeng@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
From: Jack Tan <jack.tan@windriver.com>

When we use > 4KB's page size the original definition is not consistent
with PGDIR_SIZE. For exeample, if we use 16KB page size the PGDIR_SHIFT is
(14-2) + 14 = 26, PGDIR_SIZE is 2^26,so the PTRS_PER_PGD should be:

        2^32/2^26 = 2^6

but the original definition of PTRS_PER_PGD is 4096 (PGDIR_ORDER = 0).

So, this definition needs to be consistent with the PGDIR_SIZE.

And the new definition is consistent with the PGD init in pagetable_init().

Signed-off-by: Dajie Tan <jiankemeng@gmail.com>
---
 include/asm-mips/pgtable-32.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 4396e9f..55813d6 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -57,7 +57,7 @@ extern int add_temporary_entry(unsigned long entrylo0, 
unsigned long entrylo1,
 #define PMD_ORDER      1
 #define PTE_ORDER      0
 
-#define PTRS_PER_PGD   ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
+#define PTRS_PER_PGD   (USER_PTRS_PER_PGD * 2)
 #define PTRS_PER_PTE   ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
 
 #define USER_PTRS_PER_PGD      (0x80000000UL/PGDIR_SIZE)
-- 
1.5.5.4


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] Fixed the definition of PTRS_PER_PGD, jack . tan <=