Re: rcu/tree: Protect rcu_rdp_is_offloaded() invocations on RT

From
Frederic Weisbecker <frederic@kernel.org>
Date
2021-09-23 10:02:41
Also in
linux-rt-users, lkml, rcu
Reply to
Sebastian Andrzej Siewior, 2021-09-22
On Wed, Sep 22, 2021 at 03:02:32PM +0200, Sebastian Andrzej Siewior wrote:
On 2021-09-22 13:38:20 [+0200], Frederic Weisbecker wrote:
quoted
quoted
So you rely on some implicit behaviour which breaks with RT such as:

                              CPU 0
           -----------------------------------------------
           RANDOM TASK-A                      RANDOM TASK-B
           ------                             -----------
           int *X = &per_cpu(CPUX, 0)         int *X = &per_cpu(CPUX, 0)
           int A, B;                          
					      spin_lock(&D);
           spin_lock(&C);
	   				      WRITE_ONCE(*X, 0);
           A = READ_ONCE(*X);
                                              WRITE_ONCE(*X, 1);
           B = READ_ONCE(*X);

while spinlock C and D are just random locks not related to CPUX but it
just happens that they are held at that time. So for !RT you guarantee
that A == B while it is not the case on RT.
Not sure which spinlocks you are referring to here. Also most RCU spinlocks
are raw.
I was bringing an example where you also could rely on implicit locking
provided by spin_lock() which breaks on RT.
Good point!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (7 messages) 7 messages, 2 authors, last reply 2021-09-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help