mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Boqun Feng <boqun.feng@gmail.com>,
	rcu@vger.kernel.org,  linux-kernel@vger.kernel.org,
	"Paul E. McKenney" <paulmck@kernel.org>,
	 Frederic Weisbecker <frederic@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] rcu: mollify sparse with RCU guard
Date: Tue, 26 Mar 2024 08:53:39 +0100	[thread overview]
Message-ID: <0659e47eb33c4159168abe392764a1de44e9bc71.camel@sipsolutions.net> (raw)
In-Reply-To: <04081c65-f9bf-404c-8557-7af72f6a72de@moroto.mountain>

On Tue, 2024-03-26 at 10:39 +0300, Dan Carpenter wrote:
> On Mon, Mar 25, 2024 at 07:43:18PM +0100, Johannes Berg wrote:
> > On Mon, 2024-03-25 at 21:28 +0300, Dan Carpenter wrote:
> > > On Mon, Mar 25, 2024 at 05:41:22PM +0100, Johannes Berg wrote:
> > > > Also __acquire()/__release() are just empty macros without __CHECKER__.
> > > > So not sure the indirection really is warranted for this special case.
> > > > 
> > > > I can add a comment in there, I guess, something like
> > > > 
> > > >  /* sparse doesn't actually "call" cleanup functions */
> > > > 
> > > > perhaps. That reminds me I forgot to CC Dan ...
> > > > 
> > > 
> > > These are Sparse warnings, not Smatch warning... Smatch doesn't use any
> > > of the Sparse locking annotations.
> > 
> > Sure, of course. I just saw that you added cleanup stuff to sparse to
> > allow using it in smatch.
> > 
> > > Smatch handles cleanup basically correctly at this point.
> > 
> > Do you "run" / "emit" the cleanup function calls there?
> 
> Yes.

I see. I guess that doesn't work for sparse. You write:

   This shouldn't really have been needed if I had written the parse.c
   code correctly to create new scopes for every __cleanup__.

Would that maybe be a way to handle it in sparse? Though not sure how to
return then.

> > I briefly look
> > at doing that in sparse but it felt ... complicated, and then I saw the
> > condition in the cleanup function which I thought sparse could probably
> > not see through anyway.
> 
> The if (_T->lock) statements are a problem.  For those, I have to
> manually add them to check_locking.c as an unlock function and to
> check_preempt.c as a decrement the preempt count function.

OK, no fun.

I think overall it's still easier to go with this patch :)

And maybe we should think about replacing what we need sparse for...

johannes

  reply	other threads:[~2024-03-26  7:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 10:16 Johannes Berg
2024-03-25 16:35 ` Boqun Feng
2024-03-25 16:41   ` Johannes Berg
2024-03-25 17:33     ` Boqun Feng
2024-03-25 18:28     ` Dan Carpenter
2024-03-25 18:43       ` Johannes Berg
2024-03-26  7:39         ` Dan Carpenter
2024-03-26  7:53           ` Johannes Berg [this message]
2024-03-26  8:20             ` Dan Carpenter

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=0659e47eb33c4159168abe392764a1de44e9bc71.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=boqun.feng@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=frederic@kernel.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.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®