linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Weilin Tong <tongweilin@linux.alibaba.com>
To: Barry Song <21cnbao@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	linux-mm@kvack.org, baolin.wang@linux.alibaba.com
Subject: Re: [RFC PATCH] arm64: Kconfig: enable ARCH_WANTS_THP_SWAP for all pagesizes
Date: Fri, 26 Dec 2025 16:40:31 +0800	[thread overview]
Message-ID: <a91e09e5-9735-4539-ba83-661674e7f728@linux.alibaba.com> (raw)
In-Reply-To: <CAGsJ_4yQtFK8wtMuJ72ce8KFRT7mB4SZxqS1MKi6RA1WDNkm1Q@mail.gmail.com>


在 2025/12/26 16:31, Barry Song 写道:
> On Fri, Dec 26, 2025 at 9:18 PM Weilin Tong
> <tongweilin@linux.alibaba.com> wrote:
>>
>> 在 2025/12/26 14:52, Barry Song 写道:
>>
>> On Fri, Dec 26, 2025 at 7:39 PM Weilin Tong
>> <tongweilin@linux.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
>>
>>
>> Thank you very much for taking the time to review this patch during the holiday. Wishing you a happy holiday as well!
>>
>> I appreciate you pointing out this optimization. We initially noticed the issue because, on ARM64 kernels with 64K page size, if large folios are used in shmem, they cannot be swapped out as a whole during shmem_writeout() due to the config limitation,
>> and are forced to split instead—which is something we wanted to avoid.
>>
>> It seems that this change will help enable better swap operations for large folios. Thank you again for your feedback!
> Right, I believe this is the correct direction. Just double-check that
> the MTE-related functionality works. Take a look at commit
> f238b8c33c6738 ("arm64: mm: swap: support THP_SWAP on hardware with MTE").
Thanks, I will take a look.


  reply	other threads:[~2025-12-26  8:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-26  6:38 Weilin Tong
2025-12-26  6:52 ` Barry Song
2025-12-26  8:18   ` Weilin Tong
2025-12-26  8:31     ` Barry Song
2025-12-26  8:40       ` Weilin Tong [this message]
2025-12-26  8:31   ` Weilin Tong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a91e09e5-9735-4539-ba83-661674e7f728@linux.alibaba.com \
    --to=tongweilin@linux.alibaba.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=catalin.marinas@arm.com \
    --cc=david@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox