Skip to contentSkip to conversation

rcutorture: Fix oops when selecting non-default torture_type

PATCH In review Scott Wood 3 participants 3 messages Mar 22, 2019

Subsystems (2)
lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH 1/1 rcutorture: Fix oops when selecting non-default torture_type

rcu_bh is disabled on PREEMPT_RT via a stub ops that has no name. Thus, if a torture_type other than "rcu" is used, rcu_torture_init() will pass NULL to strcmp() when iterating over torture_ops[], and oops.

---
With this applied to 4.19.25-rt16 and specifying torture_type=sched, similar rcutorture failures are seen as with 5.0.3-rt1 (in which standard torture_cype=rcu no longer has .extendables=0 and thus stresses similar paths).

 kernel/rcu/rcutorture.c | 1 +
 1 file changed, 1 insertion(+)
kernel/rcu/rcutorture.c +1 -0
index 7d2a615601e7..408d03048911 100644
@@ -479,6 +479,7 @@ static struct rcu_torture_ops rcu_bh_ops = {
 #else
 static struct rcu_torture_ops rcu_bh_ops = {
 	.ttype		= INVALID_RCU_FLAVOR,
+	.name		= "rcu_bh"
 };
 #endif
 
Signature · 1 line
2.18.1
#1 lore raw
Quoted 10 lines · Scott Wood

rcu_bh is disabled on PREEMPT_RT via a stub ops that has no name. Thus, if a torture_type other than "rcu" is used, rcu_torture_init() will pass NULL to strcmp() when iterating over torture_ops[], and oops.

---
With this applied to 4.19.25-rt16 and specifying torture_type=sched, similar rcutorture failures are seen as with 5.0.3-rt1 (in which standard torture_cype=rcu no longer has .extendables=0 and thus stresses similar paths).

Anna-Maria was talking about this to me a long time ago, I though we fixed that. But since your patch targets v4.19 it is not the case. As far v4.19 goes, I think it can go in but this is up to Steven now.

Does this still apply to 5.0-RT? The RCU was greatly reworked so it may no longer apply and just work. However the "random context" in rcutorture gives me a headache right now…

Quoted 8 lines
 kernel/rcu/rcutorture.c | 1 +
 1 file changed, 1 insertion(+)
kernel/rcu/rcutorture.c +0 -0
index 7d2a615601e7..408d03048911 100644

kernel/rcu/rcutorture.c static struct rcu_torture_ops rcu_bh_ops = { · line 485

Quoted 7 lines
kernel/rcu/rcutorture.c +1 -0
@@ -479,6 +479,7 @@ static struct rcu_torture_ops rcu_bh_ops = {
 #else
 static struct rcu_torture_ops rcu_bh_ops = {
 	.ttype		= INVALID_RCU_FLAVOR,
+	.name		= "rcu_bh"
 };
 #endif
 

Sebastian

#2 lore raw
In reply to Scott Wood
Quoted 5 lines · Scott Wood

rcu_bh is disabled on PREEMPT_RT via a stub ops that has no name. Thus, if a torture_type other than "rcu" is used, rcu_torture_init() will pass NULL to strcmp() when iterating over torture_ops[], and oops.

This rcu_bh torture type is gone completely in mainline, however, I just yesterday queued a patch to fix some problems when an invalid torture_type was specified.

Mainline 4.19 does have the .name element of rcu_bh_ops specified, though. Not sure what happened here, but you are absolutely correct that rcu_bh_ops does need a .name initializer.

Thanx, Paul

Quoted 24 lines

---
With this applied to 4.19.25-rt16 and specifying torture_type=sched, similar rcutorture failures are seen as with 5.0.3-rt1 (in which standard torture_cype=rcu no longer has .extendables=0 and thus stresses similar paths).

 kernel/rcu/rcutorture.c | 1 +
 1 file changed, 1 insertion(+)
kernel/rcu/rcutorture.c +1 -0
index 7d2a615601e7..408d03048911 100644
@@ -479,6 +479,7 @@ static struct rcu_torture_ops rcu_bh_ops = {
 #else
 static struct rcu_torture_ops rcu_bh_ops = {
 	.ttype		= INVALID_RCU_FLAVOR,
+	.name		= "rcu_bh"
 };
 #endif
 
Signature · 1 line
2.18.1