From: Andrew Morton <akpm@linux-foundation.org>
To: "Yijia Wang" <wangyijia.yeah@bytedance.com>
Cc: <linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-mm@kvack.org>, <shuah@kernel.org>
Subject: Re: [PATCH] selftests: mincore: use default huge page size for hugetlb test
Date: Sun, 5 Jul 2026 18:18:43 -0700 [thread overview]
Message-ID: <20260705181843.6c7a2c4629cb05d47305cf14@linux-foundation.org> (raw)
In-Reply-To: <20260626-b4-mincore-preview-v1-1-5f07aa02ab32@bytedance.com>
On Fri, 26 Jun 2026 20:59:02 +0800 "Yijia Wang" <wangyijia.yeah@bytedance.com> wrote:
> The hugetlb mincore test passes the base page size as the MAP_HUGETLB
> mapping length. This works on systems where the default huge page size
> is the same as the base page size, but mmap() can fail with EINVAL before
> mincore() is exercised when the default huge page size is larger, such as
> on arm64 systems with 64K base pages and 2M huge pages.
>
> Use the default huge page size from /proc/meminfo for the hugetlb mapping
> and unmap length. Keep the mincore() check scoped to one base page since
> the test only needs to verify the residency state before and after the
> mapping is touched. This also avoids changing the mincore() length to the
> whole huge page, which would require a larger residency vector because
> mincore() reports one byte per base page.
Thanks.
AI review flagged a couple of possible issues - can you please take a
look?
https://sashiko.dev/#/patchset/20260626-b4-mincore-preview-v1-1-5f07aa02ab32@bytedance.com
> --- a/tools/testing/selftests/mincore/mincore_selftest.c
> +++ b/tools/testing/selftests/mincore/mincore_selftest.c
> @@ -22,6 +22,27 @@
> #define MB (1UL << 20)
> #define FILE_SIZE (4 * MB)
>
> +static unsigned long default_huge_page_size(void)
This would be our fifth(?) implementation of default_huge_page_size()
in tools/testing/selftests. There's a project for someone!
prev parent reply other threads:[~2026-07-06 1:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 12:59 Yijia Wang
2026-07-06 1:18 ` 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=20260705181843.6c7a2c4629cb05d47305cf14@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@kernel.org \
--cc=wangyijia.yeah@bytedance.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
Powered by JetHome