[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5b341172-5082-4df4-8264-e38a01f7c7d7@lucifer.local>
Date: Wed, 13 Aug 2025 19:52:52 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: David Hildenbrand <david@...hat.com>
Cc: Usama Arif <usamaarif642@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
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,
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 v4 7/7] selftests: prctl: introduce tests for disabling
THPs except for madvise
On Wed, Aug 13, 2025 at 06:24:11PM +0200, David Hildenbrand wrote:
> > > +
> > > +FIXTURE_SETUP(prctl_thp_disable_except_madvise)
> > > +{
> > > + if (!thp_available())
> > > + SKIP(return, "Transparent Hugepages not available\n");
> > > +
> > > + self->pmdsize = read_pmd_pagesize();
> > > + if (!self->pmdsize)
> > > + SKIP(return, "Unable to read PMD size\n");
> > > +
> > > + if (prctl(PR_SET_THP_DISABLE, 1, PR_THP_DISABLE_EXCEPT_ADVISED, NULL, NULL))
> > > + SKIP(return, "Unable to set PR_THP_DISABLE_EXCEPT_ADVISED\n");
> >
> > This should be a test fail I think, as the only ways this could fail are
> > invalid flags, or failure to obtain an mmap write lock.
>
> Running a kernel that does not support it?
I can't see anything in the kernel to #ifdef it out so I suppose you mean
running these tests on an older kernel?
But this is an unsupported way of running self-tests, they are tied to the
kernel version in which they reside, and test that specific version.
Unless I'm missing something here?
>
> We could check the errno to distinguish I guess.
Which one? manpage says -EINVAL, but can also be due to incorrect invocation,
which would mean a typo could mean tests pass but your tests do nothing :)
>
> --
> Cheers,
>
> David / dhildenb
>
Powered by blists - more mailing lists