linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm/hash: Increase vmalloc space with hash translation mode
@ 2019-02-13 11:15 Aneesh Kumar K.V
  2019-02-22  9:47 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Aneesh Kumar K.V @ 2019-02-13 11:15 UTC (permalink / raw)
  To: npiggin, benh, paulus, mpe; +Cc: Aneesh Kumar K . V, linuxppc-dev

From: Michael Ellerman <mpe@ellerman.id.au>

This patch updates the kernel none linear virtual map area size to 512TB
with 64K page size and hash translation mode. We allocate one context
for the vmalloc region and hence the max virtual area size is limited
by the context map size (512TB for 64K and 64TB for 4K page size).

This patch fixes boot failures with large amounts of system RAM where we
need large vmalloc space to handle per cpu allocation.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 arch/powerpc/include/asm/book3s/64/hash.h  | 30 +++++++++++++++-------
 arch/powerpc/include/asm/book3s/64/radix.h |  5 +---
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
index 247aff9cc6ba..0a7b7d5bfa86 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -40,22 +40,34 @@
 #else
 #define H_PUD_CACHE_INDEX	(H_PUD_INDEX_SIZE)
 #endif
+
 /*
- * Define the address range of the kernel non-linear virtual area
+ * Define the address range of the kernel non-linear virtual area. In contrast
+ * to the linear mapping, this is managed using the kernel page tables and then
+ * inserted into the hash page table to actually take effect, similarly to user
+ * mappings.
  */
 #define H_KERN_VIRT_START ASM_CONST(0xD000000000000000)
-#define H_KERN_VIRT_SIZE  ASM_CONST(0x0000400000000000) /* 64T */
+/*
+ * Allow virtual mapping of one context size.
+ * 512TB for 64K page size
+ * 64TB for 4K page size
+ */
+#define H_KERN_VIRT_SIZE (1UL << MAX_EA_BITS_PER_CONTEXT)
+/*
+ * 8TB IO mapping size
+ */
+#define H_KERN_IO_SIZE ASM_CONST(0x80000000000) /* 8T */
 
 /*
- * The vmalloc space starts at the beginning of that region, and
- * occupies half of it on hash CPUs and a quarter of it on Book3E
- * (we keep a quarter for the virtual memmap)
+ * The vmalloc space starts at the beginning of the kernel non-linear virtual
+ * region, and occupies 504T (64K) or 56T (4K)
  */
-#define H_VMALLOC_START	H_KERN_VIRT_START
-#define H_VMALLOC_SIZE	ASM_CONST(0x380000000000) /* 56T */
-#define H_VMALLOC_END	(H_VMALLOC_START + H_VMALLOC_SIZE)
+#define H_VMALLOC_START H_KERN_VIRT_START
+#define H_VMALLOC_SIZE (H_KERN_VIRT_SIZE - H_KERN_IO_SIZE)
+#define H_VMALLOC_END (H_VMALLOC_START + H_VMALLOC_SIZE)
 
-#define H_KERN_IO_START	H_VMALLOC_END
+#define H_KERN_IO_START H_VMALLOC_END
 
 /*
  * Region IDs
diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h
index 7d1a3d1543fc..c7a0feaa1013 100644
--- a/arch/powerpc/include/asm/book3s/64/radix.h
+++ b/arch/powerpc/include/asm/book3s/64/radix.h
@@ -104,10 +104,7 @@
 #define RADIX_VMALLOC_START	RADIX_KERN_VIRT_START
 #define RADIX_VMALLOC_SIZE	(RADIX_KERN_VIRT_SIZE >> 2)
 #define RADIX_VMALLOC_END	(RADIX_VMALLOC_START + RADIX_VMALLOC_SIZE)
-/*
- * Defines the address of the vmemap area, in its own region on
- * hash table CPUs.
- */
+
 #define RADIX_VMEMMAP_BASE		(RADIX_VMALLOC_END)
 
 #define RADIX_KERN_IO_START	(RADIX_KERN_VIRT_START + (RADIX_KERN_VIRT_SIZE >> 1))
-- 
2.20.1


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

* Re: powerpc/mm/hash: Increase vmalloc space with hash translation mode
  2019-02-13 11:15 [PATCH] powerpc/mm/hash: Increase vmalloc space with hash translation mode Aneesh Kumar K.V
@ 2019-02-22  9:47 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2019-02-22  9:47 UTC (permalink / raw)
  To: Aneesh Kumar K.V, npiggin, benh, paulus; +Cc: Aneesh Kumar K . V, linuxppc-dev

On Wed, 2019-02-13 at 11:15:09 UTC, "Aneesh Kumar K.V" wrote:
> From: Michael Ellerman <mpe@ellerman.id.au>
> 
> This patch updates the kernel none linear virtual map area size to 512TB
> with 64K page size and hash translation mode. We allocate one context
> for the vmalloc region and hence the max virtual area size is limited
> by the context map size (512TB for 64K and 64TB for 4K page size).
> 
> This patch fixes boot failures with large amounts of system RAM where we
> need large vmalloc space to handle per cpu allocation.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/3d8810e02b7f811be3bc9ad2f433be4e

cheers

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

end of thread, other threads:[~2019-02-22 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-13 11:15 [PATCH] powerpc/mm/hash: Increase vmalloc space with hash translation mode Aneesh Kumar K.V
2019-02-22  9:47 ` Michael Ellerman

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).