* [RFC] Calculate exactly how many ptr is needed for pgd
@ 2007-07-31 14:38 Songmao Tian
[not found] ` <5861a7880708012054u404c9b02s7141d1811d4a7fdf@mail.gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Songmao Tian @ 2007-07-31 14:38 UTC (permalink / raw)
To: linux-mips, Ralf Baechle
Under 32-bit kernel with 4k page, a page is needed for a pgd,
but when page size > 4k, a page will be too much.
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 2fbd47e..2a16240 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -67,7 +67,8 @@ extern int add_temporary_entry(unsigned long entrylo0,
unsigned long entrylo1,
#define PTE_ORDER 0
#endif
-#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
+/* Using a page for pgd will be a waste when page size > 4k */
+#define PTRS_PER_PGD (1 << (32 - PGDIR_SHIFT))
#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-02 3:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31 14:38 [RFC] Calculate exactly how many ptr is needed for pgd Songmao Tian
[not found] ` <5861a7880708012054u404c9b02s7141d1811d4a7fdf@mail.gmail.com>
2007-08-02 3:55 ` Fwd: " Dajie Tan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox