On Thu, Jan 19, 2023 at 02:51:53PM -0500, Alan Stern wrote:
On Thu, Jan 19, 2023 at 10:41:07AM -0800, Paul E. McKenney wrote:
In contrast, this actually needs srcu_down_read() and srcu_up_read():I modified this litmus test by adding a flag variable with an
------------------------------------------------------------------------
C C-srcu-nest-6
(*
* Result: Never
*
* Flag unbalanced-srcu-locking
* This would be valid for srcu_down_read() and srcu_up_read().
*)
{}
P0(int *x, int *y, struct srcu_struct *s1, int *idx)
{
int r2;
int r3;
r3 = srcu_down_read(s1);
WRITE_ONCE(*idx, r3);
r2 = READ_ONCE(*y);
}
P1(int *x, int *y, struct srcu_struct *s1, int *idx)
{
int r1;
int r3;
r1 = READ_ONCE(*x);
r3 = READ_ONCE(*idx);
srcu_up_read(s1, r3);
}
P2(int *x, int *y, struct srcu_struct *s1)
{
WRITE_ONCE(*y, 1);
synchronize_srcu(s1);
WRITE_ONCE(*x, 1);
}
locations [0:r1]
exists (1:r1=1 /\ 0:r2=0)
smp_store_release in P0, an smp_load_acquire in P1, and a filter clause
to ensure that P1 reads the flag and idx from P1.
It turns out that the idea of removing rf edges from Srcu-unlock eventsAgreed. I for one would definitely have something to say about an
doesn't work well. The missing edges mess up herd's calculation of the
fr relation and the coherence axiom. So I've gone back to filtering
those edges out of carry-dep.
Also, Boqun's suggestion for flagging ordinary accesses to SRCU
structures no longer works, because the lock and unlock operations now
_are_ normal accesses. I removed that check too, but it shouldn't hurt
much because I don't expect to encounter litmus tests that try to read
or write srcu_structs directly.
SRCU-usage patch that directly manipulated a srcu_struct structure! ;-)