xref: /kernel/linux/linux-5.10/tools/memory-model/litmus-tests/S+fencewmbonceonce+poacquireonce.litmus (revision 8c2ecf20)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/tools/memory-model/litmus-tests/
18c2ecf20Sopenharmony_ciC S+fencewmbonceonce+poacquireonce
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci(*
48c2ecf20Sopenharmony_ci * Result: Never
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Can a smp_wmb(), instead of a release, and an acquire order a prior
78c2ecf20Sopenharmony_ci * store against a subsequent store?
88c2ecf20Sopenharmony_ci *)
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci{}
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciP0(int *x, int *y)
138c2ecf20Sopenharmony_ci{
148c2ecf20Sopenharmony_ci	WRITE_ONCE(*x, 2);
158c2ecf20Sopenharmony_ci	smp_wmb();
168c2ecf20Sopenharmony_ci	WRITE_ONCE(*y, 1);
178c2ecf20Sopenharmony_ci}
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciP1(int *x, int *y)
208c2ecf20Sopenharmony_ci{
218c2ecf20Sopenharmony_ci	int r0;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci	r0 = smp_load_acquire(y);
248c2ecf20Sopenharmony_ci	WRITE_ONCE(*x, 1);
258c2ecf20Sopenharmony_ci}
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciexists (x=2 /\ 1:r0=1)
28

Indexes created Thu Nov 07 10:32:03 CST 2024