KVM: pit: Do not check pending pit timer in vcpu thread
PATCH 1/1 KVM: pit: Do not check pending pit timer in vcpu thread
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.
--- arch/x86/kvm/i8254.c | 9 --------- arch/x86/kvm/irq.c | 7 +------ 2 files changed, 1 insertions(+), 15 deletions(-)
arch/x86/kvm/i8254.c +0 -9
@@ -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,
arch/x86/kvm/irq.c +1 -6
@@ -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);
Quoted 5 lines · Jason Wang
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 <[email protected]>
Looks good to me.
Avi Kivity
AppliedQuoted 3 lines · Jason Wang
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.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 4 lines · Jason Wang
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.
Quoted 50 lines
Signed-off-by Jason Wang<[email protected]>--- arch/x86/kvm/i8254.c | 9 --------- arch/x86/kvm/irq.c | 7 +------ 2 files changed, 1 insertions(+), 15 deletions(-)arch/x86/kvm/i8254.c +0
-9@@ -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,arch/x86/kvm/irq.c +1
-7@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Zachary Amsden
Quoted 3 lines · Jason Wang
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.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.