]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rcutorture: Read CPU ID for decoration protected by both reader types
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 8 Nov 2024 23:36:55 +0000 (15:36 -0800)
committerUladzislau Rezki (Sony) <urezki@gmail.com>
Sat, 14 Dec 2024 16:05:43 +0000 (17:05 +0100)
commit885a6f4729c688c50bb2f470dfcc0ad0dea43c1e
treec1b7a04e05400c08f8b549eebca4a2a2bc2c6d7a
parentc31569eec4815c6fa64948c31f00ebe50b1c75dc
rcutorture: Read CPU ID for decoration protected by both reader types

Currently, rcutorture_one_extend() reads the CPU ID before making any
change to the type of RCU reader.  This can be confusing because the
properties of the code from which the CPU ID is read are not that of
the reader segment that this same CPU ID is listed with.

This commit therefore causes rcutorture_one_extend() to read the CPU
ID just after the new protections have been added, but before the old
protections have been removed.  With this change in place, all of the
protections of a given reader segment apply from the reading of one CPU ID
to the reading of the next.  This change therefore also allows a single
read of the CPU ID to work for both the old and the new reader segment.
And this dual use of a single read of the CPU ID avoids inflicting any
additional to heisenbugs.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
kernel/rcu/rcutorture.c