public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: "Yang, Sheng" <sheng.yang@intel.com>, kvm-devel <kvm@vger.kernel.org>
Subject: Re: RFC: PIC: enhance IPI avoidance
Date: Sun, 13 Jul 2008 19:00:43 +0300	[thread overview]
Message-ID: <487A26AB.9000305@qumranet.com> (raw)
In-Reply-To: <20080711210843.GA30887@dmt.cnet>

Marcelo Tosatti wrote:
> The PIC code makes little effort to avoid kvm_vcpu_kick(), resulting in
> unnecessary guest exits in some conditions.
>
> For example, if the timer interrupt is routed through the IOAPIC, IRR
> for IRQ 0 will get set but not cleared, since the APIC is handling the
> acks.
>
> This means that everytime an interrupt < 16 is triggered, the priority
> logic will find IRQ0 pending and send an IPI to vcpu0 (in case IRQ0 is
> not masked, which is Linux's case).
>
> Introduce a new variable isr_ack to represent the IRQ's for which the
> guest has been signalled / cleared the ISR. Use it to avoid more than
> one IPI per trigger-ack cycle, in addition to the avoidance when ISR is
> set in get_priority().
>
>   

Looks good.

>  					s->isr &= ~(1 << irq);
> +					s->isr_ack |= (1 << irq);
>   

>  				s->isr &= ~(1 << irq);
> +				s->isr_ack |= (1 << irq);
>   

>  				s->isr &= ~(1 << irq);
> +				s->isr_ack |= (1 << irq);
>   

>  			s->pics_state->pics[0].isr &= ~(1 << 2);
> +			s->pics_state->pics[0].isr_ack |= (1 << 2);
>   

>  		s->isr &= ~(1 << ret);
> +		s->isr_ack |= (1 << ret);
>   

I already have a patch which consolidates isr clearing into a function, 
so I've queued it up and will push once it passes regression testing. 
Please rebase your patch on top of that.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2008-07-13 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11 21:08 RFC: PIC: enhance IPI avoidance Marcelo Tosatti
2008-07-13 16:00 ` Avi Kivity [this message]
2008-07-13 16:12   ` Avi Kivity

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=487A26AB.9000305@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=sheng.yang@intel.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