Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 1/4] selftests: mm: extend the check_huge() to support mTHP check
Date: Wed, 05 Aug 2026 11:31:25 -0400	[thread overview]
Message-ID: <DKH49QGMDJGZ.1GN8OC454DA9U@nvidia.com> (raw)
In-Reply-To: <f2ad5bbe868dc7ed8642842ad2f9751a1ce79f70.1785564857.git.baolin.wang@linux.alibaba.com>

On Sat Aug 1, 2026 at 2:26 AM EDT, Baolin Wang wrote:
> To support checking for various sized mTHPs during mTHP collapse, extend the
> check_huge() function prototype to accept two new parameters specifying the
> address range and mTHP size, in preparation for the following patches.
>
> No functional changes.
>
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> ---
>  .../selftests/mm/folio_split_race_test.c      |  2 +-
>  tools/testing/selftests/mm/khugepaged.c       | 66 ++++++++++---------
>  tools/testing/selftests/mm/pagemap_ioctl.c    |  2 +-
>  .../testing/selftests/mm/prctl_thp_disable.c  |  2 +-
>  tools/testing/selftests/mm/soft-dirty.c       |  2 +-
>  .../selftests/mm/split_huge_page_test.c       | 14 ++--
>  tools/testing/selftests/mm/uffd-common.c      |  4 +-
>  tools/testing/selftests/mm/vm_util.c          |  6 +-
>  tools/testing/selftests/mm/vm_util.h          |  6 +-
>  9 files changed, 56 insertions(+), 48 deletions(-)
>

<snip>

> diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h
> index 7799154b67ee..c7ae28dfda63 100644
> --- a/tools/testing/selftests/mm/vm_util.h
> +++ b/tools/testing/selftests/mm/vm_util.h
> @@ -90,9 +90,9 @@ void clear_softdirty(void);
>  bool check_for_pattern(FILE *fp, const char *pattern, char *buf, size_t len);
>  uint64_t read_pmd_pagesize(void);
>  unsigned long rss_anon(void);
> -bool check_huge_anon(void *addr, int nr_hpages, uint64_t hpage_size);
> -bool check_huge_file(void *addr, int nr_hpages, uint64_t hpage_size);
> -bool check_huge_shmem(void *addr, int nr_hpages, uint64_t hpage_size);
> +bool check_huge_anon(void *addr, unsigned long size, int nr_hpages, uint64_t hpage_size);
> +bool check_huge_file(void *addr, unsigned long size, int nr_hpages, uint64_t hpage_size);
> +bool check_huge_shmem(void *addr, unsigned long size, int nr_hpages, uint64_t hpage_size);
>  int64_t allocate_transhuge(void *ptr, int pagemap_fd);
>  int pageflags_get(unsigned long pfn, int kpageflags_fd, uint64_t *flags);
>  

I get what "size" means only after I see Patch 3 where
gather_after_split_folio_orders() is used. I think len is a better name
if not addr_len and its type should be size_t to match
gather_after_split_folio_orders()'s signature. The rest patches should
have the same rename and type change. Thanks.

Otherwise, LGTM.

Acked-by: Zi Yan <ziy@nvidia.com>


-- 
Best Regards,
Yan, Zi



  parent reply	other threads:[~2026-08-05 15:31 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 [this message]
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
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=DKH49QGMDJGZ.1GN8OC454DA9U@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox