powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital
PATCH 1/2 powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital
In case of extending the eaddr in future, use this macro PGTABLE_EADDR_SIZE to ease the maintenance of the code.
--- arch/powerpc/mm/slb_low.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/slb_low.S +1 -1
@@ -35,7 +35,7 @@ _GLOBAL(slb_allocate_realmode) * check for bad kernel/user address * (ea & ~REGION_MASK) >= PGTABLE_RANGE */ - rldicr. r9,r3,4,(63 - 46 - 4) + rldicr. r9,r3,4,(63 - PGTABLE_EADDR_SIZE - 4) bne- 8f srdi r9,r3,60 /* get region */
Signature · 1 line
1.8.1.4
PATCH 2/2 powerpc: mm: change pgtable index size for 64K page
For 64K page, we waste half of the pte_t page. With this patch, after changing PGD_INDEX_SIZE from 12 to 11, PTE_INDEX_SIZE from 8 to 9, we can improve the usage of pte_t page and shrink the continuous phys size for pgd_t.
--- arch/powerpc/include/asm/pgtable-ppc64-64k.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/pgtable-ppc64-64k.h +2 -2
@@ -4,10 +4,10 @@#include <asm-generic/pgtable-nopud.h> -#define PTE_INDEX_SIZE 8 +#define PTE_INDEX_SIZE 9#define PMD_INDEX_SIZE 10#define PUD_INDEX_SIZE 0 -#define PGD_INDEX_SIZE 12 +#define PGD_INDEX_SIZE 11#ifndef __ASSEMBLY__#define PTE_TABLE_SIZE (sizeof(real_pte_t) << PTE_INDEX_SIZE)
Signature · 1 line
1.8.1.4
Re: [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page
Quoted 15 lines · Liu Ping Fan
For 64K page, we waste half of the
pte_tpage. With this patch, after changingPGD_INDEX_SIZEfrom 12 to 11,PTE_INDEX_SIZEfrom 8 to 9, we can improve the usage ofpte_tpage and shrink the continuous phys size forpgd_t.Signed-off-by Liu Ping Fan <[email protected]>--- arch/powerpc/include/asm/pgtable-ppc64-64k.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/powerpc/include/asm/pgtable-ppc64-64k.h +0
-0
arch/powerpc/include/asm/pgtable-ppc64-64k.h line 10
Quoted 9 lines
arch/powerpc/include/asm/pgtable-ppc64-64k.h +2
-2@@ -4,10 +4,10 @@#include <asm-generic/pgtable-nopud.h> -#define PTE_INDEX_SIZE 8 +#define PTE_INDEX_SIZE 9#define PMD_INDEX_SIZE 10#define PUD_INDEX_SIZE 0 -#define PGD_INDEX_SIZE 12 +#define PGD_INDEX_SIZE 11
Nack. Those definitions are the way they are in order to have the PMD map 16MB, which is our large page size, so that transparent huge pages work.
Paul.
Re: [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page
Quoted 5 lines · Paul Mackerras
Quoted 4 lines · Liu Ping Fan
For 64K page, we waste half of the
pte_tpage. With this patch, after changingPGD_INDEX_SIZEfrom 12 to 11,PTE_INDEX_SIZEfrom 8 to 9, we can improve the usage ofpte_tpage and shrink the continuous phys size forpgd_t.
Also you did you miss that we use the second half to store the per-subpage hash info when using 64k on top of HW 4k ?
Cheers,
Ben.
Quoted 25 lines
Quoted 10 lines
Signed-off-by Liu Ping Fan <[email protected]>--- arch/powerpc/include/asm/pgtable-ppc64-64k.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/powerpc/include/asm/pgtable-ppc64-64k.h +0
-0arch/powerpc/include/asm/pgtable-ppc64-64k.h line 10
Quoted 9 lines
arch/powerpc/include/asm/pgtable-ppc64-64k.h +2
-2@@ -4,10 +4,10 @@#include <asm-generic/pgtable-nopud.h> -#define PTE_INDEX_SIZE 8 +#define PTE_INDEX_SIZE 9#define PMD_INDEX_SIZE 10#define PUD_INDEX_SIZE 0 -#define PGD_INDEX_SIZE 12 +#define PGD_INDEX_SIZE 11Nack. Those definitions are the way they are in order to have the PMD map 16MB, which is our large page size, so that transparent huge pages work.
Paul.
Re: [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 5 lines · Paul Mackerras
Quoted 4 lines · Liu Ping Fan
For 64K page, we waste half of the
pte_tpage. With this patch, after changingPGD_INDEX_SIZEfrom 12 to 11,PTE_INDEX_SIZEfrom 8 to 9, we can improve the usage ofpte_tpage and shrink the continuous phys size forpgd_t.Also you did you miss that we use the second half to store the per-subpage hash info when using 64k on top of HW 4k ?
Given the subtleties perhaps a nice big block comment is in order ? :)
cheers
Quoted 4 lines · Liu Ping Fan
In case of extending the eaddr in future, use this macro
PGTABLE_EADDR_SIZEto ease the maintenance of the code.Signed-off-by Liu Ping Fan <[email protected]>
Quoted 24 lines
--- arch/powerpc/mm/slb_low.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/mm/slb_low.S +1
-1@@ -35,7 +35,7 @@ _GLOBAL(slb_allocate_realmode) * check for bad kernel/user address * (ea & ~REGION_MASK) >= PGTABLE_RANGE */ - rldicr. r9,r3,4,(63 - 46 - 4) + rldicr. r9,r3,4,(63 - PGTABLE_EADDR_SIZE - 4) bne- 8f srdi r9,r3,60 /* get region */Signature · 6 lines
1.8.1.4 _______________________________________________ Linuxppc-dev mailing list [email protected] https://lists.ozlabs.org/listinfo/linuxppc-dev