xref: /kernel/linux/linux-6.6/tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus (revision 62306a36)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-6.6/tools/memory-model/litmus-tests/
162306a36Sopenharmony_ciC LB+poacquireonce+pooncerelease
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci(*
462306a36Sopenharmony_ci * Result: Never
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Does a release-acquire pair suffice for the load-buffering litmus
762306a36Sopenharmony_ci * test, where each process reads from one of two variables then writes
862306a36Sopenharmony_ci * to the other?
962306a36Sopenharmony_ci *)
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci{}
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciP0(int *x, int *y)
1462306a36Sopenharmony_ci{
1562306a36Sopenharmony_ci	int r0;
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci	r0 = READ_ONCE(*x);
1862306a36Sopenharmony_ci	smp_store_release(y, 1);
1962306a36Sopenharmony_ci}
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciP1(int *x, int *y)
2262306a36Sopenharmony_ci{
2362306a36Sopenharmony_ci	int r0;
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci	r0 = smp_load_acquire(y);
2662306a36Sopenharmony_ci	WRITE_ONCE(*x, 1);
2762306a36Sopenharmony_ci}
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciexists (0:r0=1 /\ 1:r0=1)
30

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