* [PATCH] arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER
@ 2021-03-01 11:25 Anshuman Khandual
2021-03-01 15:18 ` Catalin Marinas
2021-03-08 14:40 ` Will Deacon
0 siblings, 2 replies; 3+ messages in thread
From: Anshuman Khandual @ 2021-03-01 11:25 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Anshuman Khandual, Catalin Marinas, Will Deacon, linux-kernel
Currently without THP being enabled, MAX_ORDER via FORCE_MAX_ZONEORDER gets
reduced to 11, which falls below HUGETLB_PAGE_ORDER for certain 16K and 64K
page size configurations. This is problematic which throws up the following
warning during boot as pageblock_order via HUGETLB_PAGE_ORDER order exceeds
MAX_ORDER.
WARNING: CPU: 7 PID: 127 at mm/vmstat.c:1092 __fragmentation_index+0x58/0x70
Modules linked in:
CPU: 7 PID: 127 Comm: kswapd0 Not tainted 5.12.0-rc1-00005-g0221e3101a1 #237
Hardware name: linux,dummy-virt (DT)
pstate: 20400005 (nzCv daif +PAN -UAO -TCO BTYPE=--)
pc : __fragmentation_index+0x58/0x70
lr : fragmentation_index+0x88/0xa8
sp : ffff800016ccfc00
x29: ffff800016ccfc00 x28: 0000000000000000
x27: ffff800011fd4000 x26: 0000000000000002
x25: ffff800016ccfda0 x24: 0000000000000002
x23: 0000000000000640 x22: ffff0005ffcb5b18
x21: 0000000000000002 x20: 000000000000000d
x19: ffff0005ffcb3980 x18: 0000000000000004
x17: 0000000000000001 x16: 0000000000000019
x15: ffff800011ca7fb8 x14: 00000000000002b3
x13: 0000000000000000 x12: 00000000000005e0
x11: 0000000000000003 x10: 0000000000000080
x9 : ffff800011c93948 x8 : 0000000000000000
x7 : 0000000000000000 x6 : 0000000000007000
x5 : 0000000000007944 x4 : 0000000000000032
x3 : 000000000000001c x2 : 000000000000000b
x1 : ffff800016ccfc10 x0 : 000000000000000d
Call trace:
__fragmentation_index+0x58/0x70
compaction_suitable+0x58/0x78
wakeup_kcompactd+0x8c/0xd8
balance_pgdat+0x570/0x5d0
kswapd+0x1e0/0x388
kthread+0x154/0x158
ret_from_fork+0x10/0x30
This solves the problem via keeping FORCE_MAX_ZONEORDER unchanged with or
without THP on 16K and 64K page size configurations, making sure that the
HUGETLB_PAGE_ORDER (and pageblock_order) would never exceed MAX_ORDER.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on v5.12-rc1 and does not seem to have any obvious problem
on 16K and 64K page size configurations. This is a simpler alternate to
a previous series [1] which tried to solve the very same problem but in
a different way.
https://patchwork.kernel.org/project/linux-mm/list/?series=431973
arch/arm64/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 9cd33c7be429..d4690326274a 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1156,8 +1156,8 @@ config XEN
config FORCE_MAX_ZONEORDER
int
- default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
- default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE)
+ default "14" if ARM64_64K_PAGES
+ default "12" if ARM64_16K_PAGES
default "11"
help
The kernel memory allocator divides physically contiguous memory
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER
2021-03-01 11:25 [PATCH] arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER Anshuman Khandual
@ 2021-03-01 15:18 ` Catalin Marinas
2021-03-08 14:40 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2021-03-01 15:18 UTC (permalink / raw)
To: Anshuman Khandual
Cc: linux-arm-kernel, Will Deacon, linux-kernel, Steve Capper
On Mon, Mar 01, 2021 at 04:55:14PM +0530, Anshuman Khandual wrote:
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 9cd33c7be429..d4690326274a 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1156,8 +1156,8 @@ config XEN
>
> config FORCE_MAX_ZONEORDER
> int
> - default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
> - default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE)
> + default "14" if ARM64_64K_PAGES
> + default "12" if ARM64_16K_PAGES
> default "11"
> help
> The kernel memory allocator divides physically contiguous memory
I think this makes sense. The original "14" was added by Steve C in
commit d03bb1455f3a ("ARM64: mm: Raise MAX_ORDER for 64KB pages and
THP.") back in 3.11. It looks like hugetlbfs (and the HUGETLB_PAGE_ORDER
definition) was added in the same kernel but we somehow missed the
!TRANSPARENT_HUGEPAGE case and smaller page order. The warning in
__fragmentation_index() was added much later in 4.14.
Anyway, the patch looks fine to me, we could apply it to some past
stable kernels:
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
An alternative would have be to add a dependency on both
TRANSPARENT_HUGEPAGE and HUGETLB_PAGE but I'm not sure it's worth it.
--
Catalin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER
2021-03-01 11:25 [PATCH] arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER Anshuman Khandual
2021-03-01 15:18 ` Catalin Marinas
@ 2021-03-08 14:40 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2021-03-08 14:40 UTC (permalink / raw)
To: Anshuman Khandual, linux-arm-kernel
Cc: catalin.marinas, kernel-team, Will Deacon, linux-kernel
On Mon, 1 Mar 2021 16:55:14 +0530, Anshuman Khandual wrote:
> Currently without THP being enabled, MAX_ORDER via FORCE_MAX_ZONEORDER gets
> reduced to 11, which falls below HUGETLB_PAGE_ORDER for certain 16K and 64K
> page size configurations. This is problematic which throws up the following
> warning during boot as pageblock_order via HUGETLB_PAGE_ORDER order exceeds
> MAX_ORDER.
>
> WARNING: CPU: 7 PID: 127 at mm/vmstat.c:1092 __fragmentation_index+0x58/0x70
> Modules linked in:
> CPU: 7 PID: 127 Comm: kswapd0 Not tainted 5.12.0-rc1-00005-g0221e3101a1 #237
> Hardware name: linux,dummy-virt (DT)
> pstate: 20400005 (nzCv daif +PAN -UAO -TCO BTYPE=--)
> pc : __fragmentation_index+0x58/0x70
> lr : fragmentation_index+0x88/0xa8
> sp : ffff800016ccfc00
> x29: ffff800016ccfc00 x28: 0000000000000000
> x27: ffff800011fd4000 x26: 0000000000000002
> x25: ffff800016ccfda0 x24: 0000000000000002
> x23: 0000000000000640 x22: ffff0005ffcb5b18
> x21: 0000000000000002 x20: 000000000000000d
> x19: ffff0005ffcb3980 x18: 0000000000000004
> x17: 0000000000000001 x16: 0000000000000019
> x15: ffff800011ca7fb8 x14: 00000000000002b3
> x13: 0000000000000000 x12: 00000000000005e0
> x11: 0000000000000003 x10: 0000000000000080
> x9 : ffff800011c93948 x8 : 0000000000000000
> x7 : 0000000000000000 x6 : 0000000000007000
> x5 : 0000000000007944 x4 : 0000000000000032
> x3 : 000000000000001c x2 : 000000000000000b
> x1 : ffff800016ccfc10 x0 : 000000000000000d
> Call trace:
> __fragmentation_index+0x58/0x70
> compaction_suitable+0x58/0x78
> wakeup_kcompactd+0x8c/0xd8
> balance_pgdat+0x570/0x5d0
> kswapd+0x1e0/0x388
> kthread+0x154/0x158
> ret_from_fork+0x10/0x30
>
> [...]
Applied to arm64 (for-next/fixes), thanks!
[1/1] arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER
https://git.kernel.org/arm64/c/79cc2ed5a716
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-08 14:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 11:25 [PATCH] arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER Anshuman Khandual
2021-03-01 15:18 ` Catalin Marinas
2021-03-08 14:40 ` Will Deacon
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).