* [PATCH] rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check bnode->snap is done
@ 2023-04-05 2:13 Zqiang
2023-04-05 14:45 ` Uladzislau Rezki
0 siblings, 1 reply; 3+ messages in thread
From: Zqiang @ 2023-04-05 2:13 UTC (permalink / raw)
To: urezki, paulmck, frederic, joel, qiang1.zhang
Cc: qiang.zhang1211, rcu, linux-kernel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check bnode->snap is done
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
0 siblings, 1 reply; 3+ messages in thread
From: Uladzislau Rezki @ 2023-04-05 14:45 UTC (permalink / raw)
To: Zqiang
Cc: urezki, paulmck, frederic, joel, qiang.zhang1211, rcu, linux-kernel
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>
--
Uladzislau Rezki
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check bnode->snap is done
2023-04-05 14:45 ` Uladzislau Rezki
@ 2023-04-05 19:04 ` Paul E. McKenney
0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2023-04-05 19:04 UTC (permalink / raw)
To: Uladzislau Rezki
Cc: Zqiang, frederic, joel, qiang.zhang1211, rcu, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-05 19:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).