From: Andrew Morton <akpm@linux-foundation.org>
To: Barry Song <21cnbao@gmail.com>
Cc: catalin.marinas@arm.com, will@kernel.org, linux-mm@kvack.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, zhangshiming@oppo.com,
guojian@oppo.com, hanchuanhua@oppo.com,
Barry Song <v-songbaohua@oppo.com>,
"Huang, Ying" <ying.huang@intel.com>,
Minchan Kim <minchan@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Hugh Dickins <hughd@google.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Steven Price <steven.price@arm.com>,
Yang Shi <shy828301@gmail.com>
Subject: Re: [PATCH v2] arm64: enable THP_SWAP for arm64
Date: Mon, 30 May 2022 15:17:30 -0700 [thread overview]
Message-ID: <20220530151730.39596f41e284b5686acba04f@linux-foundation.org> (raw)
In-Reply-To: <20220527100644.293717-1-21cnbao@gmail.com>
On Fri, 27 May 2022 22:06:44 +1200 Barry Song <21cnbao@gmail.com> wrote:
> From: Barry Song <v-songbaohua@oppo.com>
>
> THP_SWAP has been proved to improve the swap throughput significantly
> on x86_64 according to commit bd4c82c22c367e ("mm, THP, swap: delay
> splitting THP after swapped out").
> As long as arm64 uses 4K page size, it is quite similar with x86_64
> by having 2MB PMD THP. So we are going to get similar improvement.
> For other page sizes such as 16KB and 64KB, PMD might be too large.
> Negative side effects such as IO latency might be a problem. Thus,
> we can only safely enable the counterpart of X86_64.
> A corner case is that MTE has an assumption that only base pages
> can be swapped. We won't enable THP_SWP for ARM64 hardware with
> MTE support until MTE is re-arched.
>
> ...
>
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -45,6 +45,8 @@
> __flush_tlb_range(vma, addr, end, PUD_SIZE, false, 1)
> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>
> +#define arch_thp_swp_supported !system_supports_mte
Does that even work?
if (arch_thp_swp_supported())
expands to
if (!system_supports_mte())
so I guess it does work. Is this ugly party trick required for some
reason? If so, an apologetic comment describing why would be helpful.
Otherwise, can we use a static inline function here, as we do with the
stub function?
> --- a/include/linux/huge_mm.h
> +++ b/include/linux/huge_mm.h
> @@ -461,4 +461,16 @@ static inline int split_folio_to_list(struct folio *folio,
> return split_huge_page_to_list(&folio->page, list);
> }
>
> +/*
> + * archs that select ARCH_WANTS_THP_SWAP but don't support THP_SWP due to
> + * limitations in the implementation like arm64 MTE can override this to
> + * false
> + */
> +#ifndef arch_thp_swp_supported
> +static inline bool arch_thp_swp_supported(void)
> +{
> + return true;
> +}
Missing a #define arch_thp_swp_supported arch_thp_swp_supported here.
> +#endif
> +
> #endif /* _LINUX_HUGE_MM_H */
Otherwise looks OK to me. Please include it in the arm64 tree if/when
it's considered ready.
prev parent reply other threads:[~2022-05-30 22:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 10:06 Barry Song
2022-05-30 7:07 ` Anshuman Khandual
2022-05-30 9:53 ` Barry Song
2022-05-30 11:09 ` Steven Price
2022-05-31 2:40 ` Anshuman Khandual
2022-05-31 2:32 ` Anshuman Khandual
2022-05-30 22:17 ` Andrew Morton [this message]
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=20220530151730.39596f41e284b5686acba04f@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=21cnbao@gmail.com \
--cc=aarcange@redhat.com \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=guojian@oppo.com \
--cc=hanchuanhua@oppo.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=shy828301@gmail.com \
--cc=steven.price@arm.com \
--cc=v-songbaohua@oppo.com \
--cc=will@kernel.org \
--cc=ying.huang@intel.com \
--cc=zhangshiming@oppo.com \
/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