From: "Paul E. McKenney" <paulmck@kernel.org>
To: John Stultz <jstultz@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Davidlohr Bueso <dave@stgolabs.net>,
Josh Triplett <josh@joshtriplett.org>,
Joel Fernandes <joel@joelfernandes.org>,
Juri Lelli <juri.lelli@redhat.com>,
Valentin Schneider <vschneid@redhat.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>
Subject: Re: [RFC][PATCH 1/4] locktorture: Add nested_[un]lock() hooks and nlocks parameter
Date: Thu, 2 Feb 2023 20:29:04 -0800 [thread overview]
Message-ID: <20230203042904.GE2948950@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <CANDhNCrSCrCgGDaGstS9=3vEqow=iiF5qWOhbzrstMbD5afXAQ@mail.gmail.com>
On Thu, Feb 02, 2023 at 07:56:05PM -0800, John Stultz wrote:
> On Thu, Feb 2, 2023 at 6:05 PM Paul E. McKenney <paulmck@kernel.org> wrote:
> >
> > On Thu, Feb 02, 2023 at 10:34:06PM +0000, John Stultz wrote:
> > > In order ot extend locktorture to support lock nesting, add
> > > nested_lock() and nested_unlock() hooks to the torture ops.
> > >
> > > These take a 32bit lockset mask which is generated at random,
> > > so some number of locks will be taken before the main lock is
> > > taken and released afterwards.
> > >
> > > Additionally, add nlocks module parameter to allow specifying
> > > the number of nested locks to be used.
> > >
> > > This has been helpful to uncover issues in the proxy-exec
> > > series development.
> > >
> > > This was inspired by locktorture extensions originally implemented
> > > by Connor O'Brien, for stress testing the proxy-execution series:
> > > https://lore.kernel.org/lkml/20221003214501.2050087-12-connoro@google.com/
> > >
> > > Comments or feedback would be greatly appreciated!
> >
> > I have pulled this in for testing and further review, thank you!
> >
> > Should either of these files have a locktorture.nlocks=<whatever>
> > added?
> >
> > tools/testing/selftests/rcutorture/configs/lock/LOCK02.boot
> > tools/testing/selftests/rcutorture/configs/lock/LOCK05.boot
> >
> > The first is for mutex_lock and the second for rtmutex_lock.
>
> Potentially? I wasn't aware of these files. Is there some
> documentation on the intent behind them?
There is a LOCK02 file that contains Kconfig options and the LOCK02.boot
file contains kernel boot parameters. There is a CFLIST file that
contains the list of such files that the command below will test by
default.
The best documentation is probably here:
https://paulmck.livejournal.com/57769.html
https://paulmck.livejournal.com/58077.html
> While the nested locking is useful to cause different lock chains to
> test boosting or proxy-execution, I worry they may cause extra noise
> that could distract from just thrashing the *mutex lock primitive if
> that's the existing intent.
The intent is to find bugs by whatever means necessary, within reason.
> So we might want additional config files for the nested case.
That would work.
> > This did pass a quick "torture.sh --do-none --do-locktorture", which is
> > good, but this uses the existing .boot files.
>
> Yeah, probably no effective change in that case.
At least nothing else got broken. ;-)
Thanx, Paul
prev parent reply other threads:[~2023-02-03 4:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 22:34 John Stultz
2023-02-02 22:34 ` [RFC][PATCH 2/4] locktorture: Add nested locking to mutex torture tests John Stultz
2023-02-02 22:34 ` [RFC][PATCH 3/4] locktorture: Add nested locking to rtmutex " John Stultz
2023-02-02 22:34 ` [RFC][PATCH 4/4] locktorture: With nested locks, occasionally skip main lock John Stultz
2023-02-03 2:05 ` [RFC][PATCH 1/4] locktorture: Add nested_[un]lock() hooks and nlocks parameter Paul E. McKenney
2023-02-03 3:56 ` John Stultz
2023-02-03 4:29 ` Paul E. McKenney [this message]
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=20230203042904.GE2948950@paulmck-ThinkPad-P17-Gen-1 \
--to=paulmck@kernel.org \
--cc=dave@stgolabs.net \
--cc=dietmar.eggemann@arm.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=jstultz@google.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vschneid@redhat.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
all inboxes | Powered by JetHome®