Currently Buffer header state is a 64-bit, but it is conceptually a bit field structure. The CAS loops care about only some of those bits, however by operating on a 64-bit structure unrelated field changes will cause a retry.
The atomic operations don't support a comparison mask, but in this case we can at least CAS 32-bit, low and high half separately, reducing the likelihood of retrial. Regards, Alexandre.
v1-0002-Using-half-state-CAS.patch
Description: Binary data
v1-0001-half-compare-exchange.patch
Description: Binary data
