mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] srcutree: Skip torture to-big transition for atomic SRCU
@ 2026-09-11  4:02 Kunwu Chan
  2026-09-11 16:40 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Kunwu Chan @ 2026-09-11  4:02 UTC (permalink / raw)
  To: jiangshanlai, paulmck
  Cc: josh, rostedt, mathieu.desnoyers, rcu, linux-kernel, Kunwu Chan

Atomic SRCU does not use the srcu_node combining tree. Exclude it
from the SRCU_SIZING_IS_TORTURE() transition in
srcu_torture_stats_print(), and warn if such a transition is requested.

Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
---
Changes:
-add warn on an invalid atomic SRCU sizing configuration.
-v1: https://lore.kernel.org/rcu/20260910041427.3579817-1-kunwu.chan@gmail.com/
---
 kernel/rcu/srcutree.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 68441c32cebf..60c102a4d057 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -2422,8 +2422,10 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
 		}
 		pr_cont(" T(%ld,%ld)\n", s0, s1);
 	}
-	if (SRCU_SIZING_IS_TORTURE())
-		srcu_transition_to_big(ssp);
+	if (SRCU_SIZING_IS_TORTURE()) {
+		if (!WARN_ON_ONCE(ssp->srcu_reader_flavor == SRCU_READ_FLAVOR_ATOMIC))
+			srcu_transition_to_big(ssp);
+	}
 }
 EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] srcutree: Skip torture to-big transition for atomic SRCU
  2026-09-11  4:02 [PATCH v2] srcutree: Skip torture to-big transition for atomic SRCU Kunwu Chan
@ 2026-09-11 16:40 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2026-09-11 16:40 UTC (permalink / raw)
  To: Kunwu Chan
  Cc: jiangshanlai, josh, rostedt, mathieu.desnoyers, rcu, linux-kernel

On Fri, Sep 11, 2026 at 12:02:51PM +0800, Kunwu Chan wrote:
> Atomic SRCU does not use the srcu_node combining tree. Exclude it
> from the SRCU_SIZING_IS_TORTURE() transition in
> srcu_torture_stats_print(), and warn if such a transition is requested.
> 
> Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>

Queued for testing and review, thank you!

							Thanx, Paul

> ---
> Changes:
> -add warn on an invalid atomic SRCU sizing configuration.
> -v1: https://lore.kernel.org/rcu/20260910041427.3579817-1-kunwu.chan@gmail.com/
> ---
>  kernel/rcu/srcutree.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> index 68441c32cebf..60c102a4d057 100644
> --- a/kernel/rcu/srcutree.c
> +++ b/kernel/rcu/srcutree.c
> @@ -2422,8 +2422,10 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
>  		}
>  		pr_cont(" T(%ld,%ld)\n", s0, s1);
>  	}
> -	if (SRCU_SIZING_IS_TORTURE())
> -		srcu_transition_to_big(ssp);
> +	if (SRCU_SIZING_IS_TORTURE()) {
> +		if (!WARN_ON_ONCE(ssp->srcu_reader_flavor == SRCU_READ_FLAVOR_ATOMIC))
> +			srcu_transition_to_big(ssp);
> +	}
>  }
>  EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
>  
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-11 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11  4:02 [PATCH v2] srcutree: Skip torture to-big transition for atomic SRCU Kunwu Chan
2026-09-11 16:40 ` 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

all inboxes | Powered by JetHome®