Re: [PATCH v2 4/7] srcu: Add irqsave variants of the atomic SRCU readers
From: Paul E. McKenney
Date: Wed Nov 11 2026 - 19:10:14 EST
On Wed, Nov 11, 2026 at 03:13:34PM -0500, Mathieu Desnoyers wrote:
> On 2026-11-11 15:04, Paul E. McKenney wrote:
> > Aside from this in the console output:
> > rcu_torture_nmi_cleanup: nmi_readers set but no reader ever ran in NMI,
> > so NMI readers went untested (no PMU, or NMIs unavailable here).
> > Looking into it.
> I expect this is a guest without a PMU. The NMI source is a perf
> counter, and kvm.sh starts x86 guests without one. The readers in NMI
> are then skipped, and this line says so. The nmi_calls test prints the
> same kind of line.
> I ran with:
> --qemu-args "-cpu host,pmu=on"
> With that, "NMI Reader Pipe:" and "NMI Reader Batch:" show up in the
> statistics. The cover letter mentions it, but the changelog of patch 5
> does not. I can add it there.
> Thanks,
> Mathieu
Although that doesn't help on my laptop, it does work on my x86 test
system. Hmmm... Trying an ARM64 system, which unsurprisingly fails,
presumably due to a complete lack of NMI support.
Perhaps something like the following would be helpful in keeping this
well-tested?
Thanx, Paul
------------------------------------------------------------------------
commit 7b946ec45af11815e2341d91ca0e9ac7c2372481
Author: Paul E. McKenney <paulmck@xxxxxxxxxx>
Date: Wed Nov 11 16:03:48 2026 -0800
rcutorture: Make torture.sh test NMIs for atomic SRCU on x86
This commit adds '--qemu-args "-cpu host,pmu=on"' and kernel boot
arguments "rcutorture.nmi_readers=1 rcutorture.nmi_calls=1" for
--do-atomic-srcu runs of torture.sh. This ensures regular testing of
atomic SRCU readers from NMI handlers, at least when running on x86
systems providing PMU support.
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
diff --git a/tools/testing/selftests/rcutorture/bin/torture.sh b/tools/testing/selftests/rcutorture/bin/torture.sh
index 804faa456d386..898e602a00f46 100755
--- a/tools/testing/selftests/rcutorture/bin/torture.sh
+++ b/tools/testing/selftests/rcutorture/bin/torture.sh
@@ -528,16 +528,19 @@ then
if test "$ifnotaarch64" = yes
then
configs_atomic_srcu="$configs_atomic_srcu SRCU-T"
+ qemu_args='--qemu-args "-cpu host,pmu=on"'
+ else
+ qemu_args=
fi
torture_set "atomic-srcu" tools/testing/selftests/rcutorture/bin/kvm.sh \
--allcpus --duration "$duration_rcutorture" \
--configs "$configs_atomic_srcu" --trust-make
# Half the readers then use srcu_read_lock_atomic_irqsave().
- torture_bootargs="rcutorture.reader_flavor=0x10 rcutorture.atomic_irqsave=1"
+ torture_bootargs="rcutorture.reader_flavor=0x10 rcutorture.atomic_irqsave=1 rcutorture.nmi_readers=1 rcutorture.nmi_calls=1"
torture_set "atomic-srcu-irqsave" tools/testing/selftests/rcutorture/bin/kvm.sh \
--allcpus --duration "$duration_rcutorture" \
- --configs "SRCU-P" --trust-make
+ --configs "SRCU-P" ${qemu_args} --trust-make
fi
if test "$do_locktorture" = "yes"