public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zamsden@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: mtosatti@redhat.com, avi@redhat.com, kvm <kvm@vger.kernel.org>,
	Chris Lalancette <clalance@redhat.com>
Subject: Re: [PATCH] KVM: pit: Do not check pending pit timer in vcpu thread
Date: Mon, 30 Aug 2010 11:33:33 -1000	[thread overview]
Message-ID: <4C7C23AD.3090907@redhat.com> (raw)
In-Reply-To: <20100827091506.10369.58066.stgit@FreeLancer>

On 08/26/2010 11:15 PM, Jason Wang wrote:
> Pit interrupt injection was done by workqueue, so no need to check
> pending pit timer in vcpu thread which could lead unnecessary
> unblocking of vcpu.
>    

Is this actually correct?  There were a bunch of workarounds and fixes 
put into this code over time.  Please check with Chris Lalancette, I 
think he was the last to touch this code.

> Signed-off-by: Jason Wang<jasowang@redhat.com>
> ---
>   arch/x86/kvm/i8254.c |    9 ---------
>   arch/x86/kvm/irq.c   |    7 +------
>   2 files changed, 1 insertions(+), 15 deletions(-)
>
> diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
> index ddeb231..2ad40a4 100644
> --- a/arch/x86/kvm/i8254.c
> +++ b/arch/x86/kvm/i8254.c
> @@ -232,15 +232,6 @@ static void pit_latch_status(struct kvm *kvm, int channel)
>   	}
>   }
>
> -int pit_has_pending_timer(struct kvm_vcpu *vcpu)
> -{
> -	struct kvm_pit *pit = vcpu->kvm->arch.vpit;
> -
> -	if (pit&&  kvm_vcpu_is_bsp(vcpu)&&  pit->pit_state.irq_ack)
> -		return atomic_read(&pit->pit_state.pit_timer.pending);
> -	return 0;
> -}
> -
>   static void kvm_pit_ack_irq(struct kvm_irq_ack_notifier *kian)
>   {
>   	struct kvm_kpit_state *ps = container_of(kian, struct kvm_kpit_state,
> diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c
> index 2095a04..f994da4 100644
> --- a/arch/x86/kvm/irq.c
> +++ b/arch/x86/kvm/irq.c
> @@ -33,12 +33,7 @@
>    */
>   int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
>   {
> -	int ret;
> -
> -	ret = pit_has_pending_timer(vcpu);
> -	ret |= apic_has_pending_timer(vcpu);
> -
> -	return ret;
> +	return apic_has_pending_timer(vcpu);
>   }
>   EXPORT_SYMBOL(kvm_cpu_has_pending_timer);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>    


  parent reply	other threads:[~2010-08-30 21:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27  9:15 [PATCH] KVM: pit: Do not check pending pit timer in vcpu thread Jason Wang
2010-08-27 17:10 ` Marcelo Tosatti
2010-08-29  9:04 ` Avi Kivity
2010-08-30 21:33 ` Zachary Amsden [this message]
2010-08-31  6:25   ` 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=4C7C23AD.3090907@redhat.com \
    --to=zamsden@redhat.com \
    --cc=avi@redhat.com \
    --cc=clalance@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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