[lkml]   [2017]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/6] swait: Introduce and use swq_has_sleepers

Recently[1] Nick mentioned that a lot of swait_active() callers look fishy.
This is because it inherited bad habits from regular waitqueues. Other than rcu,
kvm is one of the main callers, which I audited.

The following patches fix and/or justify (in baby steps) some of the
callers. Note that s390 and mips are other offenders, but I have no
idea if it can actually occur -- ie:

kvm_vcpu_block kvm_mips_comparecount_func

[S] prepare_to_swait(&vcpu->wq)
[L] swait_active(&vcpu->wq)
[S] queue_timer_int(vcpu)

[L] if (!kvm_vcpu_has_pending_timer(vcpu))

[1] swait: add missing barrier to swake_up:


Davidlohr Bueso (6):
sched/wait: Add swq_has_sleepers()
kvm,async_pf: Use swq_has_sleepers()
kvm,lapic: Justify use of swait_activate()
x86,kvm: Fix apf_task_wake_one() serialization
kvm: Serialize wq active checks in kvm_vcpu_wake_up()
kvm,powerpc: Serialize wq active checks in ops->vcpu_kick

arch/powerpc/kvm/book3s_hv.c | 2 +-
arch/x86/kernel/kvm.c | 2 +-
arch/x86/kvm/lapic.c | 6 +++++
include/linux/swait.h | 57 ++++++++++++++++++++++++++++++++++++++++++--
virt/kvm/async_pf.c | 6 +----
virt/kvm/kvm_main.c | 2 +-
6 files changed, 65 insertions(+), 10 deletions(-)


 \ /
  Last update: 2017-09-05 21:04    [W:0.060 / U:4.964 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site