linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Janosch Frank <frankja@linux.vnet.ibm.com>,
	KVM <kvm@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	David Hildenbrand <david@redhat.com>,
	Michael Mueller <mimu@linux.vnet.ibm.com>,
	Halil Pasic <pasic@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/2] KVM: s390: optimize wakeup for exitless interrupts
Date: Tue, 13 Feb 2018 16:46:41 +0100	[thread overview]
Message-ID: <20180213164641.2264844d.cohuck@redhat.com> (raw)
In-Reply-To: <20180213122858.74748-2-borntraeger@de.ibm.com>

On Tue, 13 Feb 2018 12:28:57 +0000
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> For interrupt injection of floating interrupts we queue the interrupt
> either in the GISA or in the floating  interrupt list. The first CPU
> that looks at these data structures - either in KVM code or hardware
> will then deliver that interrupt. To minimize latency we also:
> -a: choose a VCPU to deliver that interrupt. We prefer idle CPUs
> -b: we wake up the host thread that runs the VCPU
> -c: set an I/O intervention bit for that CPU so that it exits guest
>     context as soon as the PSW I/O mask is enabled
> This will make sure that this CPU will execute the interrupt delivery
> code of KVM very soon.
> 
> We can now optimize the injection case if we have exitless interrupts.
> The wakeup is still necessary in case the target CPU sleeps. We can
> avoid the I/O intervention request bit though. Whenever this
> intervention request would be handled, the hardware could also directly
> inject the interrupt on that CPU, no need to go through the interrupt
> injection loop of KVM.
> 
> Cc: Michael Mueller <mimu@linux.vnet.ibm.com>
> Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  arch/s390/kvm/interrupt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
> index aabf46f5f883..337a69bc04db 100644
> --- a/arch/s390/kvm/interrupt.c
> +++ b/arch/s390/kvm/interrupt.c
> @@ -1701,7 +1701,8 @@ static void __floating_irq_kick(struct kvm *kvm, u64 type)
>  		kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_STOP_INT);
>  		break;
>  	case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
> -		kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_IO_INT);
> +		if (!(type & KVM_S390_INT_IO_AI_MASK && kvm->arch.gisa))
> +			kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_IO_INT);
>  		break;
>  	default:
>  		kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_EXT_INT);

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

  parent reply	other threads:[~2018-02-13 15:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 12:28 [PATCH 0/2] small optimizations for exitless interrupts Christian Borntraeger
2018-02-13 12:28 ` [PATCH 1/2] KVM: s390: optimize wakeup " Christian Borntraeger
2018-02-13 13:40   ` David Hildenbrand
2018-02-13 15:46   ` Cornelia Huck [this message]
2018-02-13 12:28 ` [PATCH 2/2] KVM: s390: do not set intervention requests for GISA interrupts Christian Borntraeger
2018-02-13 13:42   ` David Hildenbrand
2018-02-13 15:48   ` Cornelia Huck
2018-02-14  8:38 ` [PATCH 0/2] small optimizations for exitless interrupts Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180213164641.2264844d.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mimu@linux.vnet.ibm.com \
    --cc=pasic@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).