All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm: Update the FORCE_MAX_ZONEORDER range to enable hugetlb
@ 2016-09-19 17:31 Aneesh Kumar K.V
  2016-09-20  1:29 ` Balbir Singh
  2016-09-20 13:07 ` Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Aneesh Kumar K.V @ 2016-09-19 17:31 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: linuxppc-dev, Aneesh Kumar K.V

For hugetlb to work with 4K page size, we need the MAX_ORDER to be more
than 13. When switching from a 64K page size to 4K linux page size using
make nconfig, we endup with a CONFIG_FORCE_MAX_ZONEORDER value of 9.
This results in 16M hugepage to be considered as a gigantic huge page
which inturn can result in failure to setup hugepages if gigantic
hugepage support is not enabled.

This also results in kernel crash with 4K radix configuration. We
hit the below BUG_ON on radix

 kernel BUG at mm/huge_memory.c:364!
 Oops: Exception in kernel mode, sig: 5 [#1]
 SMP NR_CPUS=2048 NUMA PowerNV
 Modules linked in:
 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc1-00006-gbae9cc6 #1
 task: c0000000f1af8000 task.stack: c0000000f1aec000
 NIP: c000000000c5fa0c LR: c000000000c5f9d8 CTR: c000000000c5f9a4
 REGS: c0000000f1aef920 TRAP: 0700   Not tainted (4.8.0-rc1-00006-gbae9cc6)
 MSR: 9000000102029033 <SF,HV,VEC,EE,ME,IR,DR,RI,LE,TM[E]>  CR: 24000844  XER: 00000000
 CFAR: c000000000c5f9e0 SOFTE: 1
.....
 NIP [c000000000c5fa0c] hugepage_init+0x68/0x238
 LR [c000000000c5f9d8] hugepage_init+0x34/0x238

Fixes: a7ee539584acf ("powerpc/Kconfig: Update config option based on page size")

Reported-by: Santhosh <santhog4@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 927d2ab2ce08..792cb1768c8f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -637,7 +637,7 @@ config FORCE_MAX_ZONEORDER
 	int "Maximum zone order"
 	range 8 9 if PPC64 && PPC_64K_PAGES
 	default "9" if PPC64 && PPC_64K_PAGES
-	range 9 13 if PPC64 && !PPC_64K_PAGES
+	range 13 13 if PPC64 && !PPC_64K_PAGES
 	default "13" if PPC64 && !PPC_64K_PAGES
 	range 9 64 if PPC32 && PPC_16K_PAGES
 	default "9" if PPC32 && PPC_16K_PAGES
-- 
2.7.4

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

* Re: [PATCH] powerpc/mm: Update the FORCE_MAX_ZONEORDER range to enable hugetlb
  2016-09-19 17:31 [PATCH] powerpc/mm: Update the FORCE_MAX_ZONEORDER range to enable hugetlb Aneesh Kumar K.V
@ 2016-09-20  1:29 ` Balbir Singh
  2016-09-20  2:52   ` Aneesh Kumar K.V
  2016-09-20 13:07 ` Michael Ellerman
  1 sibling, 1 reply; 5+ messages in thread
From: Balbir Singh @ 2016-09-20  1:29 UTC (permalink / raw)
  To: Aneesh Kumar K.V, benh, paulus, mpe; +Cc: linuxppc-dev



On 20/09/16 03:31, Aneesh Kumar K.V wrote:
> For hugetlb to work with 4K page size, we need the MAX_ORDER to be more
> than 13. When switching from a 64K page size to 4K linux page size using
> make nconfig, we endup with a CONFIG_FORCE_MAX_ZONEORDER value of 9.
> This results in 16M hugepage to be considered as a gigantic huge page
> which inturn can result in failure to setup hugepages if gigantic
> hugepage support is not enabled.
> 
> This also results in kernel crash with 4K radix configuration. We
> hit the below BUG_ON on radix
> 
>  kernel BUG at mm/huge_memory.c:364!
>  Oops: Exception in kernel mode, sig: 5 [#1]
>  SMP NR_CPUS=2048 NUMA PowerNV
>  Modules linked in:
>  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc1-00006-gbae9cc6 #1
>  task: c0000000f1af8000 task.stack: c0000000f1aec000
>  NIP: c000000000c5fa0c LR: c000000000c5f9d8 CTR: c000000000c5f9a4
>  REGS: c0000000f1aef920 TRAP: 0700   Not tainted (4.8.0-rc1-00006-gbae9cc6)
>  MSR: 9000000102029033 <SF,HV,VEC,EE,ME,IR,DR,RI,LE,TM[E]>  CR: 24000844  XER: 00000000
>  CFAR: c000000000c5f9e0 SOFTE: 1
> .....
>  NIP [c000000000c5fa0c] hugepage_init+0x68/0x238
>  LR [c000000000c5f9d8] hugepage_init+0x34/0x238
> 
> Fixes: a7ee539584acf ("powerpc/Kconfig: Update config option based on page size")
> 
> Reported-by: Santhosh <santhog4@linux.vnet.ibm.com>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 927d2ab2ce08..792cb1768c8f 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -637,7 +637,7 @@ config FORCE_MAX_ZONEORDER
>  	int "Maximum zone order"
>  	range 8 9 if PPC64 && PPC_64K_PAGES
>  	default "9" if PPC64 && PPC_64K_PAGES
> -	range 9 13 if PPC64 && !PPC_64K_PAGES
> +	range 13 13 if PPC64 && !PPC_64K_PAGES

Do we need the range to be 12 13?

>  	default "13" if PPC64 && !PPC_64K_PAGES
>  	range 9 64 if PPC32 && PPC_16K_PAGES
>  	default "9" if PPC32 && PPC_16K_PAGES
> 

Otherwise

Acked-by: Balbir Singh <bsingharora@gmail.com>

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

* Re: [PATCH] powerpc/mm: Update the FORCE_MAX_ZONEORDER range to enable hugetlb
  2016-09-20  1:29 ` Balbir Singh
@ 2016-09-20  2:52   ` Aneesh Kumar K.V
  2016-09-20  3:13     ` Balbir Singh
  0 siblings, 1 reply; 5+ messages in thread
From: Aneesh Kumar K.V @ 2016-09-20  2:52 UTC (permalink / raw)
  To: Balbir Singh, benh, paulus, mpe; +Cc: linuxppc-dev

Balbir Singh <bsingharora@gmail.com> writes:

> On 20/09/16 03:31, Aneesh Kumar K.V wrote:
>> For hugetlb to work with 4K page size, we need the MAX_ORDER to be more
>> than 13. When switching from a 64K page size to 4K linux page size using
>> make nconfig, we endup with a CONFIG_FORCE_MAX_ZONEORDER value of 9.
>> This results in 16M hugepage to be considered as a gigantic huge page
>> which inturn can result in failure to setup hugepages if gigantic
>> hugepage support is not enabled.
>> 
>> This also results in kernel crash with 4K radix configuration. We
>> hit the below BUG_ON on radix
>> 
>>  kernel BUG at mm/huge_memory.c:364!
>>  Oops: Exception in kernel mode, sig: 5 [#1]
>>  SMP NR_CPUS=2048 NUMA PowerNV
>>  Modules linked in:
>>  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc1-00006-gbae9cc6 #1
>>  task: c0000000f1af8000 task.stack: c0000000f1aec000
>>  NIP: c000000000c5fa0c LR: c000000000c5f9d8 CTR: c000000000c5f9a4
>>  REGS: c0000000f1aef920 TRAP: 0700   Not tainted (4.8.0-rc1-00006-gbae9cc6)
>>  MSR: 9000000102029033 <SF,HV,VEC,EE,ME,IR,DR,RI,LE,TM[E]>  CR: 24000844  XER: 00000000
>>  CFAR: c000000000c5f9e0 SOFTE: 1
>> .....
>>  NIP [c000000000c5fa0c] hugepage_init+0x68/0x238
>>  LR [c000000000c5f9d8] hugepage_init+0x34/0x238
>> 
>> Fixes: a7ee539584acf ("powerpc/Kconfig: Update config option based on page size")
>> 
>> Reported-by: Santhosh <santhog4@linux.vnet.ibm.com>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>> ---
>>  arch/powerpc/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index 927d2ab2ce08..792cb1768c8f 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -637,7 +637,7 @@ config FORCE_MAX_ZONEORDER
>>  	int "Maximum zone order"
>>  	range 8 9 if PPC64 && PPC_64K_PAGES
>>  	default "9" if PPC64 && PPC_64K_PAGES
>> -	range 9 13 if PPC64 && !PPC_64K_PAGES
>> +	range 13 13 if PPC64 && !PPC_64K_PAGES
>
> Do we need the range to be 12 13?

static inline bool hstate_is_gigantic(struct hstate *h)
{
	return huge_page_order(h) >= MAX_ORDER;
}

We consider hstate gigantic if it also == MAX_ORDER. Hence it should
be > 12 .

>
>>  	default "13" if PPC64 && !PPC_64K_PAGES
>>  	range 9 64 if PPC32 && PPC_16K_PAGES
>>  	default "9" if PPC32 && PPC_16K_PAGES
>> 
>
> Otherwise
>
> Acked-by: Balbir Singh <bsingharora@gmail.com>

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

* Re: [PATCH] powerpc/mm: Update the FORCE_MAX_ZONEORDER range to enable hugetlb
  2016-09-20  2:52   ` Aneesh Kumar K.V
@ 2016-09-20  3:13     ` Balbir Singh
  0 siblings, 0 replies; 5+ messages in thread
From: Balbir Singh @ 2016-09-20  3:13 UTC (permalink / raw)
  To: Aneesh Kumar K.V, benh, paulus, mpe; +Cc: linuxppc-dev



On 20/09/16 12:52, Aneesh Kumar K.V wrote:
> Balbir Singh <bsingharora@gmail.com> writes:
> 
>> On 20/09/16 03:31, Aneesh Kumar K.V wrote:
[...]
>>
>> Do we need the range to be 12 13?
> 
> static inline bool hstate_is_gigantic(struct hstate *h)
> {
> 	return huge_page_order(h) >= MAX_ORDER;
> }
> 
> We consider hstate gigantic if it also == MAX_ORDER. Hence it should
> be > 12 .
> 

Good point, agreed

Balbir Singh.

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

* Re: powerpc/mm: Update the FORCE_MAX_ZONEORDER range to enable hugetlb
  2016-09-19 17:31 [PATCH] powerpc/mm: Update the FORCE_MAX_ZONEORDER range to enable hugetlb Aneesh Kumar K.V
  2016-09-20  1:29 ` Balbir Singh
@ 2016-09-20 13:07 ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2016-09-20 13:07 UTC (permalink / raw)
  To: Aneesh Kumar K.V, benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V

On Mon, 2016-19-09 at 17:31:33 UTC, "Aneesh Kumar K.V" wrote:
> For hugetlb to work with 4K page size, we need the MAX_ORDER to be more
> than 13. When switching from a 64K page size to 4K linux page size using
> make nconfig, we endup with a CONFIG_FORCE_MAX_ZONEORDER value of 9.
> This results in 16M hugepage to be considered as a gigantic huge page
> which inturn can result in failure to setup hugepages if gigantic
> hugepage support is not enabled.
> 
> This also results in kernel crash with 4K radix configuration. We
> hit the below BUG_ON on radix
> 
>  kernel BUG at mm/huge_memory.c:364!
>  Oops: Exception in kernel mode, sig: 5 [#1]
>  SMP NR_CPUS=2048 NUMA PowerNV
>  Modules linked in:
>  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc1-00006-gbae9cc6 #1
>  task: c0000000f1af8000 task.stack: c0000000f1aec000
>  NIP: c000000000c5fa0c LR: c000000000c5f9d8 CTR: c000000000c5f9a4
>  REGS: c0000000f1aef920 TRAP: 0700   Not tainted (4.8.0-rc1-00006-gbae9cc6)
>  MSR: 9000000102029033 <SF,HV,VEC,EE,ME,IR,DR,RI,LE,TM[E]>  CR: 24000844  XER: 00000000
>  CFAR: c000000000c5f9e0 SOFTE: 1
> .....
>  NIP [c000000000c5fa0c] hugepage_init+0x68/0x238
>  LR [c000000000c5f9d8] hugepage_init+0x34/0x238
> 
> Fixes: a7ee539584acf ("powerpc/Kconfig: Update config option based on page size")
> 
> Reported-by: Santhosh <santhog4@linux.vnet.ibm.com>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Acked-by: Balbir Singh <bsingharora@gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/d5a1e42cb4be016a45a787953d

cheers

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

end of thread, other threads:[~2016-09-20 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-19 17:31 [PATCH] powerpc/mm: Update the FORCE_MAX_ZONEORDER range to enable hugetlb Aneesh Kumar K.V
2016-09-20  1:29 ` Balbir Singh
2016-09-20  2:52   ` Aneesh Kumar K.V
2016-09-20  3:13     ` Balbir Singh
2016-09-20 13:07 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.