From: Yafang Shao <laoar.shao@gmail.com>
To: Usama Arif <usamaarif642@gmail.com>
Cc: akpm@linux-foundation.org, david@redhat.com, ziy@nvidia.com,
baolin.wang@linux.alibaba.com, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, npache@redhat.com,
ryan.roberts@arm.com, dev.jain@arm.com, hannes@cmpxchg.org,
gutierrez.asier@huawei-partners.com, willy@infradead.org,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
ameryhung@gmail.com, rientjes@google.com, bpf@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [RFC PATCH v5 mm-new 5/5] selftest/bpf: add selftest for BPF based THP order seletection
Date: Tue, 19 Aug 2025 11:09:51 +0800 [thread overview]
Message-ID: <CALOAHbCnBBOC_YVGNEEdYrLOBhAqOddA8WKDU88p8uZQStqSbQ@mail.gmail.com> (raw)
In-Reply-To: <8e1ed2ae-bc2b-4ffc-81cd-61ad6878ad0d@gmail.com>
On Mon, Aug 18, 2025 at 10:00 PM Usama Arif <usamaarif642@gmail.com> wrote:
>
>
>
> On 18/08/2025 06:55, Yafang Shao wrote:
> > This self-test verifies that PMD-mapped THP allocation is restricted in
> > page faults for tasks within a specific cgroup, while still permitting
> > THP allocation via khugepaged.
> >
> > Since THP allocation depends on various factors (e.g., system memory
> > pressure), using the actual allocated THP size for validation is
> > unreliable. Instead, we check the return value of get_suggested_order(),
> > which indicates whether the system intends to allocate a THP, regardless of
> > whether the allocation ultimately succeeds.
> >
> > Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> > ---
> > tools/testing/selftests/bpf/config | 3 +
> > .../selftests/bpf/prog_tests/thp_adjust.c | 224 ++++++++++++++++++
> > .../selftests/bpf/progs/test_thp_adjust.c | 76 ++++++
> > .../bpf/progs/test_thp_adjust_failure.c | 25 ++
> > 4 files changed, 328 insertions(+)
> > create mode 100644 tools/testing/selftests/bpf/prog_tests/thp_adjust.c
> > create mode 100644 tools/testing/selftests/bpf/progs/test_thp_adjust.c
> > create mode 100644 tools/testing/selftests/bpf/progs/test_thp_adjust_failure.c
> >
>
> I think would be good to add selftests to make sure the bpf programs are working
> after fork/exec as intended.
Good suggestion. I will add a self test for it.
--
Regards
Yafang
next prev parent reply other threads:[~2025-08-19 3:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 5:55 [RFC PATCH v5 mm-new 0/5] mm, bpf: BPF based THP order selection Yafang Shao
2025-08-18 5:55 ` [RFC PATCH v5 mm-new 1/5] mm: thp: add support for " Yafang Shao
2025-08-18 13:17 ` Usama Arif
2025-08-19 3:08 ` Yafang Shao
2025-08-19 10:11 ` Usama Arif
2025-08-19 11:10 ` Gutierrez Asier
2025-08-19 11:43 ` Yafang Shao
2025-08-18 5:55 ` [RFC PATCH v5 mm-new 2/5] mm: thp: add a new kfunc bpf_mm_get_mem_cgroup() Yafang Shao
2025-08-18 5:55 ` [RFC PATCH v5 mm-new 3/5] mm: thp: add a new kfunc bpf_mm_get_task() Yafang Shao
2025-08-18 5:55 ` [RFC PATCH v5 mm-new 4/5] bpf: mark vma->vm_mm as trusted Yafang Shao
2025-08-18 5:55 ` [RFC PATCH v5 mm-new 5/5] selftest/bpf: add selftest for BPF based THP order seletection Yafang Shao
2025-08-18 14:00 ` Usama Arif
2025-08-19 3:09 ` Yafang Shao [this message]
2025-08-18 14:35 ` [RFC PATCH v5 mm-new 0/5] mm, bpf: BPF based THP order selection Usama Arif
2025-08-19 2:41 ` Yafang Shao
2025-08-19 10:44 ` Usama Arif
2025-08-19 11:33 ` Yafang Shao
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=CALOAHbCnBBOC_YVGNEEdYrLOBhAqOddA8WKDU88p8uZQStqSbQ@mail.gmail.com \
--to=laoar.shao@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=gutierrez.asier@huawei-partners.com \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=npache@redhat.com \
--cc=rientjes@google.com \
--cc=ryan.roberts@arm.com \
--cc=usamaarif642@gmail.com \
--cc=willy@infradead.org \
--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