From: "Paul E. McKenney" <paulmck@kernel.org>
To: Hou Tao <houtao1@huawei.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Josh Triplett <josh@joshtriplett.org>,
linux-kernel@vger.kernel.org, rcu@vger.kernel.org
Subject: Re: [PATCH 1/2] locktorture: doesn't check nreaders_stress when no readlock support
Date: Thu, 17 Sep 2020 20:37:55 -0700 [thread overview]
Message-ID: <20200918033755.GS29330@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <86bc5a54-5dfa-4320-9e10-9660a25724d0@huawei.com>
On Fri, Sep 18, 2020 at 09:13:14AM +0800, Hou Tao wrote:
> Hi Paul,
>
> On 2020/9/18 0:58, Paul E. McKenney wrote:
> > On Thu, Sep 17, 2020 at 09:59:09PM +0800, Hou Tao wrote:
> >> To ensure there is always at least one locking thread.
> >>
> >> Signed-off-by: Hou Tao <houtao1@huawei.com>
> >> ---
> >> kernel/locking/locktorture.c | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
> >> index 9cfa5e89cff7f..bebdf98e6cd78 100644
> >> --- a/kernel/locking/locktorture.c
> >> +++ b/kernel/locking/locktorture.c
> >> @@ -868,7 +868,8 @@ static int __init lock_torture_init(void)
> >> goto unwind;
> >> }
> >>
> >> - if (nwriters_stress == 0 && nreaders_stress == 0) {
> >> + if (nwriters_stress == 0 &&
> >> + (!cxt.cur_ops->readlock || nreaders_stress == 0)) {
> >
> > You lost me on this one. How does it help to allow tests with zero
> > writers on exclusive locks? Or am I missing something subtle here?
> >
> The purpose is to prohibit test with only readers on exclusive locks, not allow it.
>
> So if the module parameters are "torture_type=mutex_lock nwriters_stress=0 nreaders_stress=3",
> locktorture can fail early instead of continuing but doing nothing useful.
Very good!
Now please make that clear in the commit log. (Your English looks to
me to be more than equal to that challenge.)
In this commit log, please first state what is wrong. Then what the
change is and how it improves things.
Thanx, Paul
> Regards,
> Tao
>
> > Thanx, Paul
> >
> >> pr_alert("lock-torture: must run at least one locking thread\n");
> >> firsterr = -EINVAL;
> >> goto unwind;
> >> --
> >> 2.25.0.4.g0ad7144999
> >>
> > .
> >
next prev parent reply other threads:[~2020-09-18 3:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 13:59 [PATCH 0/2] two tiny fixes for locktorture Hou Tao
2020-09-17 13:59 ` [PATCH 1/2] locktorture: doesn't check nreaders_stress when no readlock support Hou Tao
2020-09-17 16:58 ` Paul E. McKenney
2020-09-18 1:13 ` Hou Tao
2020-09-18 3:37 ` Paul E. McKenney [this message]
2020-09-18 11:44 ` [PATCH v2 " Hou Tao
2020-09-18 17:59 ` Paul E. McKenney
2020-09-19 3:25 ` Hou Tao
2020-09-17 13:59 ` [PATCH 2/2] locktorture: call percpu_free_rwsem() to do percpu-rwsem cleanup Hou Tao
2020-09-22 23:24 ` Paul E. McKenney
2020-09-23 2:24 ` Hou Tao
2020-09-23 3:51 ` Paul E. McKenney
2020-09-24 14:18 ` [PATCH v2 " Hou Tao
2020-09-25 17:13 ` Paul E. McKenney
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=20200918033755.GS29330@paulmck-ThinkPad-P72 \
--to=paulmck@kernel.org \
--cc=dave@stgolabs.net \
--cc=houtao1@huawei.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rcu@vger.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
all inboxes | Powered by JetHome®