From: Anthony Yznaga <anthony.yznaga@oracle.com>
To: Yongting Lin <linyongting@bytedance.com>,
khalid@kernel.org, shuah@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH 8/8] mshare: selftests: Add test case to demostrate that mshare doesn't support THP
Date: Thu, 28 Aug 2025 18:04:22 -0700 [thread overview]
Message-ID: <d2ed9b04-8372-47e2-976a-b6a130edc161@oracle.com> (raw)
In-Reply-To: <20250825145719.29455-9-linyongting@bytedance.com>
On 8/25/25 7:57 AM, Yongting Lin wrote:
> This case is quit simple by using madvise(MADV_HUGEPAGE), but for verifying
> the size of THP memory, we need to setup the memcg and attach test
> process to this memcg before perform the test.
>
> Because mshare doesn't support THP feature, the size of THP memory should
> be 0 even though we use madivse.
There can be THPs in an mshare region if THP settings are set to
"always", but otherwise madvise() won't work directly on the msharefs
VMA. It will be necessary to implement an ioctl to apply madvise
operations to memory in an mshare region.
Anthony
>
> Signed-off-by: Yongting Lin <linyongting@bytedance.com>
> ---
> tools/testing/selftests/mshare/memory.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/tools/testing/selftests/mshare/memory.c b/tools/testing/selftests/mshare/memory.c
> index 7754c0e33506..2a415ce7bc01 100644
> --- a/tools/testing/selftests/mshare/memory.c
> +++ b/tools/testing/selftests/mshare/memory.c
> @@ -68,4 +68,15 @@ TEST_F(memory, swap)
> ASSERT_GT(swap_size, GB(1) * 9 / 10);
> }
>
> +TEST_F(memory, thp)
> +{
> + ASSERT_NE(madvise(self->addr, self->allocate_size, MADV_HUGEPAGE), -1);
> + /* touch 1G */
> + memset(self->addr, 0x01, GB(1));
> +
> + size_t huge = read_huge_from_cgroup(self->cgroup);
> + /* mshare don't support THP now */
> + ASSERT_EQ(huge, 0);
> +}
> +
> TEST_HARNESS_MAIN
next prev parent reply other threads:[~2025-08-29 1:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 14:57 [PATCH 0/8] Add selftests for mshare Yongting Lin
2025-08-25 14:57 ` [PATCH 1/8] mshare: Add selftests Yongting Lin
2025-08-25 14:57 ` [PATCH 2/8] mshare: selftests: Adding config fragment Yongting Lin
2025-08-25 14:57 ` [PATCH 3/8] mshare: selftests: Add some helper function for mshare filesystem Yongting Lin
2025-08-25 14:57 ` [PATCH 4/8] mshare: selftests: Add test case shared memory Yongting Lin
2025-08-29 0:59 ` Anthony Yznaga
2025-09-01 12:50 ` [External] " Yongting Lin
2025-09-02 21:34 ` Anthony Yznaga
2025-08-25 14:57 ` [PATCH 5/8] mshare: selftests: Add test case ioctl unmap Yongting Lin
2025-08-25 14:57 ` [PATCH 6/8] mshare: selftests: Add some helper functions for reading and controlling cgroup Yongting Lin
2025-08-25 14:57 ` [PATCH 7/8] mshare: selftests: Add test case to demostrate the swaping of mshare memory Yongting Lin
2025-08-25 14:57 ` [PATCH 8/8] mshare: selftests: Add test case to demostrate that mshare doesn't support THP Yongting Lin
2025-08-29 1:04 ` Anthony Yznaga [this message]
2025-08-25 14:57 ` [PATCH 1/8] mshare: Add selftests Yongting Lin
2025-08-25 14:57 ` [PATCH 2/8] mshare: selftests: Adding config fragment Yongting Lin
2025-08-25 14:57 ` [PATCH 3/8] mshare: selftests: Add some helper function for mshare filesystem Yongting Lin
2025-08-25 14:57 ` [PATCH 4/8] mshare: selftests: Add test case shared memory Yongting Lin
2025-08-25 14:57 ` [PATCH 5/8] mshare: selftests: Add test case ioctl unmap Yongting Lin
2025-08-25 14:57 ` [PATCH 6/8] mshare: selftests: Add some helper functions for reading and controlling cgroup Yongting Lin
2025-08-25 14:57 ` [PATCH 7/8] mshare: selftests: Add test case to demostrate the swaping of mshare memory Yongting Lin
2025-08-25 14:57 ` [PATCH 8/8] mshare: selftests: Add test case to demostrate that mshare doesn't support THP Yongting Lin
2025-08-26 11:16 ` [PATCH 0/8] Add selftests for mshare Yongting Lin
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=d2ed9b04-8372-47e2-976a-b6a130edc161@oracle.com \
--to=anthony.yznaga@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=khalid@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linyongting@bytedance.com \
--cc=shuah@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;
as well as URLs for NNTP newsgroup(s).