public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [v2 0/4] KVM: irqchip: synchronize srcu only if needed
@ 2024-01-21 11:17 Yi Wang
  2024-01-21 11:17 ` [v2 1/4] KVM: irqchip: add setup empty irq routing function Yi Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Yi Wang @ 2024-01-21 11:17 UTC (permalink / raw)
  To: seanjc, pbonzini, tglx, mingo, bp, dave.hansen, x86, hpa, kvm,
	linux-kernel, wanpengli, foxywang, oliver.upton, maz, anup,
	atishp, borntraeger, frankja, imbrenda
  Cc: up2wing

From: Yi Wang <foxywang@tencent.com>

We found that it may cost more than 20 milliseconds very accidentally
to enable cap of KVM_CAP_SPLIT_IRQCHIP on a host which has many vms
already.

The reason is that when vmm(qemu/CloudHypervisor) invokes
KVM_CAP_SPLIT_IRQCHIP kvm will call synchronize_srcu_expedited() and
might_sleep and kworker of srcu may cost some delay during this period.
One way makes sence is setup empty irq routing when creating vm and
so that x86/s390 don't need to setup empty/dummy irq routing.

Note: I have no s390 machine so the s390 patch has not been tested.

Changelog:
----------
v1->v2:
  - setup empty irq routing in kvm_create_vm
  - don't setup irq routing in x86 KVM_CAP_SPLIT_IRQCHIP
  - don't setup irq routing in s390 KVM_CREATE_IRQCHIP

v1: https://lore.kernel.org/kvm/20240112091128.3868059-1-foxywang@tencent.com/

Yi Wang (4):
  KVM: irqchip: add setup empty irq routing function
  KVM: setup empty irq routing when create vm
  KVM: x86: don't setup empty irq routing when KVM_CAP_SPLIT_IRQCHIP
  KVM: s390: don't setup dummy routing when KVM_CREATE_IRQCHIP

 arch/s390/kvm/kvm-s390.c | 13 +++++--------
 arch/x86/kvm/irq.h       |  1 -
 arch/x86/kvm/irq_comm.c  |  5 -----
 arch/x86/kvm/x86.c       |  3 ---
 include/linux/kvm_host.h |  1 +
 virt/kvm/irqchip.c       | 19 +++++++++++++++++++
 virt/kvm/kvm_main.c      |  4 ++++
 7 files changed, 29 insertions(+), 17 deletions(-)

-- 
2.39.3


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

end of thread, other threads:[~2024-01-24 12:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21 11:17 [v2 0/4] KVM: irqchip: synchronize srcu only if needed Yi Wang
2024-01-21 11:17 ` [v2 1/4] KVM: irqchip: add setup empty irq routing function Yi Wang
2024-01-23 18:47   ` Oliver Upton
2024-01-24  2:12     ` Yi Wang
2024-01-21 11:17 ` [v2 2/4] KVM: setup empty irq routing when create vm Yi Wang
2024-01-21 11:17 ` [v2 3/4] KVM: x86: don't setup empty irq routing when KVM_CAP_SPLIT_IRQCHIP Yi Wang
2024-01-21 11:17 ` [v2 4/4] KVM: s390: don't setup dummy routing when KVM_CREATE_IRQCHIP Yi Wang
2024-01-23 18:54   ` Oliver Upton
2024-01-24  2:16     ` Yi Wang
2024-01-24 12:14 ` [v2 0/4] KVM: irqchip: synchronize srcu only if needed Christian Borntraeger
2024-01-24 12:44   ` Yi Wang

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