[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a385e09f-f582-4ede-9e60-1d85cee02a3c@redhat.com>
Date: Mon, 18 Aug 2025 11:36:36 +0200
From: David Hildenbrand <david@...hat.com>
To: Usama Arif <usamaarif642@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org
Cc: linux-fsdevel@...r.kernel.org, corbet@....net, rppt@...nel.org,
surenb@...gle.com, mhocko@...e.com, hannes@...xchg.org, baohua@...nel.org,
shakeel.butt@...ux.dev, riel@...riel.com, ziy@...dia.com,
laoar.shao@...il.com, dev.jain@....com, baolin.wang@...ux.alibaba.com,
npache@...hat.com, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com,
ryan.roberts@....com, vbabka@...e.cz, jannh@...gle.com,
Arnd Bergmann <arnd@...db.de>, sj@...nel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, kernel-team@...a.com
Subject: Re: [PATCH v5 6/7] selftests: prctl: introduce tests for disabling
THPs completely
> +
> +TEST_F(prctl_thp_disable_completely, fork)
> +{
> + int ret = 0;
> + pid_t pid;
> +
> + /* Make sure prctl changes are carried across fork */
> + pid = fork();
> + ASSERT_GE(pid, 0);
> +
> + if (!pid)
> + prctl_thp_disable_completely_test(_metadata, self->pmdsize, variant->thp_policy);
> +
Skimming over this once more ... this raises two questions
(a) There is nothing to wait for in the child
(b) Does it work when we return in the child from this function?
I think (b) works by design of the kselftest_harness, as this function is
itself executed from a child process.
Regarding (a), it might be cleaner to just
index 77c53a91124f1..1a48bcf2e9160 100644
--- a/tools/testing/selftests/mm/prctl_thp_disable.c
+++ b/tools/testing/selftests/mm/prctl_thp_disable.c
@@ -271,9 +271,11 @@ TEST_F(prctl_thp_disable_except_madvise, fork)
pid = fork();
ASSERT_GE(pid, 0);
- if (!pid)
+ if (!pid) {
prctl_thp_disable_except_madvise_test(_metadata, self->pmdsize,
variant->thp_policy);
+ return;
+ }
wait(&ret);
if (WIFEXITED(ret))
Same probably applies to patch #7. Feel free to send simple fixup patches
that Andrew can squash. No need for a full resend.
--
Cheers
David / dhildenb
Powered by blists - more mailing lists