* [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable
@ 2017-08-01 10:29 Michael Ellerman
2017-08-01 10:29 ` [PATCH 2/3] powerpc/mm/slb: Move comment next to the code it's referring to Michael Ellerman
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Michael Ellerman @ 2017-08-01 10:29 UTC (permalink / raw)
To: linuxppc-dev; +Cc: anton, aneesh.kumar
Currently KERN_IO_START is defined as:
#define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
Although it looks like a constant, both the components are actually
variables, to allow us to have a different value between Radix and
Hash with a single kernel.
However that still requires both Radix and Hash to place the kernel IO
region at the same location relative to the start and end of the
kernel virtual region (namely 1/2 way through it), and we'd like to
change that.
So split KERN_IO_START out into its own variable, and initialise it
for Radix and Hash. In the medium term we should be able to
reconsolidate this, by doing a more involved rearrangement of the
location of the regions.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/book3s/64/hash.h | 2 ++
arch/powerpc/include/asm/book3s/64/pgtable.h | 3 ++-
arch/powerpc/include/asm/book3s/64/radix.h | 2 ++
arch/powerpc/mm/hash_utils_64.c | 1 +
arch/powerpc/mm/pgtable-radix.c | 1 +
arch/powerpc/mm/pgtable_64.c | 2 ++
6 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
index 36fc7bfe9e11..d613653ed5b9 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -51,6 +51,8 @@
#define H_VMALLOC_SIZE (H_KERN_VIRT_SIZE >> 1)
#define H_VMALLOC_END (H_VMALLOC_START + H_VMALLOC_SIZE)
+#define H_KERN_IO_START H_VMALLOC_END
+
/*
* Region IDs
*/
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index d1da415e283c..18a8580d3ddc 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -272,8 +272,10 @@ extern unsigned long __vmalloc_end;
extern unsigned long __kernel_virt_start;
extern unsigned long __kernel_virt_size;
+extern unsigned long __kernel_io_start;
#define KERN_VIRT_START __kernel_virt_start
#define KERN_VIRT_SIZE __kernel_virt_size
+#define KERN_IO_START __kernel_io_start
extern struct page *vmemmap;
extern unsigned long ioremap_bot;
extern unsigned long pci_io_base;
@@ -298,7 +300,6 @@ extern unsigned long pci_io_base;
* PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
* IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
*/
-#define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
#define FULL_IO_SIZE 0x80000000ul
#define ISA_IO_BASE (KERN_IO_START)
#define ISA_IO_END (KERN_IO_START + 0x10000ul)
diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h
index 544440b5aff3..1e5ba94e62ef 100644
--- a/arch/powerpc/include/asm/book3s/64/radix.h
+++ b/arch/powerpc/include/asm/book3s/64/radix.h
@@ -110,6 +110,8 @@
*/
#define RADIX_VMEMMAP_BASE (RADIX_VMALLOC_END)
+#define RADIX_KERN_IO_START (RADIX_KERN_VIRT_START + (RADIX_KERN_VIRT_SIZE >> 1))
+
#ifndef __ASSEMBLY__
#define RADIX_PTE_TABLE_SIZE (sizeof(pte_t) << RADIX_PTE_INDEX_SIZE)
#define RADIX_PMD_TABLE_SIZE (sizeof(pmd_t) << RADIX_PMD_INDEX_SIZE)
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 7419fc1854ad..a93137c358ea 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -1019,6 +1019,7 @@ void __init hash__early_init_mmu(void)
__kernel_virt_size = H_KERN_VIRT_SIZE;
__vmalloc_start = H_VMALLOC_START;
__vmalloc_end = H_VMALLOC_END;
+ __kernel_io_start = H_KERN_IO_START;
vmemmap = (struct page *)H_VMEMMAP_BASE;
ioremap_bot = IOREMAP_BASE;
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 5cc50d47ce3f..d37e68495acc 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -494,6 +494,7 @@ void __init radix__early_init_mmu(void)
__kernel_virt_size = RADIX_KERN_VIRT_SIZE;
__vmalloc_start = RADIX_VMALLOC_START;
__vmalloc_end = RADIX_VMALLOC_END;
+ __kernel_io_start = RADIX_KERN_IO_START;
vmemmap = (struct page *)RADIX_VMEMMAP_BASE;
ioremap_bot = IOREMAP_BASE;
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 0736e94c7615..ac0717a90ca6 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -104,6 +104,8 @@ unsigned long __vmalloc_start;
EXPORT_SYMBOL(__vmalloc_start);
unsigned long __vmalloc_end;
EXPORT_SYMBOL(__vmalloc_end);
+unsigned long __kernel_io_start;
+EXPORT_SYMBOL(__kernel_io_start);
struct page *vmemmap;
EXPORT_SYMBOL(vmemmap);
unsigned long __pte_frag_nr;
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] powerpc/mm/slb: Move comment next to the code it's referring to
2017-08-01 10:29 [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Michael Ellerman
@ 2017-08-01 10:29 ` Michael Ellerman
2017-08-02 8:21 ` Aneesh Kumar K.V
2017-08-01 10:29 ` [PATCH 3/3] powerpc/mm/hash64: Make vmalloc 56T on hash Michael Ellerman
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Michael Ellerman @ 2017-08-01 10:29 UTC (permalink / raw)
To: linuxppc-dev; +Cc: anton, aneesh.kumar
There is a comment in slb_allocate() referring to the load of
paca->vmalloc_sllp, but it's several lines prior in the assembly.
We're about to change this code, and we want to add another comment,
so move the comment immediately prior to the instruction it's talking
about.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/mm/slb_low.S | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index bde378559d01..2eb1b92a68ff 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -121,12 +121,13 @@ slb_miss_kernel_load_vmemmap:
1:
#endif /* CONFIG_SPARSEMEM_VMEMMAP */
- /* vmalloc mapping gets the encoding from the PACA as the mapping
- * can be demoted from 64K -> 4K dynamically on some machines
- */
clrldi r11,r10,48
cmpldi r11,(H_VMALLOC_SIZE >> 28) - 1
bgt 5f
+ /*
+ * vmalloc mapping gets the encoding from the PACA as the mapping
+ * can be demoted from 64K -> 4K dynamically on some machines.
+ */
lhz r11,PACAVMALLOCSLLP(r13)
b 6f
5:
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] powerpc/mm/hash64: Make vmalloc 56T on hash
2017-08-01 10:29 [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Michael Ellerman
2017-08-01 10:29 ` [PATCH 2/3] powerpc/mm/slb: Move comment next to the code it's referring to Michael Ellerman
@ 2017-08-01 10:29 ` Michael Ellerman
2017-08-02 8:19 ` Aneesh Kumar K.V
2017-08-02 8:20 ` [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Aneesh Kumar K.V
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Michael Ellerman @ 2017-08-01 10:29 UTC (permalink / raw)
To: linuxppc-dev; +Cc: anton, aneesh.kumar
On 64-bit book3s, with the hash MMU, we currently define the kernel
virtual space (vmalloc, ioremap etc.), to be 16T in size. This is a
leftover from pre v3.7 when our user VM was also 16T.
Of that 16T we split it 50/50, with half used for PCI IO and ioremap
and the other 8T for vmalloc.
We never bothered to make it any bigger because 8T of vmalloc ought to
be enough for anybody. But it turns out that's not true, the per cpu
allocator wants large amounts of vmalloc space, not to make large
allocations, but to allow a large stride between allocations, because
we use pcpu_embed_first_chunk().
With a bit of juggling we can keep 8T for the IO etc. and make the
vmalloc space 56T. The only complication is the check of the address
in the SLB miss handler, see the comment in the code.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/book3s/64/hash.h | 4 ++--
arch/powerpc/mm/slb_low.S | 18 +++++++++++++++---
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
index d613653ed5b9..f88452019114 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -40,7 +40,7 @@
* Define the address range of the kernel non-linear virtual area
*/
#define H_KERN_VIRT_START ASM_CONST(0xD000000000000000)
-#define H_KERN_VIRT_SIZE ASM_CONST(0x0000100000000000)
+#define H_KERN_VIRT_SIZE ASM_CONST(0x0000400000000000) /* 64T */
/*
* The vmalloc space starts at the beginning of that region, and
@@ -48,7 +48,7 @@
* (we keep a quarter for the virtual memmap)
*/
#define H_VMALLOC_START H_KERN_VIRT_START
-#define H_VMALLOC_SIZE (H_KERN_VIRT_SIZE >> 1)
+#define H_VMALLOC_SIZE ASM_CONST(0x380000000000) /* 56T */
#define H_VMALLOC_END (H_VMALLOC_START + H_VMALLOC_SIZE)
#define H_KERN_IO_START H_VMALLOC_END
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index 2eb1b92a68ff..906a86fe457b 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -121,9 +121,21 @@ slb_miss_kernel_load_vmemmap:
1:
#endif /* CONFIG_SPARSEMEM_VMEMMAP */
- clrldi r11,r10,48
- cmpldi r11,(H_VMALLOC_SIZE >> 28) - 1
- bgt 5f
+ /*
+ * r10 contains the ESID, which is the original faulting EA shifted
+ * right by 28 bits. We need to compare that with (H_VMALLOC_END >> 28)
+ * which is 0xd00038000. That can't be used as an immediate, even if we
+ * ignored the 0xd, so we have to load it into a register, and we only
+ * have one register free. So we must load all of (H_VMALLOC_END >> 28)
+ * into a register and compare ESID against that.
+ */
+ lis r11,(H_VMALLOC_END >> 32)@h // r11 = 0xffffffffd0000000
+ ori r11,r11,(H_VMALLOC_END >> 32)@l // r11 = 0xffffffffd0003800
+ // Rotate left 4, then mask with 0xffffffff0
+ rldic r11,r11,4,28 // r11 = 0xd00038000
+ cmpld r10,r11 // if r10 >= r11
+ bge 5f // goto io_mapping
+
/*
* vmalloc mapping gets the encoding from the PACA as the mapping
* can be demoted from 64K -> 4K dynamically on some machines.
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] powerpc/mm/hash64: Make vmalloc 56T on hash
2017-08-01 10:29 ` [PATCH 3/3] powerpc/mm/hash64: Make vmalloc 56T on hash Michael Ellerman
@ 2017-08-02 8:19 ` Aneesh Kumar K.V
2017-08-03 0:00 ` Michael Ellerman
0 siblings, 1 reply; 9+ messages in thread
From: Aneesh Kumar K.V @ 2017-08-02 8:19 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: anton
Michael Ellerman <mpe@ellerman.id.au> writes:
> On 64-bit book3s, with the hash MMU, we currently define the kernel
> virtual space (vmalloc, ioremap etc.), to be 16T in size. This is a
> leftover from pre v3.7 when our user VM was also 16T.
>
> Of that 16T we split it 50/50, with half used for PCI IO and ioremap
> and the other 8T for vmalloc.
>
> We never bothered to make it any bigger because 8T of vmalloc ought to
> be enough for anybody. But it turns out that's not true, the per cpu
> allocator wants large amounts of vmalloc space, not to make large
> allocations, but to allow a large stride between allocations, because
> we use pcpu_embed_first_chunk().
>
> With a bit of juggling we can keep 8T for the IO etc. and make the
> vmalloc space 56T. The only complication is the check of the address
What is the significance of 56T number ? Can you add a comment regarding
why 56TB was selected ?
> in the SLB miss handler, see the comment in the code.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/include/asm/book3s/64/hash.h | 4 ++--
> arch/powerpc/mm/slb_low.S | 18 +++++++++++++++---
> 2 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
> index d613653ed5b9..f88452019114 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash.h
> @@ -40,7 +40,7 @@
> * Define the address range of the kernel non-linear virtual area
> */
> #define H_KERN_VIRT_START ASM_CONST(0xD000000000000000)
> -#define H_KERN_VIRT_SIZE ASM_CONST(0x0000100000000000)
> +#define H_KERN_VIRT_SIZE ASM_CONST(0x0000400000000000) /* 64T */
>
> /*
> * The vmalloc space starts at the beginning of that region, and
> @@ -48,7 +48,7 @@
> * (we keep a quarter for the virtual memmap)
> */
> #define H_VMALLOC_START H_KERN_VIRT_START
> -#define H_VMALLOC_SIZE (H_KERN_VIRT_SIZE >> 1)
> +#define H_VMALLOC_SIZE ASM_CONST(0x380000000000) /* 56T */
> #define H_VMALLOC_END (H_VMALLOC_START + H_VMALLOC_SIZE)
>
> #define H_KERN_IO_START H_VMALLOC_END
> diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
> index 2eb1b92a68ff..906a86fe457b 100644
> --- a/arch/powerpc/mm/slb_low.S
> +++ b/arch/powerpc/mm/slb_low.S
> @@ -121,9 +121,21 @@ slb_miss_kernel_load_vmemmap:
> 1:
> #endif /* CONFIG_SPARSEMEM_VMEMMAP */
>
> - clrldi r11,r10,48
> - cmpldi r11,(H_VMALLOC_SIZE >> 28) - 1
> - bgt 5f
> + /*
> + * r10 contains the ESID, which is the original faulting EA shifted
> + * right by 28 bits. We need to compare that with (H_VMALLOC_END >> 28)
> + * which is 0xd00038000. That can't be used as an immediate, even if we
> + * ignored the 0xd, so we have to load it into a register, and we only
> + * have one register free. So we must load all of (H_VMALLOC_END >> 28)
> + * into a register and compare ESID against that.
> + */
> + lis r11,(H_VMALLOC_END >> 32)@h // r11 = 0xffffffffd0000000
> + ori r11,r11,(H_VMALLOC_END >> 32)@l // r11 = 0xffffffffd0003800
> + // Rotate left 4, then mask with 0xffffffff0
> + rldic r11,r11,4,28 // r11 = 0xd00038000
> + cmpld r10,r11 // if r10 >= r11
> + bge 5f // goto io_mapping
> +
> /*
> * vmalloc mapping gets the encoding from the PACA as the mapping
> * can be demoted from 64K -> 4K dynamically on some machines.
> --
> 2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable
2017-08-01 10:29 [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Michael Ellerman
2017-08-01 10:29 ` [PATCH 2/3] powerpc/mm/slb: Move comment next to the code it's referring to Michael Ellerman
2017-08-01 10:29 ` [PATCH 3/3] powerpc/mm/hash64: Make vmalloc 56T on hash Michael Ellerman
@ 2017-08-02 8:20 ` Aneesh Kumar K.V
2017-08-02 22:20 ` Balbir Singh
2017-08-08 10:55 ` [1/3] " Michael Ellerman
4 siblings, 0 replies; 9+ messages in thread
From: Aneesh Kumar K.V @ 2017-08-02 8:20 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: anton
Michael Ellerman <mpe@ellerman.id.au> writes:
> Currently KERN_IO_START is defined as:
>
> #define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
>
> Although it looks like a constant, both the components are actually
> variables, to allow us to have a different value between Radix and
> Hash with a single kernel.
>
> However that still requires both Radix and Hash to place the kernel IO
> region at the same location relative to the start and end of the
> kernel virtual region (namely 1/2 way through it), and we'd like to
> change that.
>
> So split KERN_IO_START out into its own variable, and initialise it
> for Radix and Hash. In the medium term we should be able to
> reconsolidate this, by doing a more involved rearrangement of the
> location of the regions.
>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/include/asm/book3s/64/hash.h | 2 ++
> arch/powerpc/include/asm/book3s/64/pgtable.h | 3 ++-
> arch/powerpc/include/asm/book3s/64/radix.h | 2 ++
> arch/powerpc/mm/hash_utils_64.c | 1 +
> arch/powerpc/mm/pgtable-radix.c | 1 +
> arch/powerpc/mm/pgtable_64.c | 2 ++
> 6 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
> index 36fc7bfe9e11..d613653ed5b9 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash.h
> @@ -51,6 +51,8 @@
> #define H_VMALLOC_SIZE (H_KERN_VIRT_SIZE >> 1)
> #define H_VMALLOC_END (H_VMALLOC_START + H_VMALLOC_SIZE)
>
> +#define H_KERN_IO_START H_VMALLOC_END
> +
> /*
> * Region IDs
> */
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index d1da415e283c..18a8580d3ddc 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -272,8 +272,10 @@ extern unsigned long __vmalloc_end;
>
> extern unsigned long __kernel_virt_start;
> extern unsigned long __kernel_virt_size;
> +extern unsigned long __kernel_io_start;
> #define KERN_VIRT_START __kernel_virt_start
> #define KERN_VIRT_SIZE __kernel_virt_size
> +#define KERN_IO_START __kernel_io_start
> extern struct page *vmemmap;
> extern unsigned long ioremap_bot;
> extern unsigned long pci_io_base;
> @@ -298,7 +300,6 @@ extern unsigned long pci_io_base;
> * PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
> * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
> */
> -#define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
> #define FULL_IO_SIZE 0x80000000ul
> #define ISA_IO_BASE (KERN_IO_START)
> #define ISA_IO_END (KERN_IO_START + 0x10000ul)
> diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h
> index 544440b5aff3..1e5ba94e62ef 100644
> --- a/arch/powerpc/include/asm/book3s/64/radix.h
> +++ b/arch/powerpc/include/asm/book3s/64/radix.h
> @@ -110,6 +110,8 @@
> */
> #define RADIX_VMEMMAP_BASE (RADIX_VMALLOC_END)
>
> +#define RADIX_KERN_IO_START (RADIX_KERN_VIRT_START + (RADIX_KERN_VIRT_SIZE >> 1))
> +
> #ifndef __ASSEMBLY__
> #define RADIX_PTE_TABLE_SIZE (sizeof(pte_t) << RADIX_PTE_INDEX_SIZE)
> #define RADIX_PMD_TABLE_SIZE (sizeof(pmd_t) << RADIX_PMD_INDEX_SIZE)
> diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
> index 7419fc1854ad..a93137c358ea 100644
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -1019,6 +1019,7 @@ void __init hash__early_init_mmu(void)
> __kernel_virt_size = H_KERN_VIRT_SIZE;
> __vmalloc_start = H_VMALLOC_START;
> __vmalloc_end = H_VMALLOC_END;
> + __kernel_io_start = H_KERN_IO_START;
> vmemmap = (struct page *)H_VMEMMAP_BASE;
> ioremap_bot = IOREMAP_BASE;
>
> diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
> index 5cc50d47ce3f..d37e68495acc 100644
> --- a/arch/powerpc/mm/pgtable-radix.c
> +++ b/arch/powerpc/mm/pgtable-radix.c
> @@ -494,6 +494,7 @@ void __init radix__early_init_mmu(void)
> __kernel_virt_size = RADIX_KERN_VIRT_SIZE;
> __vmalloc_start = RADIX_VMALLOC_START;
> __vmalloc_end = RADIX_VMALLOC_END;
> + __kernel_io_start = RADIX_KERN_IO_START;
> vmemmap = (struct page *)RADIX_VMEMMAP_BASE;
> ioremap_bot = IOREMAP_BASE;
>
> diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
> index 0736e94c7615..ac0717a90ca6 100644
> --- a/arch/powerpc/mm/pgtable_64.c
> +++ b/arch/powerpc/mm/pgtable_64.c
> @@ -104,6 +104,8 @@ unsigned long __vmalloc_start;
> EXPORT_SYMBOL(__vmalloc_start);
> unsigned long __vmalloc_end;
> EXPORT_SYMBOL(__vmalloc_end);
> +unsigned long __kernel_io_start;
> +EXPORT_SYMBOL(__kernel_io_start);
> struct page *vmemmap;
> EXPORT_SYMBOL(vmemmap);
> unsigned long __pte_frag_nr;
> --
> 2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] powerpc/mm/slb: Move comment next to the code it's referring to
2017-08-01 10:29 ` [PATCH 2/3] powerpc/mm/slb: Move comment next to the code it's referring to Michael Ellerman
@ 2017-08-02 8:21 ` Aneesh Kumar K.V
0 siblings, 0 replies; 9+ messages in thread
From: Aneesh Kumar K.V @ 2017-08-02 8:21 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: anton
Michael Ellerman <mpe@ellerman.id.au> writes:
> There is a comment in slb_allocate() referring to the load of
> paca->vmalloc_sllp, but it's several lines prior in the assembly.
> We're about to change this code, and we want to add another comment,
> so move the comment immediately prior to the instruction it's talking
> about.
>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/mm/slb_low.S | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
> index bde378559d01..2eb1b92a68ff 100644
> --- a/arch/powerpc/mm/slb_low.S
> +++ b/arch/powerpc/mm/slb_low.S
> @@ -121,12 +121,13 @@ slb_miss_kernel_load_vmemmap:
> 1:
> #endif /* CONFIG_SPARSEMEM_VMEMMAP */
>
> - /* vmalloc mapping gets the encoding from the PACA as the mapping
> - * can be demoted from 64K -> 4K dynamically on some machines
> - */
> clrldi r11,r10,48
> cmpldi r11,(H_VMALLOC_SIZE >> 28) - 1
> bgt 5f
> + /*
> + * vmalloc mapping gets the encoding from the PACA as the mapping
> + * can be demoted from 64K -> 4K dynamically on some machines.
> + */
> lhz r11,PACAVMALLOCSLLP(r13)
> b 6f
> 5:
> --
> 2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable
2017-08-01 10:29 [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Michael Ellerman
` (2 preceding siblings ...)
2017-08-02 8:20 ` [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Aneesh Kumar K.V
@ 2017-08-02 22:20 ` Balbir Singh
2017-08-08 10:55 ` [1/3] " Michael Ellerman
4 siblings, 0 replies; 9+ messages in thread
From: Balbir Singh @ 2017-08-02 22:20 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Anton Blanchard, Aneesh Kumar KV
On Tue, Aug 1, 2017 at 8:29 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Currently KERN_IO_START is defined as:
>
> #define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
>
> Although it looks like a constant, both the components are actually
> variables, to allow us to have a different value between Radix and
> Hash with a single kernel.
>
> However that still requires both Radix and Hash to place the kernel IO
> region at the same location relative to the start and end of the
> kernel virtual region (namely 1/2 way through it), and we'd like to
> change that.
>
> So split KERN_IO_START out into its own variable, and initialise it
> for Radix and Hash. In the medium term we should be able to
> reconsolidate this, by doing a more involved rearrangement of the
> location of the regions.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
Makes sense
Acked-by: Balbir Singh <bsingharora@gmail.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] powerpc/mm/hash64: Make vmalloc 56T on hash
2017-08-02 8:19 ` Aneesh Kumar K.V
@ 2017-08-03 0:00 ` Michael Ellerman
0 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2017-08-03 0:00 UTC (permalink / raw)
To: Aneesh Kumar K.V, linuxppc-dev; +Cc: anton
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> writes:
> Michael Ellerman <mpe@ellerman.id.au> writes:
>
>> On 64-bit book3s, with the hash MMU, we currently define the kernel
>> virtual space (vmalloc, ioremap etc.), to be 16T in size. This is a
>> leftover from pre v3.7 when our user VM was also 16T.
>>
>> Of that 16T we split it 50/50, with half used for PCI IO and ioremap
>> and the other 8T for vmalloc.
>>
>> We never bothered to make it any bigger because 8T of vmalloc ought to
>> be enough for anybody. But it turns out that's not true, the per cpu
>> allocator wants large amounts of vmalloc space, not to make large
>> allocations, but to allow a large stride between allocations, because
>> we use pcpu_embed_first_chunk().
>>
>> With a bit of juggling we can keep 8T for the IO etc. and make the
>> vmalloc space 56T. The only complication is the check of the address
>
> What is the significance of 56T number ? Can you add a comment regarding
> why 56TB was selected ?
Yeah good point. Currently we have 16T, 8T for vmalloc, 8T for IO mappings. We
don't seem to have any need for more IO mappings, so we keep that as 8T,
giving us 64T - 8T = 56T for vmalloc.
Will update the change log.
cheers
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable
2017-08-01 10:29 [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Michael Ellerman
` (3 preceding siblings ...)
2017-08-02 22:20 ` Balbir Singh
@ 2017-08-08 10:55 ` Michael Ellerman
4 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2017-08-08 10:55 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: anton, aneesh.kumar
On Tue, 2017-08-01 at 10:29:22 UTC, Michael Ellerman wrote:
> Currently KERN_IO_START is defined as:
>
> #define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
>
> Although it looks like a constant, both the components are actually
> variables, to allow us to have a different value between Radix and
> Hash with a single kernel.
>
> However that still requires both Radix and Hash to place the kernel IO
> region at the same location relative to the start and end of the
> kernel virtual region (namely 1/2 way through it), and we'd like to
> change that.
>
> So split KERN_IO_START out into its own variable, and initialise it
> for Radix and Hash. In the medium term we should be able to
> reconsolidate this, by doing a more involved rearrangement of the
> location of the regions.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Acked-by: Balbir Singh <bsingharora@gmail.com>
Series applied to powerpc next.
https://git.kernel.org/powerpc/c/63ee9b2ff9d306efaa61b04b8710fa
cheers
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-08-08 10:55 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-01 10:29 [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Michael Ellerman
2017-08-01 10:29 ` [PATCH 2/3] powerpc/mm/slb: Move comment next to the code it's referring to Michael Ellerman
2017-08-02 8:21 ` Aneesh Kumar K.V
2017-08-01 10:29 ` [PATCH 3/3] powerpc/mm/hash64: Make vmalloc 56T on hash Michael Ellerman
2017-08-02 8:19 ` Aneesh Kumar K.V
2017-08-03 0:00 ` Michael Ellerman
2017-08-02 8:20 ` [PATCH 1/3] powerpc/mm/book3s64: Make KERN_IO_START a variable Aneesh Kumar K.V
2017-08-02 22:20 ` Balbir Singh
2017-08-08 10:55 ` [1/3] " 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).