The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] SCF torture-test updates for v7.3
@ 2026-07-31  0:51 Paul E. McKenney
  2026-07-31  0:51 ` [PATCH RFC 1/2] scftorture: Count single_rpc offline failures in statistics output Paul E. McKenney
  2026-07-31  0:51 ` [PATCH RFC 2/2] scftorture: Make invoker threads actually wait for all threads to start Paul E. McKenney
  0 siblings, 2 replies; 3+ messages in thread
From: Paul E. McKenney @ 2026-07-31  0:51 UTC (permalink / raw)
  To: rcu; +Cc: linux-kernel, kernel-team, rostedt

Hello!

The following series provides scftorture updates for v7.2-rc3:

1.	Count single_rpc offline failures in statistics output, courtesy
	of Joel Fernandes.

2.	Make invoker threads actually wait for all threads to start,
	courtesy of Joel Fernandes.

						Thanx, Paul

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

 b/kernel/scftorture.c |    1 +
 kernel/scftorture.c   |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

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

* [PATCH RFC 1/2] scftorture: Count single_rpc offline failures in statistics output
  2026-07-31  0:51 [PATCH 0/2] SCF torture-test updates for v7.3 Paul E. McKenney
@ 2026-07-31  0:51 ` Paul E. McKenney
  2026-07-31  0:51 ` [PATCH RFC 2/2] scftorture: Make invoker threads actually wait for all threads to start Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2026-07-31  0:51 UTC (permalink / raw)
  To: rcu; +Cc: linux-kernel, kernel-team, rostedt, Joel Fernandes,
	Paul E . McKenney

From: Joel Fernandes <joelagnelf@nvidia.com>

scf_torture_stats_print() aggregates each invoker thread's counters
into a local scf_statistics structure before printing, but the
n_single_rpc_ofl field is missing from the aggregation loop.  As a
result, the "single_rpc_ofl" value printed in the statistics line is
always zero, even when smp_call_function_single() invocations for the
RPC test have failed due to offline CPUs and been counted by the
invoker threads.

Add the missing accumulation so that the printed value reflects the
actual counts.

Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 kernel/scftorture.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/scftorture.c b/kernel/scftorture.c
index 327c315f411cc2..ffd6c83732ee74 100644
--- a/kernel/scftorture.c
+++ b/kernel/scftorture.c
@@ -193,6 +193,7 @@ static void scf_torture_stats_print(void)
 		scfs.n_single += scf_stats_p[i].n_single;
 		scfs.n_single_ofl += scf_stats_p[i].n_single_ofl;
 		scfs.n_single_rpc += scf_stats_p[i].n_single_rpc;
+		scfs.n_single_rpc_ofl += scf_stats_p[i].n_single_rpc_ofl;
 		scfs.n_single_wait += scf_stats_p[i].n_single_wait;
 		scfs.n_single_wait_ofl += scf_stats_p[i].n_single_wait_ofl;
 		scfs.n_many += scf_stats_p[i].n_many;
-- 
2.40.1


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

* [PATCH RFC 2/2] scftorture: Make invoker threads actually wait for all threads to start
  2026-07-31  0:51 [PATCH 0/2] SCF torture-test updates for v7.3 Paul E. McKenney
  2026-07-31  0:51 ` [PATCH RFC 1/2] scftorture: Count single_rpc offline failures in statistics output Paul E. McKenney
@ 2026-07-31  0:51 ` Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2026-07-31  0:51 UTC (permalink / raw)
  To: rcu; +Cc: linux-kernel, kernel-team, rostedt, Joel Fernandes,
	Paul E . McKenney

From: Joel Fernandes <joelagnelf@nvidia.com>

Each scftorture_invoker() thread decrements n_started, which is
initialized to the number of threads, and is then supposed to wait
until all of its siblings have also checked in before starting the
test proper.  However, the wait loop is guarded by
!atomic_dec_return(&n_started), which is true only for the final
thread to arrive, and by then n_started is already zero, so the
final thread does not wait either.  The side-effect (possibly positive)
is that no thread ever waits and the start-synchronization barrier is
dead code, with early threads beginning to hammer smp_call_function*()
while later threads are still being spawned.

Invert the test so that every thread other than the last spins until
n_started reaches zero, making the threads start testing together as
intended.  The existing torture_must_stop() check in the wait loop
continues to bound the wait during shutdown.

We can also drop the spinning entirely if the intent is to leave it as
dead code, however for the current intent, this patches fixes the code.

Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 kernel/scftorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/scftorture.c b/kernel/scftorture.c
index ffd6c83732ee74..392df1b4d4eda2 100644
--- a/kernel/scftorture.c
+++ b/kernel/scftorture.c
@@ -497,7 +497,7 @@ static int scftorture_invoker(void *arg)
 		  "%s: Wanted CPU %d, running on %d, nr_cpu_ids = %d\n",
 		  __func__, scfp->cpu, curcpu, nr_cpu_ids);
 
-	if (!atomic_dec_return(&n_started))
+	if (atomic_dec_return(&n_started))
 		while (atomic_read_acquire(&n_started)) {
 			if (torture_must_stop()) {
 				VERBOSE_SCFTORTOUT("scftorture_invoker %d ended before starting", scfp->cpu);
-- 
2.40.1


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

end of thread, other threads:[~2026-07-31  0:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31  0:51 [PATCH 0/2] SCF torture-test updates for v7.3 Paul E. McKenney
2026-07-31  0:51 ` [PATCH RFC 1/2] scftorture: Count single_rpc offline failures in statistics output Paul E. McKenney
2026-07-31  0:51 ` [PATCH RFC 2/2] scftorture: Make invoker threads actually wait for all threads to start 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