From: "Zi Yan" <ziy@nvidia.com>
To: "Baolin Wang" <baolin.wang@linux.alibaba.com>,
<akpm@linux-foundation.org>, <david@kernel.org>, <ljs@kernel.org>
Cc: <liam@infradead.org>, <nico.pache@linux.dev>, <dev.jain@arm.com>,
<ryan.roberts@arm.com>, <baohua@kernel.org>,
<lance.yang@linux.dev>, <usama.arif@linux.dev>,
<linux-mm@kvack.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/4] selftests: mm: add mTHP collapse test cases
Date: Wed, 05 Aug 2026 12:46:44 -0400 [thread overview]
Message-ID: <DKH5VECNN2LF.M3RGFY0NORWI@nvidia.com> (raw)
In-Reply-To: <dd8013c1ddada90913876e3bd912c07e613fba8d.1785564857.git.baolin.wang@linux.alibaba.com>
On Sat Aug 1, 2026 at 2:26 AM EDT, Baolin Wang wrote:
> Added a new command 'mthp_khugepaged' for mTHP collapse, along with the '-c'
> parameter to specify the collapse order. Additionally, added mTHP collapse
> test cases for 'collapse_full', 'collapse_empty', and 'collapse_single_mthp'
> for anonymous folios. All khugepaged test cases passed.
>
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> ---
> tools/testing/selftests/mm/khugepaged.c | 130 ++++++++++++++++++----
> tools/testing/selftests/mm/run_vmtests.sh | 2 +
> 2 files changed, 113 insertions(+), 19 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c
> index f69be6be0ecd..64d6da6aa90d 100644
> --- a/tools/testing/selftests/mm/khugepaged.c
> +++ b/tools/testing/selftests/mm/khugepaged.c
> @@ -26,9 +26,11 @@
>
> #define BASE_ADDR ((void *)(1UL << 30))
> static unsigned long hpage_pmd_size;
> +static int hpage_pmd_order;
> static unsigned long page_size;
> static int hpage_pmd_nr;
> static int anon_order;
> +static int collapse_order;
<snip>
>
> diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
> index 687d115e3bd8..d09f9f6a384e 100755
> --- a/tools/testing/selftests/mm/run_vmtests.sh
> +++ b/tools/testing/selftests/mm/run_vmtests.sh
> @@ -410,6 +410,8 @@ CATEGORY="thp" run_test ./khugepaged all:shmem
>
> CATEGORY="thp" run_test ./khugepaged -s 4 all:shmem
>
> +CATEGORY="thp" run_test ./khugepaged -c 4 mthp_khugepaged:anon
Why only testing collapse_order == 4? It is more useful to test all
possible mTHP orders. -c can accept common separated order and a range.
Why only testing mthp_khugepaged:anon? IIRC, file and shmem are not
supported, so khugepaged should reject them, right?
> +
> # Try to create XFS if not provided
> if [ -z "${SPLIT_HUGE_PAGE_TEST_XFS_PATH}" ]; then
> if test_selected "thp"; then
--
Best Regards,
Yan, Zi
next prev parent reply other threads:[~2026-08-05 16:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 6:26 [PATCH v2 0/4] add anon mTHP collapse test cases Baolin Wang
2026-08-01 6:26 ` [PATCH v2 1/4] selftests: mm: extend the check_huge() to support mTHP check Baolin Wang
2026-08-04 20:38 ` Nico Pache (Red Hat)
2026-08-05 15:31 ` Zi Yan
2026-08-06 0:47 ` Baolin Wang
2026-08-01 6:26 ` [PATCH v2 2/4] selftests: mm: move gather_after_split_folio_orders() into vm_util.c file Baolin Wang
2026-08-04 20:38 ` Nico Pache (Red Hat)
2026-08-05 15:32 ` Zi Yan
2026-08-01 6:26 ` [PATCH v2 3/4] selftests: mm: implement the mTHP-sized hugepage check helpers Baolin Wang
2026-08-04 20:38 ` Nico Pache (Red Hat)
2026-08-05 15:59 ` Zi Yan
2026-08-06 1:08 ` Baolin Wang
2026-08-01 6:26 ` [PATCH v2 4/4] selftests: mm: add mTHP collapse test cases Baolin Wang
2026-08-04 20:38 ` Nico Pache (Red Hat)
2026-08-05 16:46 ` Zi Yan [this message]
2026-08-06 1:17 ` Baolin Wang
2026-08-06 1:25 ` Zi Yan
2026-08-06 1:30 ` Baolin Wang
2026-08-06 2:04 ` Zi Yan
2026-08-06 2:09 ` Baolin Wang
2026-08-04 20:38 ` [PATCH v2 0/4] add anon " Nico Pache (Red Hat)
2026-08-05 5:08 ` Baolin Wang
2026-08-05 15:14 ` Kiryl Shutsemau
2026-08-06 1:19 ` Baolin Wang
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=DKH5VECNN2LF.M3RGFY0NORWI@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=nico.pache@linux.dev \
--cc=ryan.roberts@arm.com \
--cc=usama.arif@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.