Skip to contentSkip to conversation

RCU/lock torture updates for v6.8

PATCH New Neeraj Upadhyay (AMD) 1 participant 5 messages Dec 12, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover RCU/lock torture updates for v6.8

Hello,

This series contains torture-test updates:

1. Increase Hamming distance between call_rcu_chain and
rcu_call_chains.

2. add nolibc init support for mips, ppc and rv64, courtesy of
Thomas Weißschuh.

3. Add mid-sized stall to TREE07.

4. Add fqs_holdoff check before fqs_task is created, courtesy
of Zqiang.

Thanks
Neeraj

------------------------------------------------------------------------

 kernel/locking/locktorture.c                               |   18 +++++++++---------
 kernel/rcu/rcutorture.c                                    |    4 +++-
 tools/testing/selftests/rcutorture/bin/mkinitrd.sh         |    5 ++++-
 tools/testing/selftests/rcutorture/configs/rcu/TREE07.boot |    3 +++
 4 files changed, 19 insertions(+), 11 deletions(-)
#1 lore raw

PATCH 1/4 locktorture: Increase Hamming distance between call_rcu_chain and rcu_call_chains

From: "Paul E. McKenney" <[email protected]>

One letter difference is really not enough, so this commit changes call_rcu_chain to call_rcu_chain_list.

---
 kernel/locking/locktorture.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
kernel/locking/locktorture.c +9 -9
index 69d3cd2cfc3b..415d81e6ce70 100644
@@ -124,7 +124,7 @@ struct call_rcu_chain {
 	struct rcu_head crc_rh;
 	bool crc_stop;
 };
-struct call_rcu_chain *call_rcu_chain;
+struct call_rcu_chain *call_rcu_chain_list;
 
 /* Forward reference. */
 static void lock_torture_cleanup(void);
@@ -1074,12 +1074,12 @@ static int call_rcu_chain_init(void)
 
 	if (call_rcu_chains <= 0)
 		return 0;
-	call_rcu_chain = kcalloc(call_rcu_chains, sizeof(*call_rcu_chain), GFP_KERNEL);
-	if (!call_rcu_chain)
+	call_rcu_chain_list = kcalloc(call_rcu_chains, sizeof(*call_rcu_chain_list), GFP_KERNEL);
+	if (!call_rcu_chain_list)
 		return -ENOMEM;
 	for (i = 0; i < call_rcu_chains; i++) {
-		call_rcu_chain[i].crc_stop = false;
-		call_rcu(&call_rcu_chain[i].crc_rh, call_rcu_chain_cb);
+		call_rcu_chain_list[i].crc_stop = false;
+		call_rcu(&call_rcu_chain_list[i].crc_rh, call_rcu_chain_cb);
 	}
 	return 0;
 }
@@ -1089,13 +1089,13 @@ static void call_rcu_chain_cleanup(void)
 {
 	int i;
 
-	if (!call_rcu_chain)
+	if (!call_rcu_chain_list)
 		return;
 	for (i = 0; i < call_rcu_chains; i++)
-		smp_store_release(&call_rcu_chain[i].crc_stop, true);
+		smp_store_release(&call_rcu_chain_list[i].crc_stop, true);
 	rcu_barrier();
-	kfree(call_rcu_chain);
-	call_rcu_chain = NULL;
+	kfree(call_rcu_chain_list);
+	call_rcu_chain_list = NULL;
 }
 
 static void lock_torture_cleanup(void)
Signature · 1 line
2.40.1
#2 lore raw

PATCH 2/4 rcutorture: add nolibc init support for mips, ppc and rv64

In reply to Neeraj Upadhyay (AMD)

From: Thomas Weißschuh <[email protected]>

Use nolibc for all support architectures.

---
 tools/testing/selftests/rcutorture/bin/mkinitrd.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/rcutorture/bin/mkinitrd.sh +4 -1
index 212c52ca90b5..f3f867129560 100755
@@ -67,7 +67,10 @@ ___EOF___
 # build using nolibc on supported archs (smaller executable) and fall
 # back to regular glibc on other ones.
 if echo -e "#if __x86_64__||__i386__||__i486__||__i586__||__i686__" \
-	   "||__ARM_EABI__||__aarch64__||__s390x__||__loongarch__\nyes\n#endif" \
+	   "||__ARM_EABI__||__aarch64__||(__mips__ && _ABIO32)" \
+	   "||__powerpc__||(__riscv && __riscv_xlen == 64)" \
+	   "||__s390x__||__loongarch__" \
+	   "\nyes\n#endif" \
    | ${CROSS_COMPILE}gcc -E -nostdlib -xc - \
    | grep -q '^yes'; then
 	# architecture supported by nolibc
Signature · 1 line
2.40.1
#3 lore raw

PATCH 3/4 rcutorture: Add mid-sized stall to TREE07

In reply to Neeraj Upadhyay (AMD)

From: "Paul E. McKenney" <[email protected]>

There is code in rcu_implicit_dynticks_qs() that checks for the current grace period being halfway to the RCU CPU stall timeout, but rcutorture currently does not test this code. This commit therefore adds a 14-second stall to the TREE07 scenario in order to test this code given the default RCU CPU stall warning timeout of 21 seconds.

---
 tools/testing/selftests/rcutorture/configs/rcu/TREE07.boot | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/rcutorture/configs/rcu/TREE07.boot +3 -0
index d44609937503..979edbf4c820 100644
@@ -1 +1,4 @@
 nohz_full=2-9
+rcutorture.stall_cpu=14
+rcutorture.stall_cpu_holdoff=90
+rcutorture.fwd_progress=0
Signature · 1 line
2.40.1
#4 lore raw

PATCH 4/4 rcutorture: Add fqs_holdoff check before fqs_task is created

In reply to Neeraj Upadhyay (AMD)

From: Zqiang <[email protected]>

For rcutorture tests on RCU implementations that support force-quiescent-state operations and that set the fqs_duration module parameter greater than zero, the fqs_task kthread will be created. However, if the fqs_holdoff module parameter is not set, then its default value of zero will cause fqs_task enter a long-term busy loop until stopped by kthread_stop(). This commit therefore adds a fqs_holdoff check before the fqs_task is created, making sure that whenever the fqs_task is created, the fqs_holdoff will be greater than zero.

---
 kernel/rcu/rcutorture.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/rcu/rcutorture.c +3 -1
index 30fc9d34e329..a0b2520bd32b 100644
@@ -3872,7 +3872,9 @@ rcu_torture_init(void)
 	}
 	if (fqs_duration < 0)
 		fqs_duration = 0;
-	if (fqs_duration) {
+	if (fqs_holdoff < 0)
+		fqs_holdoff = 0;
+	if (fqs_duration && fqs_holdoff) {
 		/* Create the fqs thread */
 		firsterr = torture_create_kthread(rcu_torture_fqs, NULL,
 						  fqs_task);
Signature · 1 line
2.40.1