Re: [PATCH v2] kvm: fix waitqueue_active without memory barrier in virt/kvm/async_pf.c

2015-10-09 Thread Paolo Bonzini
On 09/10/2015 14:55, Peter Zijlstra wrote: > On Fri, Oct 09, 2015 at 12:21:55PM +, Kosuke Tatsukawa wrote: > >> + * Memory barrier is required here to make sure change to >> + * vcpu->async_pf.done is visible from other CPUs. This memory >> + * barrier pairs with prepare_to_wait

Re: [PATCH v2] kvm: fix waitqueue_active without memory barrier in virt/kvm/async_pf.c

2015-10-09 Thread Peter Zijlstra
On Fri, Oct 09, 2015 at 12:21:55PM +, Kosuke Tatsukawa wrote: > + * Memory barrier is required here to make sure change to > + * vcpu->async_pf.done is visible from other CPUs. This memory > + * barrier pairs with prepare_to_wait's set_current_state() That is not how memory ba

[PATCH v2] kvm: fix waitqueue_active without memory barrier in virt/kvm/async_pf.c

2015-10-09 Thread Kosuke Tatsukawa
async_pf_execute() seems to be missing a memory barrier which might cause the waker to not notice the waiter and miss sending a wake_up as in the following figure. async_pf_executekvm_vcpu_block sp