[RFC] powerpc/mm/radix: Update pte fragment count from 16 to 256 on radix

Message ID 20180212084911.14841-1-aneesh.kumar@linux.vnet.ibm.com
State New
Headers show
Series
  • [RFC] powerpc/mm/radix: Update pte fragment count from 16 to 256 on radix
Related show

Commit Message

Aneesh Kumar K.V Feb. 12, 2018, 8:49 a.m.
This needs more performance test. But right now we are wasting lot of space
in the level 4 page table.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/book3s/64/hash-64k.h  | 9 ++++-----
 arch/powerpc/include/asm/book3s/64/radix-64k.h | 8 ++++++++
 2 files changed, 12 insertions(+), 5 deletions(-)

Comments

Aneesh Kumar K.V Feb. 12, 2018, 8:52 a.m. | #1
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> writes:

> This needs more performance test. But right now we are wasting lot of space
> in the level 4 page table.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/book3s/64/hash-64k.h  | 9 ++++-----
>  arch/powerpc/include/asm/book3s/64/radix-64k.h | 8 ++++++++
>  2 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h b/arch/powerpc/include/asm/book3s/64/hash-64k.h
> index 3bcf269f8f55..688f9018302e 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash-64k.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash-64k.h
> @@ -24,16 +24,15 @@
>
>  /* PTE flags to conserve for HPTE identification */
>  #define _PAGE_HPTEFLAGS (H_PAGE_BUSY | H_PAGE_HASHPTE | H_PAGE_COMBO)
> -/*
> - * we support 16 fragments per PTE page of 64K size.
> - */
> -#define H_PTE_FRAG_NR	16
>  /*
>   * We use a 2K PTE page fragment and another 2K for storing
>   * real_pte_t hash index
>   */
>  #define H_PTE_FRAG_SIZE_SHIFT  12
> -#define PTE_FRAG_SIZE (1UL << PTE_FRAG_SIZE_SHIFT)
> +/*
> + * we support 16 fragments per PTE page of 64K size.
> + */
> +#define H_PTE_FRAG_NR	(PAGE_SIZE >> RADIX_PTE_FRAG_SIZE_SHIFT)
>
>  #ifndef __ASSEMBLY__
>  #include <asm/errno.h>
> diff --git a/arch/powerpc/include/asm/book3s/64/radix-64k.h b/arch/powerpc/include/asm/book3s/64/radix-64k.h
> index c7e71ba29555..8029732bb6c4 100644
> --- a/arch/powerpc/include/asm/book3s/64/radix-64k.h
> +++ b/arch/powerpc/include/asm/book3s/64/radix-64k.h
> @@ -10,4 +10,12 @@
>  #define RADIX_PUD_INDEX_SIZE	 9
>  #define RADIX_PGD_INDEX_SIZE  13
>
> +/*
> + * We use a 256 byte PTE page fragment in radix
> + */
> +#define RADIX_PTE_FRAG_SIZE_SHIFT  8
> +/*
> + * we support 16 fragments per PTE page of 64K size.
> + */
> +#define RADIX_PTE_FRAG_NR	(PAGE_SIZE >> RADIX_PTE_FRAG_SIZE_SHIFT)
>  #endif /* _ASM_POWERPC_PGTABLE_RADIX_64K_H */


missed git refresh

diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 27d096610369..404cdd74bc9c 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -561,8 +561,8 @@ void __init radix__early_init_mmu(void)
 	/*
 	 * For now radix also use the same frag size
 	 */
-	__pte_frag_nr = H_PTE_FRAG_NR;
-	__pte_frag_size_shift = H_PTE_FRAG_SIZE_SHIFT;
+	__pte_frag_nr = RADIX_PTE_FRAG_NR;
+	__pte_frag_size_shift = RADIX_PTE_FRAG_SIZE_SHIFT;
 
 	if (!firmware_has_feature(FW_FEATURE_LPAR)) {
 		radix_init_native();

Patch

diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h b/arch/powerpc/include/asm/book3s/64/hash-64k.h
index 3bcf269f8f55..688f9018302e 100644
--- a/arch/powerpc/include/asm/book3s/64/hash-64k.h
+++ b/arch/powerpc/include/asm/book3s/64/hash-64k.h
@@ -24,16 +24,15 @@ 
 
 /* PTE flags to conserve for HPTE identification */
 #define _PAGE_HPTEFLAGS (H_PAGE_BUSY | H_PAGE_HASHPTE | H_PAGE_COMBO)
-/*
- * we support 16 fragments per PTE page of 64K size.
- */
-#define H_PTE_FRAG_NR	16
 /*
  * We use a 2K PTE page fragment and another 2K for storing
  * real_pte_t hash index
  */
 #define H_PTE_FRAG_SIZE_SHIFT  12
-#define PTE_FRAG_SIZE (1UL << PTE_FRAG_SIZE_SHIFT)
+/*
+ * we support 16 fragments per PTE page of 64K size.
+ */
+#define H_PTE_FRAG_NR	(PAGE_SIZE >> RADIX_PTE_FRAG_SIZE_SHIFT)
 
 #ifndef __ASSEMBLY__
 #include <asm/errno.h>
diff --git a/arch/powerpc/include/asm/book3s/64/radix-64k.h b/arch/powerpc/include/asm/book3s/64/radix-64k.h
index c7e71ba29555..8029732bb6c4 100644
--- a/arch/powerpc/include/asm/book3s/64/radix-64k.h
+++ b/arch/powerpc/include/asm/book3s/64/radix-64k.h
@@ -10,4 +10,12 @@ 
 #define RADIX_PUD_INDEX_SIZE	 9
 #define RADIX_PGD_INDEX_SIZE  13
 
+/*
+ * We use a 256 byte PTE page fragment in radix
+ */
+#define RADIX_PTE_FRAG_SIZE_SHIFT  8
+/*
+ * we support 16 fragments per PTE page of 64K size.
+ */
+#define RADIX_PTE_FRAG_NR	(PAGE_SIZE >> RADIX_PTE_FRAG_SIZE_SHIFT)
 #endif /* _ASM_POWERPC_PGTABLE_RADIX_64K_H */