public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] swait: Introduce and use swq_has_sleeper()
@ 2017-09-13 20:08 Davidlohr Bueso
  2017-09-13 20:08 ` [PATCH 1/7] sched/wait: Add swq_has_sleepers() Davidlohr Bueso
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Davidlohr Bueso @ 2017-09-13 20:08 UTC (permalink / raw)
  To: mingo, peterz, pbonzini; +Cc: npiggin, paulmck, kvm, linux-kernel, dave

Changes from v1: https://lkml.org/lkml/2017/9/5/622
 - Added patch 7 (mips)
 - Small comment fixlets in patch 1.

Hi,

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. The main exception is s390, which I didn't follow how ->valid_wakeup
can get hoisted as kvm_vcpu_block does not use that in the wait loop.

Thanks!

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

 arch/mips/kvm/mips.c         |  4 +--
 arch/powerpc/kvm/book3s_hv.c |  2 +-
 arch/x86/kernel/kvm.c        |  2 +-
 arch/x86/kvm/lapic.c         |  4 +++
 include/linux/swait.h        | 58 ++++++++++++++++++++++++++++++++++++++++++--
 virt/kvm/async_pf.c          |  6 +----
 virt/kvm/kvm_main.c          |  2 +-
 7 files changed, 66 insertions(+), 12 deletions(-)

-- 
2.12.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-09-19  8:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-13 20:08 [PATCH v2 0/7] swait: Introduce and use swq_has_sleeper() Davidlohr Bueso
2017-09-13 20:08 ` [PATCH 1/7] sched/wait: Add swq_has_sleepers() Davidlohr Bueso
2017-09-13 20:08 ` [PATCH 2/7] kvm,async_pf: Use swq_has_sleepers() Davidlohr Bueso
2017-09-13 20:08 ` [PATCH 3/7] kvm,lapic: Justify use of swait_activate() Davidlohr Bueso
2017-09-15 11:47   ` Paolo Bonzini
2017-09-13 20:08 ` [PATCH 4/7] kvm,x86: Fix apf_task_wake_one() wq serialization Davidlohr Bueso
2017-09-13 20:08 ` [PATCH 5/7] kvm: Serialize wq active checks in kvm_vcpu_wake_up() Davidlohr Bueso
2017-09-13 20:08 ` [PATCH 6/7] kvm,powerpc: Serialize wq active checks in ops->vcpu_kick Davidlohr Bueso
2017-09-13 20:08 ` [PATCH 7/7] kvm,mips: Fix potential swait_active() races Davidlohr Bueso
2017-09-13 20:35   ` Paolo Bonzini
2017-09-13 22:22     ` Davidlohr Bueso
2017-09-15 11:33       ` Paolo Bonzini
2017-09-15 11:53 ` [PATCH v2 0/7] swait: Introduce and use swq_has_sleeper() Paolo Bonzini
2017-09-19  8:25   ` Christian Borntraeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox