rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Uladzislau Rezki <urezki@gmail.com>
Cc: Zqiang <qiang1.zhang@intel.com>,
	frederic@kernel.org, joel@joelfernandes.org,
	qiang.zhang1211@gmail.com, rcu@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check bnode->snap is done
Date: Wed, 5 Apr 2023 12:04:03 -0700	[thread overview]
Message-ID: <bb56bb43-fc3e-42fd-9bdb-78e70a400daf@paulmck-laptop> (raw)
In-Reply-To: <ZC2Jh6CaeHHpkWLW@pc636>

On Wed, Apr 05, 2023 at 04:45:27PM +0200, Uladzislau Rezki wrote:
> On Wed, Apr 05, 2023 at 10:13:59AM +0800, Zqiang wrote:
> > This commit make debug_rcu_bhead_unqueue() be invoked with check
> > the bnode structure's->snap is done in kvfree_rcu_bulk().
> > 
> > Signed-off-by: Zqiang <qiang1.zhang@intel.com>
> > ---
> >  kernel/rcu/tree.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index 3461fc2640b9..17b5d115aec1 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -2943,8 +2943,8 @@ kvfree_rcu_bulk(struct kfree_rcu_cpu *krcp,
> >  	unsigned long flags;
> >  	int i;
> >  
> > -	debug_rcu_bhead_unqueue(bnode);
> >  	if (!WARN_ON_ONCE(!poll_state_synchronize_rcu_full(&bnode->gp_snap))) {
> > +		debug_rcu_bhead_unqueue(bnode);
> >  		rcu_lock_acquire(&rcu_callback_map);
> >  		if (idx == 0) { // kmalloc() / kfree().
> >  			trace_rcu_invoke_kfree_bulk_callback(
> > -- 
> > 2.32.0
> >
> Since we leak, looks like correct to me:
> 
> Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

Queued for v6.5, thank you both!

							Thanx, Paul

      reply	other threads:[~2023-04-05 19:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05  2:13 [PATCH] rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check bnode->snap is done Zqiang
2023-04-05 14:45 ` Uladzislau Rezki
2023-04-05 19:04   ` 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=bb56bb43-fc3e-42fd-9bdb-78e70a400daf@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiang.zhang1211@gmail.com \
    --cc=qiang1.zhang@intel.com \
    --cc=rcu@vger.kernel.org \
    --cc=urezki@gmail.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;
as well as URLs for NNTP newsgroup(s).