Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1732837

Re: [PATCH 3/7] kvm,lapic: Justify use of swait_activate()

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/7] kvm,lapic: Justify use of swait_activate()
Date 2017-09-15 13:50 +0200
Message-ID <upXi9-2eZ-3@gated-at.bofh.it> (permalink)
References <upm8V-3w4-9@gated-at.bofh.it> <upmiC-3zs-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 13/09/2017 22:08, Davidlohr Bueso wrote:
> A comment might serve future readers.
> 
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> ---
>  arch/x86/kvm/lapic.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index aaf10b6f5380..69c5612be786 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -1324,6 +1324,10 @@ static void apic_timer_expired(struct kvm_lapic *apic)
>  	atomic_inc(&apic->lapic_timer.pending);
>  	kvm_set_pending_timer(vcpu);
>  
> +	/*
> +	 * For x86, the atomic_inc() is serialized, thus
> +	 * using swait_active() is safe.
> +	 */
>  	if (swait_active(q))
>  		swake_up(q);
>  
> 

Better add an smp_mb__after_atomic() for documentation purposes.

Paolo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/7] swait: Introduce and use swq_has_sleeper() Davidlohr Bueso <dave@stgolabs.net> - 2017-09-13 22:10 +0200
  [PATCH 7/7] kvm,mips: Fix potential swait_active() races Davidlohr Bueso <dave@stgolabs.net> - 2017-09-13 22:10 +0200
    Re: [PATCH 7/7] kvm,mips: Fix potential swait_active() races Paolo Bonzini <pbonzini@redhat.com> - 2017-09-13 22:40 +0200
      Re: [PATCH 7/7] kvm,mips: Fix potential swait_active() races Davidlohr Bueso <dave@stgolabs.net> - 2017-09-14 00:30 +0200
        Re: [PATCH 7/7] kvm,mips: Fix potential swait_active() races Paolo Bonzini <pbonzini@redhat.com> - 2017-09-15 13:40 +0200
  [PATCH 6/7] kvm,powerpc: Serialize wq active checks in ops->vcpu_kick Davidlohr Bueso <dave@stgolabs.net> - 2017-09-13 22:10 +0200
  [PATCH 4/7] kvm,x86: Fix apf_task_wake_one() wq serialization Davidlohr Bueso <dave@stgolabs.net> - 2017-09-13 22:20 +0200
  [PATCH 3/7] kvm,lapic: Justify use of swait_activate() Davidlohr Bueso <dave@stgolabs.net> - 2017-09-13 22:20 +0200
    Re: [PATCH 3/7] kvm,lapic: Justify use of swait_activate() Paolo Bonzini <pbonzini@redhat.com> - 2017-09-15 13:50 +0200
  [PATCH 2/7] kvm,async_pf: Use swq_has_sleepers() Davidlohr Bueso <dave@stgolabs.net> - 2017-09-13 22:20 +0200
  Re: [PATCH v2 0/7] swait: Introduce and use swq_has_sleeper() Paolo Bonzini <pbonzini@redhat.com> - 2017-09-15 14:00 +0200
    Re: [PATCH v2 0/7] swait: Introduce and use swq_has_sleeper() Christian Borntraeger <borntraeger@de.ibm.com> - 2017-09-19 10:30 +0200

csiph-web