All of lore.kernel.org
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Uladzislau Rezki <urezki@gmail.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	LKML <linux-kernel@vger.kernel.org>, RCU <rcu@vger.kernel.org>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>,
	Jens Axboe <axboe@kernel.dk>,
	Philipp Reisner <philipp.reisner@linbit.com>,
	Bryan Tan <bryantan@vmware.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Eric Dumazet <edumazet@google.com>,
	Bob Pearson <rpearsonhpe@gmail.com>,
	Ariel Levkovich <lariel@nvidia.com>,
	Theodore Ts'o <tytso@mit.edu>, Julian Anastasov <ja@ssi.bg>
Subject: Re: [PATCH 13/13] rcu/kvfree: Eliminate k[v]free_rcu() single argument macro
Date: Mon, 6 Mar 2023 18:10:06 +0100	[thread overview]
Message-ID: <ZAYebhiXJAct1vUS@pc636> (raw)
In-Reply-To: <20230306165501.GX1301832@paulmck-ThinkPad-P17-Gen-1>

On Mon, Mar 06, 2023 at 08:55:01AM -0800, Paul E. McKenney wrote:
> On Mon, Mar 06, 2023 at 05:42:44PM +0100, Uladzislau Rezki wrote:
> > On Mon, Mar 06, 2023 at 03:12:03PM +0000, Joel Fernandes wrote:
> > > On Mon, Mar 06, 2023 at 07:01:08AM -0800, Paul E. McKenney wrote:
> > > [..] 
> > > > > > 7.	We then evaluate whether further cleanups are needed.
> > > > > > 
> > > > > > > > My feeling is
> > > > > > > > that, we introduced "_mightsleep" macros first and after that try to
> > > > > > > > convert users.
> > > > > > 
> > > > > > > One stopgap could be to add a checkpatch error if anyone tries to use old API,
> > > > > > > and then in the meanwhile convert all users.
> > > > > > > Though, that requires people listening to checkpatch complaints.
> > > > > > 
> > > > > > Every person who listens is that much less hassle.  It doesn't have to
> > > > > > be perfect.  ;-)
> > > > > 
> > > > > The below checkpatch change can catch at least simple single-arg uses (i.e.
> > > > > not having compound expressions inside of k[v]free_rcu() args). I will submit
> > > > > a proper patch to it which we can include in this set.
> > > > > 
> > > > > Thoughts?
> > > > > ---
> > > > >  scripts/checkpatch.pl | 9 +++++++++
> > > > >  1 file changed, 9 insertions(+)
> > > > > 
> > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > > > index 78cc595b98ce..fc73786064b3 100755
> > > > > --- a/scripts/checkpatch.pl
> > > > > +++ b/scripts/checkpatch.pl
> > > > > @@ -6362,6 +6362,15 @@ sub process {
> > > > >  			}
> > > > >  		}
> > > > >  
> > > > > +# check for soon-to-be-deprecated single-argument k[v]free_rcu() API
> > > > > +		if ($line =~ /\bk[v]?free_rcu\s*\([^(]+\)/) {
> > > > > +			if ($line =~ /\bk[v]?free_rcu\s*\([^,]+\)/) {
> > > > > +				ERROR("DEPRECATED_API",
> > > > > +				      "Single-argument k[v]free_rcu() API is deprecated, please pass an rcu_head object." . $herecurr);
> > > > 
> > > > Nice!
> > > > 
> > > > But could you please also tell them what to use instead?  Sure, they
> > > > could look it up, but if it tells them directly, they are less likely
> > > > to ignore it.
> > > 
> > > Sounds good, I will modify the warning to include the API to call and send
> > > out a patch soon.
> > > 
> > Maybe compile warnings? Or is it too aggressive?
> 
> That is an excellent option if people ignore the checkpatch.pl warnings,
> thus forcing us to delay past v6.5.  So Murphy would argue that we will
> in fact take your good advice at some point.  ;-)
> 
OK. On this step it sounds like a bit aggressive. checkpatch.pl should
be fine as a light reminder :)

--
Uladzislau Rezki

  reply	other threads:[~2023-03-06 17:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 15:09 [PATCH 10/13] ipvs: Rename kfree_rcu() to kfree_rcu_mightsleep() Uladzislau Rezki (Sony)
2023-02-01 15:09 ` [PATCH 11/13] rcuscale: " Uladzislau Rezki (Sony)
2023-02-01 15:09 ` [PATCH 12/13] doc: Update whatisRCU.rst Uladzislau Rezki (Sony)
2023-02-01 15:09 ` [PATCH 13/13] rcu/kvfree: Eliminate k[v]free_rcu() single argument macro Uladzislau Rezki (Sony)
2023-03-05 10:29   ` Joel Fernandes
2023-03-05 10:49     ` Joel Fernandes
2023-03-05 11:41       ` Uladzislau Rezki
2023-03-05 12:56         ` Joel Fernandes
2023-03-05 18:05           ` Paul E. McKenney
2023-03-06 14:49             ` Joel Fernandes
2023-03-06 15:01               ` Paul E. McKenney
2023-03-06 15:12                 ` Joel Fernandes
2023-03-06 16:42                   ` Uladzislau Rezki
2023-03-06 16:55                     ` Paul E. McKenney
2023-03-06 17:10                       ` Uladzislau Rezki [this message]
2023-03-06 19:54                         ` Joel Fernandes
2023-02-01 15:53 ` [PATCH 10/13] ipvs: Rename kfree_rcu() to kfree_rcu_mightsleep() Pablo Neira Ayuso
2023-02-01 16:12   ` Julian Anastasov
2023-02-01 16:52     ` Uladzislau Rezki
2023-02-01 17:10     ` Pablo Neira Ayuso
2023-02-01 17:19       ` Uladzislau Rezki
2023-03-09  0:11         ` Joel Fernandes
2023-03-09  9:19           ` Pablo Neira Ayuso
2023-03-10  1:08             ` Joel Fernandes

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=ZAYebhiXJAct1vUS@pc636 \
    --to=urezki@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bryantan@vmware.com \
    --cc=edumazet@google.com \
    --cc=ja@ssi.bg \
    --cc=joel@joelfernandes.org \
    --cc=lariel@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksiy.avramchenko@sony.com \
    --cc=paulmck@kernel.org \
    --cc=philipp.reisner@linbit.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=rpearsonhpe@gmail.com \
    --cc=tytso@mit.edu \
    /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.