]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - arch/s390/kvm/interrupt.c
KVM: s390: factor out and optimize floating irq VCPU kick
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Wed, 14 Jan 2015 13:08:38 +0000 (14:08 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 8 May 2015 13:51:16 +0000 (15:51 +0200)
commit96e0ed23dca3769053c5211ef885e789097834bf
treeae7324f669fcb7329a0681367bbfe8233d79091d
parentffeca0ae880055457e56e45fd79cfa28d7160c30
KVM: s390: factor out and optimize floating irq VCPU kick

This patch factors out the search for a floating irq destination
VCPU as well as the kicking of the found VCPU. The search is optimized
in the following ways:

1. stopped VCPUs can't take any floating interrupts, so try to find an
   operating one. We have to take care of the special case where all
   VCPUs are stopped and we don't have any valid destination.

2. use online_vcpus, not KVM_MAX_VCPU. This speeds up the search
   especially if KVM_MAX_VCPU is increased one day. As these VCPU
   objects are initialized prior to increasing online_vcpus, we can be
   sure that they exist.

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/interrupt.c