[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGsJ_4zd+SMa4Mj23tjF5OwsP3LQyvYTrwN4y81=k8FSFgbH3Q@mail.gmail.com>
Date: Fri, 26 Dec 2025 19:52:44 +1300
From: Barry Song <21cnbao@...il.com>
To: Weilin Tong <tongweilin@...ux.alibaba.com>
Cc: Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, David Hildenbrand <david@...nel.org>, linux-mm@...ck.org,
baolin.wang@...ux.alibaba.com
Subject: Re: [RFC PATCH] arm64: Kconfig: enable ARCH_WANTS_THP_SWAP for all pagesizes
On Fri, Dec 26, 2025 at 7:39 PM Weilin Tong
<tongweilin@...ux.alibaba.com> wrote:
>
> Currently, ARCH_WANTS_THP_SWAP was limited to 4K page size ARM64 kernels, but
> large folios requiring swapping also exist in other page size configurations
> (e.g. 64K). Without this config, large folios in these kernels cannot be swapped
> out.
>
> Here we enable ARCH_WANTS_THP_SWAP for all ARM64 page sizes.
I no longer recall why this was not enabled for sizes other than
4 KB in commit d0637c505f8a ("arm64: enable THP_SWAP for arm64"), but
it appears to be fine, and the swap cluster size should also be
more friendly to PMD alignment.
#ifdef CONFIG_THP_SWAP
#define SWAPFILE_CLUSTER HPAGE_PMD_NR
#define swap_entry_order(order) (order)
#else
#define SWAPFILE_CLUSTER 256
#define swap_entry_order(order) 0
#endif
>
> Signed-off-by: Weilin Tong <tongweilin@...ux.alibaba.com>
> ---
> arch/arm64/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 93173f0a09c7..58f7b4405f81 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -120,7 +120,7 @@ config ARM64
> select ARCH_WANT_LD_ORPHAN_WARN
> select ARCH_WANTS_EXECMEM_LATE
> select ARCH_WANTS_NO_INSTR
> - select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES
> + select ARCH_WANTS_THP_SWAP
> select ARCH_HAS_UBSAN
> select ARM_AMBA
> select ARM_ARCH_TIMER
> --
> 2.43.7
Thanks
Barry
Powered by blists - more mailing lists