On Wed, Jul 28, 2021 at 07:48:22PM +0800, Rui Wang wrote: > From: wangrui <wangrui@xxxxxxxxxxx> > > This patch introduce a new atomic primitive 'and_or', It may be have three > types of implemeations: > > * The generic implementation is based on arch_cmpxchg. > * The hardware supports atomic 'and_or' of single instruction. Do any architectures actually support this instruction? On arm64, we can clear arbitrary bits and we can set arbitrary bits, but we can't combine the two in a fashion which provides atomicity and forward-progress guarantees. Please can you explain how this new primitive will be used, in case there's an alternative way of doing it which maps better to what CPUs can actually do? Cheers, Will