All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Marco Elver <elver@google.com>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>,
	rcu <rcu@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	kunit-dev@googlegroups.com, lkft-triage@lists.linaro.org,
	kasan-dev <kasan-dev@googlegroups.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Netdev <netdev@vger.kernel.org>,
	Anders Roxell <anders.roxell@linaro.org>
Subject: Re: arm64: allmodconfig: BUG: KCSAN: data-race in p9_client_cb / p9_client_rpc
Date: Mon, 5 Dec 2022 16:13:17 +0900	[thread overview]
Message-ID: <Y42aDQ0ZOUt4dvYc@codewreck.org> (raw)
In-Reply-To: <CANpmjNPXhEB6GeMT70UT1e-8zTHf3gY21E3wx-27VjChQ0x2gA@mail.gmail.com>

Marco Elver wrote on Mon, Dec 05, 2022 at 08:00:00AM +0100:
> > Should I just update the wrapped condition, as below?
> >
> > -       err = wait_event_killable(req->wq, req->status >= REQ_STATUS_RCVD);
> > +       err = wait_event_killable(req->wq,
> > +                                 READ_ONCE(req->status) >= REQ_STATUS_RCVD);
> 
> Yes, this looks good!
> 
> > The writes all are straightforward, there's all the error paths to
> > convert to WRITE_ONCE too but that's not difficult (leaving only the
> > init without such a marker); I'll send a patch when you've confirmed the
> > read looks good.
> > (the other reads are a bit less obvious as some are protected by a lock
> > in trans_fd, which should cover all cases of possible concurrent updates
> > there as far as I can see, but this mixed model is definitely hard to
> > reason with... Well, that's how it was written and I won't ever have time
> > to rewrite any of this. Enough ranting.)
> 
> If the lock-protected accesses indeed are non-racy, they should be
> left unmarked. If some assumption here turns out to be wrong, KCSAN
> would (hopefully) tell us one way or another.

Great, that makes sense.

I've left the commit at home, will submit it tonight -- you and Naresh
will be in Cc from suggested/reported-by tags.

-- 
Dominique

      reply	other threads:[~2022-12-05  7:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 12:50 arm64: allmodconfig: BUG: KCSAN: data-race in p9_client_cb / p9_client_rpc Naresh Kamboju
2022-11-30 12:54 ` Marco Elver
2022-11-30 16:04   ` Naresh Kamboju
2022-11-30 20:04     ` Dominique Martinet
2022-12-01  7:43       ` Naresh Kamboju
2022-12-03 15:36         ` Dominique Martinet
2022-12-03 16:46           ` Marco Elver
2022-12-03 23:08             ` Dominique Martinet
2022-12-05  7:00               ` Marco Elver
2022-12-05  7:13                 ` Dominique Martinet [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=Y42aDQ0ZOUt4dvYc@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=anders.roxell@linaro.org \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.