From: Haakon Bugge <haakon.bugge@oracle.com>
To: John Stultz <jstultz@google.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Boqun Feng <boqun@kernel.org>, Waiman Long <longman@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH 1/1] kernel/locking: Add mutual exclusion self-test
Date: Tue, 25 Aug 2026 16:12:22 +0000 [thread overview]
Message-ID: <1DA01181-84A0-4EC3-ABC8-F4097AAD2E40@oracle.com> (raw)
In-Reply-To: <CANDhNCq4k=-Ap-0DUwZTzTCZTTkic3X39vNEpNMi5dCzXLPOXw@mail.gmail.com>
> On 24 Aug 2026, at 23:48, John Stultz <jstultz@google.com> wrote:
>
> On Mon, Aug 24, 2026 at 5:29 AM Haakon Bugge <haakon.bugge@oracle.com> wrote:
> > > On 21 Aug 2026, at 22:42, John Stultz <jstultz@google.com> wrote:
> > >
> > > On Mon, Aug 17, 2026 at 6:03 AM Håkon Bugge <haakon.bugge@oracle.com> wrote:
> > > > diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile
> > > > index cee1901d4cff8..240084b4abbb7 100644
> > > > --- a/kernel/locking/Makefile
> > > > +++ b/kernel/locking/Makefile
> > > > @@ -38,3 +38,4 @@ obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o
> > > > obj-$(CONFIG_LOCK_TORTURE_TEST) += locktorture.o
> > > > obj-$(CONFIG_WW_MUTEX_SELFTEST) += test-ww_mutex.o
> > > > obj-$(CONFIG_LOCK_EVENT_COUNTS) += lock_events.o
> > > > +obj-$(CONFIG_MX_TEST) += mx_test.o
> > >
> > > Total bikeshed item, but both CONFIG_MX_TEST and mx_test are not very
> > > obvious names for someone looking at this make file.
> >
> > I am terrible with names. It's short for Mutual eXclusion. Can of course
> > be spelled out if preferred.
> >
> > [snip]
> >
> > > Apologies, I've not had a chance to apply and try this yet.
> >
> > NP.
> >
> > > So this looks like the test has to be run via module load?
> >
> > It can be run built-in as well, but then only the default test is run.
> >
> > > I almost
> > > never use modules in my test environment, so its often nice to allow
> > > it to be built in and be triggered/re-triggered without having to
> > > unload/reload (assuming this is not something like locktorture which
> > > never finishes - and if that is the case, it might be good to
> > > integrate into the locktorture framework instead of adding a new one).
> >
> > No, this selftest terminates.
> >
> > The script, tools/testing/selftests/locking/mx_test.sh, is written to
> > be robust wrt. module load/unload failures. The reason I prefer to run
> > it as module, is the turn-around time. From an edit, it takes
> > literally only a second to compile the module out-of-tree, another
> > second to copy it to the *updates* on the test server.
>
> Yeah, I can see the benefit in the case where you're testing on the
> machine you build with. However, I've found in cases where you're
> building on a different machine then your testing with, modules can be
> more of a pain to work with.
>
> That's why I've added sysfs interfaces to some tests (test-ww_mutex,
> and my out of tree ksched_football), so this sort of
> module-load-time-testing can be repeatedly re-triggered in a static
> build config.
Those are all good points. But I am alluding to, that since you can
invoke a shell script in a loop loading/unloading a module, a
sysfs interface is strictly not required for testing thoroughly.
> > But if the community prefers that all the tests are run when the test
> > is built-in, the loop looping though the eligible tests can be moved
> > from the script to the C source instead.
>
> I'm not sure if there's a clear community preference. Especially as
> some thought is probably needed as to the sysfs conventions, as
> littering /sys/kerenel/ with a bunch of test driver interfaces might
> not be a great long term solution. But this was just something I
> wanted to raise, as I've found it useful, especially when issues only
> show up after many many iterations of the test.
Let's shelf this until v7.3-rc1 comes out and hopefully a maintainer
can shed some thoughts on this.
Thxs, Håkon
next prev parent reply other threads:[~2026-08-25 16:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 13:02 [PATCH 0/1] kernel/locking: Add mutual exclusion self-test Håkon Bugge
2026-08-17 13:02 ` [PATCH 1/1] " Håkon Bugge
2026-08-21 20:42 ` John Stultz
2026-08-24 12:29 ` Haakon Bugge
2026-08-24 21:48 ` John Stultz
2026-08-25 16:12 ` Haakon Bugge [this message]
2026-08-18 7:54 ` [PATCH 0/1] " Peter Zijlstra
2026-08-18 8:14 ` Haakon Bugge
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=1DA01181-84A0-4EC3-ABC8-F4097AAD2E40@oracle.com \
--to=haakon.bugge@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=boqun@kernel.org \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=shuah@kernel.org \
--cc=will@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