18c2ecf20Sopenharmony_ciC S+poonceonces 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci(* 48c2ecf20Sopenharmony_ci * Result: Sometimes 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Starting with a two-process release-acquire chain ordering P0()'s 78c2ecf20Sopenharmony_ci * first store against P1()'s final load, if the smp_store_release() 88c2ecf20Sopenharmony_ci * is replaced by WRITE_ONCE() and the smp_load_acquire() replaced by 98c2ecf20Sopenharmony_ci * READ_ONCE(), is ordering preserved? 108c2ecf20Sopenharmony_ci *) 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci{} 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ciP0(int *x, int *y) 158c2ecf20Sopenharmony_ci{ 168c2ecf20Sopenharmony_ci WRITE_ONCE(*x, 2); 178c2ecf20Sopenharmony_ci WRITE_ONCE(*y, 1); 188c2ecf20Sopenharmony_ci} 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciP1(int *x, int *y) 218c2ecf20Sopenharmony_ci{ 228c2ecf20Sopenharmony_ci int r0; 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci r0 = READ_ONCE(*y); 258c2ecf20Sopenharmony_ci WRITE_ONCE(*x, 1); 268c2ecf20Sopenharmony_ci} 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ciexists (x=2 /\ 1:r0=1) 29