]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.8.5/powerpc-mm-update-force_max_zoneorder-range-to-allow-hugetlb-w-4k.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.8.5 / powerpc-mm-update-force_max_zoneorder-range-to-allow-hugetlb-w-4k.patch
1 From d5a1e42cb4be016a45a787953dd70c3bc4509da5 Mon Sep 17 00:00:00 2001
2 From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
3 Date: Mon, 19 Sep 2016 23:01:33 +0530
4 Subject: powerpc/mm: Update FORCE_MAX_ZONEORDER range to allow hugetlb w/4K
5
6 From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
7
8 commit d5a1e42cb4be016a45a787953dd70c3bc4509da5 upstream.
9
10 For hugetlb to work with 4K page size, we need MAX_ORDER to be 13 or
11 more. When switching from a 64K page size to 4K linux page size using
12 make oldconfig, we end up with a CONFIG_FORCE_MAX_ZONEORDER value of 9.
13 This results in a 16M hugepage beiing considered as a gigantic huge page
14 which in turn results in failure to setup hugepages if gigantic hugepage
15 support is not enabled.
16
17 This also results in kernel crash with 4K radix configuration. We
18 hit the below BUG_ON on radix:
19
20 kernel BUG at mm/huge_memory.c:364!
21 Oops: Exception in kernel mode, sig: 5 [#1]
22 SMP NR_CPUS=2048 NUMA PowerNV
23 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc1-00006-gbae9cc6 #1
24 task: c0000000f1af8000 task.stack: c0000000f1aec000
25 NIP: c000000000c5fa0c LR: c000000000c5f9d8 CTR: c000000000c5f9a4
26 REGS: c0000000f1aef920 TRAP: 0700 Not tainted (4.8.0-rc1-00006-gbae9cc6)
27 MSR: 9000000102029033 <SF,HV,VEC,EE,ME,IR,DR,RI,LE,TM[E]> CR: 24000844 XER: 00000000
28 CFAR: c000000000c5f9e0 SOFTE: 1
29 ....
30 NIP [c000000000c5fa0c] hugepage_init+0x68/0x238
31 LR [c000000000c5f9d8] hugepage_init+0x34/0x238
32
33 Fixes: a7ee539584acf ("powerpc/Kconfig: Update config option based on page size")
34 Reported-by: Santhosh <santhog4@linux.vnet.ibm.com>
35 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
36 Acked-by: Balbir Singh <bsingharora@gmail.com>
37 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
38 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
39
40 ---
41 arch/powerpc/Kconfig | 2 +-
42 1 file changed, 1 insertion(+), 1 deletion(-)
43
44 --- a/arch/powerpc/Kconfig
45 +++ b/arch/powerpc/Kconfig
46 @@ -637,7 +637,7 @@ config FORCE_MAX_ZONEORDER
47 int "Maximum zone order"
48 range 8 9 if PPC64 && PPC_64K_PAGES
49 default "9" if PPC64 && PPC_64K_PAGES
50 - range 9 13 if PPC64 && !PPC_64K_PAGES
51 + range 13 13 if PPC64 && !PPC_64K_PAGES
52 default "13" if PPC64 && !PPC_64K_PAGES
53 range 9 64 if PPC32 && PPC_16K_PAGES
54 default "9" if PPC32 && PPC_16K_PAGES