From: Avi Kivity <avi@redhat.com>
To: Chris Lalancette <clalance@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 03/12] Remove KVM_REQ_PENDING_TIMER.
Date: Wed, 02 Dec 2009 16:16:53 +0200 [thread overview]
Message-ID: <4B1676D5.8070209@redhat.com> (raw)
In-Reply-To: <4B1664BD.7040201@redhat.com>
On 12/02/2009 02:59 PM, Chris Lalancette wrote:
> On 12/01/2009 08:04 PM, Jan Kiszka wrote:
>
>> Chris Lalancette wrote:
>>
>>> KVM_REQ_PENDING_TIMER is set and cleared in a couple of places,
>>> but it never seems to be actually checked. Remove it.
>>>
>>>
>> I would suggest to study the introducing commit
>> 06e05645661211b9eaadaf6344c335d2e80f0ba2. My strong feeling is that this
>> removal is wrong.
>>
> Ah, thanks. Now I see what you mean. In newer KVM, if you are in
> __vcpu_run() and are in the while (r> 0) loop, after you've
> done kvm_inject_pending_timer_irqs(), but before you do the next
> __vcpu_run() (and hence disabled local IRQs), you could receive an
> hrtimer callback. In that case I guess you would hit the
> if (vcpu->requests || need_resched() || signal_pending()) test, don't
> inject the interrupt, and possibly spend a long time in the guest
> before an unrelated event causes the exit and hence causes the timer
> injection.
>
> Well, that certainly is a bit subtle :). I think I might submit a
> patch to at least put a comment in vcpu_enter_guest() about this.
>
>
It is, and I don't like it much either.
> Unfortunately, this does sort of put a damper on what's going on later
> in the series. If the i8254 doesn't belong to the BSP (which it really
> shouldn't), then I don't know which vcpu to raise the bit on. Maybe I
> can do it in the kvm_irq_delivery_to_apic() function, or
> kvm_apic_set_irq(). I'll take a look at that.
>
We shouldn't have that bit at all.
An alternative is to make the pic/ioapic work in irq context
(spin_lock_irq() and friends) and queue the interrupt directly from the
hrtimer instead of the vcpu. My worry is that we have quite a bit of
work to do in irq context if the interrupt is broadcast and if we have
many vcpus; maybe we can use a work_struct in that case.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2009-12-02 14:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-01 14:36 [PATCH 0/12]: Fix kdump under KVM Chris Lalancette
2009-12-01 14:36 ` [PATCH 01/12] Fix up some comments around the source tree Chris Lalancette
2009-12-01 14:36 ` [PATCH 02/12] Make kvm_pic_reset static Chris Lalancette
2009-12-01 14:36 ` [PATCH 03/12] Remove KVM_REQ_PENDING_TIMER Chris Lalancette
2009-12-01 19:04 ` Jan Kiszka
2009-12-02 4:59 ` Marcelo Tosatti
2009-12-02 12:59 ` Chris Lalancette
2009-12-02 14:16 ` Avi Kivity [this message]
2009-12-02 14:22 ` Avi Kivity
2009-12-01 14:36 ` [PATCH 04/12] IOAPIC timer interrupt redirect Chris Lalancette
2009-12-02 5:03 ` Marcelo Tosatti
2009-12-01 14:36 ` [PATCH 05/12] Make the IOAPIC lock a spinlock Chris Lalancette
2009-12-02 14:27 ` Avi Kivity
2009-12-01 14:36 ` [PATCH 06/12] Make the PIC use interrupt safe locking Chris Lalancette
2009-12-01 14:36 ` [PATCH 07/12] Rename kvm_apic_accept_pic_intr Chris Lalancette
2009-12-02 14:24 ` Avi Kivity
2009-12-02 16:12 ` Gleb Natapov
2009-12-01 14:36 ` [PATCH 08/12] Remove timer.c Chris Lalancette
2009-12-02 5:11 ` Marcelo Tosatti
2009-12-01 14:36 ` [PATCH 09/12] Fix missing spin_lock in PIT timer Chris Lalancette
2009-12-01 14:36 ` [PATCH 10/12] Inject i8254 interrupts directly from hrtimer callback Chris Lalancette
2009-12-01 14:36 ` [PATCH 11/12] Allow the PIC to signal CPUs other than BSP Chris Lalancette
2009-12-01 14:36 ` [PATCH 12/12] Kick appropriate CPUs when signalling interrupts Chris Lalancette
2009-12-02 15:44 ` Gleb Natapov
2009-12-08 10:48 ` Chris Lalancette
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=4B1676D5.8070209@redhat.com \
--to=avi@redhat.com \
--cc=clalance@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
/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