kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: pit: Do not check pending pit timer in vcpu thread
@ 2010-08-27  9:15 Jason Wang
  2010-08-27 17:10 ` Marcelo Tosatti
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jason Wang @ 2010-08-27  9:15 UTC (permalink / raw)
  To: mtosatti, avi, kvm

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.

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);
 


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

* Re: [PATCH] KVM: pit: Do not check pending pit timer in vcpu thread
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Marcelo Tosatti @ 2010-08-27 17:10 UTC (permalink / raw)
  To: Jason Wang; +Cc: avi, kvm

On Fri, Aug 27, 2010 at 05:15:06PM +0800, 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.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Looks good to me.

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

* Re: [PATCH] KVM: pit: Do not check pending pit timer in vcpu thread
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2010-08-29  9:04 UTC (permalink / raw)
  To: Jason Wang; +Cc: mtosatti, kvm

  On 08/27/2010 12: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.

Applied, thanks.

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


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

* Re: [PATCH] KVM: pit: Do not check pending pit timer in vcpu thread
  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
  2010-08-31  6:25   ` Avi Kivity
  2 siblings, 1 reply; 5+ messages in thread
From: Zachary Amsden @ 2010-08-30 21:33 UTC (permalink / raw)
  To: Jason Wang; +Cc: mtosatti, avi, kvm, Chris Lalancette

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
>    


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

* Re: [PATCH] KVM: pit: Do not check pending pit timer in vcpu thread
  2010-08-30 21:33 ` Zachary Amsden
@ 2010-08-31  6:25   ` Avi Kivity
  0 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2010-08-31  6:25 UTC (permalink / raw)
  To: Zachary Amsden; +Cc: Jason Wang, mtosatti, kvm, Chris Lalancette

  On 08/31/2010 12:33 AM, Zachary Amsden wrote:
> 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.

Once upon a time we injected PIT interrupts from the vcpu thread (even 
though the PIT is external to any vcpu) which let to a lot of 
complications in the implementation.  This patch removes one of them.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


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

end of thread, other threads:[~2010-08-31  6:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2010-08-31  6:25   ` Avi Kivity

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).