From: Jan Kiszka <jan.kiszka@web.de>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Xenomai <Xenomai@xenomai.org>
Subject: Re: [Xenomai] IO-APIC latencies
Date: Mon, 17 Sep 2012 10:18:13 +0200 [thread overview]
Message-ID: <5056DCC5.10909@web.de> (raw)
In-Reply-To: <5056DA52.6040006@xenomai.org>
On 2012-09-17 10:07, Gilles Chanteperdrix wrote:
> On 09/17/2012 09:43 AM, Jan Kiszka wrote:
>> On 2012-09-17 08:30, Gilles Chanteperdrix wrote:
>>>
>>> Hi,
>>>
>>> looking at x86 latencies, I found that what was taking long on my atom
>>> was masking the fasteoi interrupts at IO-APIC level. So, I experimented
>>> an idea: masking at LAPIC level instead of IO-APIC, by using the "task
>>> priority" register. This seems to improve latencies on my atom:
>>>
>>> http://sisyphus.hd.free.fr/~gilles/core-3.4-latencies/atom.png
>>>
>>> This implies splitting the LAPIC vectors in a high priority and low
>>> priority sets, the final implementation would use ipipe_enable_irqdesc
>>> to detect a high priority domain, and change the vector at that time.
>>>
>>> This also improves the latencies on my old PIII with a VIA chipset, but
>>> it generates spurious interrupts (I do not know if it really is a
>>> matter, as handling a spurious interrupt is still faster than masking an
>>> IO-APIC interrupt), the spurious interrupts in that case are a
>>> documented behaviour of the LAPIC.
>>>
>>> Is there any interest in pursuing this idea, or are x86 with slow
>>> IO-APIC the exception more than the rule, or having to split the vector
>>> space appears too great a restriction?
>>
>> Line-based interrupts are legacy, of decreasing relevance for PCI
>> devices - likely what we are primarily interesting in here - due to MSI.
>
> Even if I enable MSI, the kernel still uses these irqs for the
> peripherals integrated to the chipset, such as the USB HCI, or ATA
> driver (IOW, non PCI devices).
Those are all PCI as well. And modern chipsets include variants of them
with MSI(-X) support.
>
> atom login: root
> # cat /proc/interrupts
> CPU0 CPU1
> 0: 41 0 IO-APIC-edge timer
> 4: 39 0 IO-APIC-edge serial
> 9: 0 0 IO-APIC-fasteoi acpi
> 14: 0 0 IO-APIC-edge ata_piix
> 15: 0 0 IO-APIC-edge ata_piix
> 16: 0 0 IO-APIC-fasteoi uhci_hcd:usb5
> 18: 0 0 IO-APIC-fasteoi uhci_hcd:usb4
> 19: 0 0 IO-APIC-fasteoi ata_piix, uhci_hcd:usb3
> 23: 6598 0 IO-APIC-fasteoi ehci_hcd:usb1, uhci_hcd:usb2
> 43: 2704 0 PCI-MSI-edge eth0
> 44: 249 0 PCI-MSI-edge snd_hda_intel
> NMI: 0 0 Non-maskable interrupts
> LOC: 661 644 Local timer interrupts
> SPU: 0 0 Spurious interrupts
> PMI: 0 0 Performance monitoring interrupts
> IWI: 0 0 IRQ work interrupts
> RTR: 0 0 APIC ICR read retries
> RES: 1582 2225 Rescheduling interrupts
> CAL: 26 48 Function call interrupts
> TLB: 10 19 TLB shootdowns
> ERR: 0
> MIS: 0
>
> I do not think peripherals integrated to chipsets can really be
> considered "legacy". And they tend to be used in the field...
The good news is that, even on your low-end atom, you can avoid those
latencies by CPU assignment, i.e. isolating the Linux IRQ load on one
core and the RT on the other. That's getting easier and easier due to
the inflation of cores.
>
>> So I tend to say "don't worry", specifically as fiddling with vector
>> allocations will require yet another round of invasive changes to the
>> IRQ subsystem of Linux.
>
> The changes would be minimally invasive, we would reuse the functions
> already existing (clear_irq_vector and assign_irq_vector).
>
You will have to rearrange vector assignment and mask those vectors on
all CPUs, possibly complicated my affinity changes. That's worrying me
as well. But I'm also open for discussing a prototype.
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20120917/8d32f70e/attachment.pgp>
next prev parent reply other threads:[~2012-09-17 8:18 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 6:30 [Xenomai] IO-APIC latencies Gilles Chanteperdrix
2012-09-17 7:43 ` Jan Kiszka
2012-09-17 8:07 ` Gilles Chanteperdrix
2012-09-17 8:18 ` Jan Kiszka [this message]
2012-09-17 8:32 ` Gilles Chanteperdrix
2012-09-17 9:07 ` Jan Kiszka
2012-09-17 9:29 ` Gilles Chanteperdrix
2012-09-17 9:42 ` Jan Kiszka
2012-09-17 10:00 ` Gilles Chanteperdrix
2012-09-17 10:39 ` Henri Roosen
2012-09-17 11:14 ` Gilles Chanteperdrix
2012-09-17 12:15 ` Henri Roosen
2012-09-17 12:27 ` Jan Kiszka
2012-09-17 13:46 ` Gilles Chanteperdrix
2012-09-17 13:54 ` Jan Kiszka
2012-09-17 14:02 ` Gilles Chanteperdrix
2012-09-17 14:35 ` Jan Kiszka
2012-09-17 17:46 ` Gilles Chanteperdrix
2012-09-17 18:05 ` Jan Kiszka
2012-09-17 18:08 ` Gilles Chanteperdrix
2012-09-17 18:12 ` Jan Kiszka
2012-09-17 18:13 ` Gilles Chanteperdrix
2012-09-17 18:15 ` Jan Kiszka
2012-09-17 18:16 ` Gilles Chanteperdrix
2012-09-17 18:18 ` Jan Kiszka
2012-09-17 18:18 ` Gilles Chanteperdrix
2012-09-17 18:22 ` Gilles Chanteperdrix
2012-09-17 18:29 ` Jan Kiszka
2012-09-17 18:37 ` Gilles Chanteperdrix
2012-09-17 18:54 ` Jan Kiszka
2012-09-17 21:50 ` Gilles Chanteperdrix
2012-09-18 8:48 ` Jan Kiszka
2012-09-18 9:06 ` Gilles Chanteperdrix
2012-09-18 9:12 ` Gilles Chanteperdrix
2012-09-18 9:30 ` Jan Kiszka
2012-09-18 9:36 ` Gilles Chanteperdrix
2012-09-17 18:15 ` Gilles Chanteperdrix
2012-09-17 12:12 ` Richard Cochran
2012-09-17 12:21 ` Gilles Chanteperdrix
2012-09-17 12:27 ` Jan Kiszka
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=5056DCC5.10909@web.de \
--to=jan.kiszka@web.de \
--cc=Xenomai@xenomai.org \
--cc=gilles.chanteperdrix@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.