Enforce proper memory ordering in refcnt_rele() and refcnt_finalize()
authorvisa <visa@openbsd.org>
Sat, 30 Apr 2022 14:44:04 +0000 (14:44 +0000)
committervisa <visa@openbsd.org>
Sat, 30 Apr 2022 14:44:04 +0000 (14:44 +0000)
commitbe0e90d31c1a4a6ca26f0910607c9e0dd5c56c09
tree66edbcd05eb73c7904033f86a642d72248d19aaa
parent2af522804e34e651131b12f41358e75900a7af55
Enforce proper memory ordering in refcnt_rele() and refcnt_finalize()

Make refcnt_rele() and refcnt_finalize() order memory operations so that
preceding loads and stores happen before 1->0 transition. Also ensure
that loads and stores that depend on the transition really begin only
after the transition has occurred. Otherwise the object destructor might
not see the object's latest state.

OK bluhm@
share/man/man9/refcnt_init.9
sys/kern/kern_synch.c