Skip to contentSkip to conversation

srcutree: Skip torture to-big transition for atomic SRCU

PATCH In review Kunwu Chan 2 participants 2 messages Sep 11

Subsystems (2)
lore
Share & tools
lore

Kunwu Chan

author
#0 lore raw

PATCH v2 1/1 srcutree: Skip torture to-big transition for atomic SRCU

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.

---
Changes:
-add warn on an invalid atomic SRCU sizing configuration.
-v1: https://lore.kernel.org/rcu/[email protected]/

---
 kernel/rcu/srcutree.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/rcu/srcutree.c +4 -2
index 68441c32cebf..60c102a4d057 100644
@@ -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);
 
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 5 lines · 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.

Queued for testing and review, thank you!

Thanx, Paul

Quoted 28 lines

---
Changes:

(quoted diff) +0 -3
-add warn on an invalid atomic SRCU sizing configuration.
-v1: https://lore.kernel.org/rcu/[email protected]/
---
 kernel/rcu/srcutree.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/rcu/srcutree.c +4 -2
index 68441c32cebf..60c102a4d057 100644
@@ -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);
 
Signature · 1 line
2.43.0