From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, Keir Fraser <keir@xen.org>
Subject: Re: [Patch v5 2/5] x86/hpet: Use singe apic vector rather than irq_descs for HPET interrupts
Date: Tue, 26 Nov 2013 18:32:04 +0000 [thread overview]
Message-ID: <5294E924.7060903@citrix.com> (raw)
In-Reply-To: <52930F5B020000780010654D@nat28.tlf.novell.com>
On 25/11/13 07:50, Jan Beulich wrote:
>>>> On 22.11.13 at 17:23, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 22/11/13 15:45, Jan Beulich wrote:
>>>>>> On 14.11.13 at 17:01, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>> The new logic is as follows:
>>>> * A single high priority vector is allocated and uses on all cpus.
>>> Does this really need to be a high priority one? I'd think we'd be
>>> fine with the lowest priority one we can get, as we only need the
>>> wakeup here if nothing else gets a CPU to wake up.
>> Yes - absolutely. We cannot have an HPET interrupt lower priority than
>> a guest line level interrupt.
>>
>> Another cpu could be registered with our HPET channel to be worken up,
>> and we need to service them in a timely fashon.
> Which I meanwhile think hints at an issue with the (re)design:
> These wakeups, from an abstract pov, shouldn't be high
> priority interrupts - they're meant to wake a CPU only when
> nothing else would wake them in time. And this could be
> accomplished by transferring ownership of the channel during
> wakeup from the waking CPU to the next one to wake.
>
> WHich at once would eliminate the bogus logic selecting a channel
> for a CPU to re-use when no free one is available: It then wouldn't
> really matter which one gets re-used (i.e. could be assigned in e.g.
> a round robin fashion).
>
> The fundamental requirement would be to run the wakeup (in
> particular channel re-assignment) logic not just from the HPET
> interrupt, but inside an exit_idle() construct called from all IRQ
> paths (similar to how Linux does this).
>
> Jan
>
Irrespective of the problem of ownership, the HPET interrupt still needs
to be high priority. Consider the following scenario:
* A line level interrupt is received on pcpu 0. It is left outstanding
at the LAPIC.
* A domain is scheduled on pcpu 0, and has has an event injected for the
line level interrupt.
* The event handler takes a long time, and during the process, the
domains vcpu is rescheduled elsewhere
* pcpu0 is now completely idle and goes to sleep.
This scenario has pcpu 0 going to sleep with an outstanding line level
irq unacked at the LAPIC, with a low priority HPET interrupt blocked
until the domain has signalled the completion of the event.
There is no safe scenario (given Xen's handling of line level interrupt)
for timer interrupts to be lower priority than the highest possible line
level priority.
~Andrew
next prev parent reply other threads:[~2013-11-26 18:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 17:59 [RFC v4 0/5] HPET fix interrupt logic Andrew Cooper
2013-11-13 17:59 ` [Patch v4 1/5] x86/hpet: Pre cleanup Andrew Cooper
2013-11-13 17:59 ` [Patch v4 2/5] x86/hpet: Use singe apic vector rather than irq_descs for HPET interrupts Andrew Cooper
2013-11-14 15:52 ` Tim Deegan
2013-11-14 15:56 ` Andrew Cooper
2013-11-14 16:01 ` [Patch v5 " Andrew Cooper
2013-11-22 15:45 ` Jan Beulich
2013-11-22 16:23 ` Andrew Cooper
2013-11-22 16:49 ` Jan Beulich
2013-11-22 17:38 ` Andrew Cooper
2013-11-25 7:52 ` Jan Beulich
2013-11-25 7:50 ` Jan Beulich
2013-11-26 18:32 ` Andrew Cooper [this message]
2013-11-27 8:35 ` Jan Beulich
2013-11-27 22:37 ` Andrew Cooper
2013-11-28 14:33 ` Jan Beulich
2013-11-28 15:06 ` Andrew Cooper
2013-11-13 17:59 ` [Patch v4 3/5] x86/hpet: Post cleanup Andrew Cooper
2013-11-13 17:59 ` [Patch v4 4/5] x86/hpet: Debug and verbose hpet logging Andrew Cooper
2013-11-13 17:59 ` [Patch v4 5/5] x86/hpet: debug keyhandlers Andrew Cooper
-- strict thread matches above, loose matches on Subject: below --
2014-03-05 15:43 [RFC v5 0/5] HPET fix interrupt logic Andrew Cooper
2014-03-05 15:43 ` [PATCH v5 2/5] x86/hpet: Use singe apic vector rather than irq_descs for HPET interrupts Andrew Cooper
2014-03-06 14:11 ` Tim Deegan
2014-03-06 14:33 ` Jan Beulich
2014-03-06 14:40 ` Andrew Cooper
2014-03-06 15:38 ` Jan Beulich
2014-03-06 16:08 ` Jan Beulich
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=5294E924.7060903@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).