From: Wei Yang <richard.weiyang@gmail.com>
To: wang lian <lianux.mm@gmail.com>
Cc: richard.weiyang@gmail.com, akpm@linux-foundation.org,
baolin.wang@linux.alibaba.com, david@redhat.com,
donettom@linux.ibm.com, linux-kselftest@vger.kernel.org,
linux-mm@kvack.org, ryan.roberts@arm.com, ziy@nvidia.com
Subject: Re: [PATCH] selftests/mm: refactore split_huge_page_test with kselftest_harness
Date: Fri, 5 Sep 2025 13:43:14 +0000 [thread overview]
Message-ID: <20250905134314.vtc4qspuyfjp4oah@master> (raw)
In-Reply-To: <20250905091029.81259-1-lianux.mm@gmail.com>
On Fri, Sep 05, 2025 at 05:10:29PM +0800, wang lian wrote:
>
>> Refactor split_huge_page_test with kselftest_harness, since there is a
>> magic counting about valid tests.
>
>> The idea is simple:
>
>> For standalone test, put it into TEST().
>
>> For tests iterating order/offset, define fixture and variant with
>> order and offset. And skip it if order/offset is not valid.
>
>> No functional change is expected.
>
>Sounds good.
>
>> -static void split_pmd_zero_pages(void)
>> +TEST(split_pmd_zero_pages)
>> {
>> char *one_page;
>> int nr_hpages = 4;
>> size_t len = nr_hpages * pmd_pagesize;
>
>nr_hpages and len appeared many times and
>david use nr_thps and thp_area_size rename it.
>and maybe we can unify it and make it into FIXTURE and init.
>
Thanks for your suggestion.
Let's see whether this refactor is reasonable first.
The first step is try to preserve the logic to make sure there is not
functional change. After this, we can have this refine in a separate
patch.
>> + prepare_proc_fd();
>> +
>> one_page = allocate_zero_filled_hugepage(len);
>> verify_rss_anon_split_huge_page_all_zeroes(one_page, nr_hpages, len);
>> - ksft_test_result_pass("Split zero filled huge pages successful\n");
>> free(one_page);
>> +
>> + cleanup_proc_fd();
>> }
>
>
>
>Best regards,
>wang lian
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2025-09-05 13:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 3:24 Wei Yang
2025-09-05 9:10 ` wang lian
2025-09-05 13:43 ` Wei Yang [this message]
2025-09-05 11:33 ` Donet Tom
2025-09-05 13:39 ` Wei Yang
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=20250905134314.vtc4qspuyfjp4oah@master \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=donettom@linux.ibm.com \
--cc=lianux.mm@gmail.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryan.roberts@arm.com \
--cc=ziy@nvidia.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