linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital
@ 2013-11-21  2:17 Liu Ping Fan
  2013-11-21  2:17 ` [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page Liu Ping Fan
  2014-04-30  5:30 ` [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital Aneesh Kumar K.V
  0 siblings, 2 replies; 6+ messages in thread
From: Liu Ping Fan @ 2013-11-21  2:17 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras

In case of extending the eaddr in future, use this macro
PGTABLE_EADDR_SIZE to ease the maintenance of the code.

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
 arch/powerpc/mm/slb_low.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index 17aa6df..e0b3cf4 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -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 */
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page
  2013-11-21  2:17 [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital Liu Ping Fan
@ 2013-11-21  2:17 ` Liu Ping Fan
  2013-11-21 22:11   ` Paul Mackerras
  2014-04-30  5:30 ` [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital Aneesh Kumar K.V
  1 sibling, 1 reply; 6+ messages in thread
From: Liu Ping Fan @ 2013-11-21  2:17 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras

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.

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/pgtable-ppc64-64k.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/pgtable-ppc64-64k.h b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
index a56b82f..f6955ff 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64-64k.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
@@ -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)
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page
  2013-11-21  2:17 ` [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page Liu Ping Fan
@ 2013-11-21 22:11   ` Paul Mackerras
  2013-11-21 23:46     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Mackerras @ 2013-11-21 22:11 UTC (permalink / raw)
  To: Liu Ping Fan; +Cc: linuxppc-dev

On Thu, Nov 21, 2013 at 10:17:55AM +0800, Liu Ping Fan wrote:
> 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.
> 
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/pgtable-ppc64-64k.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/pgtable-ppc64-64k.h b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
> index a56b82f..f6955ff 100644
> --- a/arch/powerpc/include/asm/pgtable-ppc64-64k.h
> +++ b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
> @@ -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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page
  2013-11-21 22:11   ` Paul Mackerras
@ 2013-11-21 23:46     ` Benjamin Herrenschmidt
  2013-11-22  2:06       ` Michael Ellerman
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2013-11-21 23:46 UTC (permalink / raw)
  To: Liu Ping Fan; +Cc: Paul Mackerras, linuxppc-dev

On Fri, 2013-11-22 at 09:11 +1100, Paul Mackerras wrote:
> On Thu, Nov 21, 2013 at 10:17:55AM +0800, Liu Ping Fan wrote:
> > 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.

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.

> > Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
> > ---
> >  arch/powerpc/include/asm/pgtable-ppc64-64k.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/powerpc/include/asm/pgtable-ppc64-64k.h b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
> > index a56b82f..f6955ff 100644
> > --- a/arch/powerpc/include/asm/pgtable-ppc64-64k.h
> > +++ b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
> > @@ -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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page
  2013-11-21 23:46     ` Benjamin Herrenschmidt
@ 2013-11-22  2:06       ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2013-11-22  2:06 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras, Liu Ping Fan

On Fri, 2013-11-22 at 10:46 +1100, Benjamin Herrenschmidt wrote:
> On Fri, 2013-11-22 at 09:11 +1100, Paul Mackerras wrote:
> > On Thu, Nov 21, 2013 at 10:17:55AM +0800, Liu Ping Fan wrote:
> > > 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.
> 
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital
  2013-11-21  2:17 [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital Liu Ping Fan
  2013-11-21  2:17 ` [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page Liu Ping Fan
@ 2014-04-30  5:30 ` Aneesh Kumar K.V
  1 sibling, 0 replies; 6+ messages in thread
From: Aneesh Kumar K.V @ 2014-04-30  5:30 UTC (permalink / raw)
  To: Liu Ping Fan, linuxppc-dev; +Cc: Paul Mackerras

Liu Ping Fan <kernelfans@gmail.com> writes:

> In case of extending the eaddr in future, use this macro
> PGTABLE_EADDR_SIZE to ease the maintenance of the code.
>
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

> ---
>  arch/powerpc/mm/slb_low.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
> index 17aa6df..e0b3cf4 100644
> --- a/arch/powerpc/mm/slb_low.S
> +++ b/arch/powerpc/mm/slb_low.S
> @@ -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 */
> -- 
> 1.8.1.4
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-30  5:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21  2:17 [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital Liu Ping Fan
2013-11-21  2:17 ` [PATCH 2/2] powerpc: mm: change pgtable index size for 64K page Liu Ping Fan
2013-11-21 22:11   ` Paul Mackerras
2013-11-21 23:46     ` Benjamin Herrenschmidt
2013-11-22  2:06       ` Michael Ellerman
2014-04-30  5:30 ` [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).