On Tue, Nov 14, 2017 at 02:10:16PM +0800, Wanpeng Li wrote: > 2017-11-13 21:02 GMT+08:00 Peter Zijlstra <peterz@xxxxxxxxxxxxx>: > > That can be written like: > > > > do { > > if (state & KVM_VCPU_PREEMPTED) > > new_state = state | KVM_VCPU_SHOULD_FLUSH; > > else > > new_state = state | KVM_VCPU_IPI_PENDING; > > } while (!try_cmpxchg(&src->preempted, state, new_state); > > > > if (new_state & KVM_VCPU_IPI_PENDING) > > Should be new_state & KVM_VCPU_SHOULD_FLUSH I think. Quite so indeed.