From: Jan Kiszka <jan.kiszka@domain.hid>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: xenomai@xenomai.org
Subject: [Xenomai-core] Re: [patch, RFC] detect unhandled interrupts
Date: Wed, 30 Aug 2006 19:33:25 +0200 [thread overview]
Message-ID: <44F5CBE5.9090908@domain.hid> (raw)
In-Reply-To: <b647ffbd0608301010m52b024fbibc444e10f4a42958@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2110 bytes --]
Dmitry Adamushko wrote:
> On 30/08/06, Jan Kiszka <jan.kiszka@domain.hid> wrote:
>>
>>
>> Mmh, considering this and also the existing code I wonder if we could
>> optimise this a bit. I'm only looking at xnintr_irq_handler now (sharing
>> is slow anyway): currently the intr object is touched both before
>> (naturally...) and after the call to the ISR handler. Maybe we can push
>> all accesses before the handler for the fast path. E.g.:
>>
>> int unhandled = intr->unhandled;
>>
> intr->unhandled = 0;
>> ++intr->hits;
>> s = intr->isr(...);
>>
>> if (s == XN_ISR_NONE) {
>> intr->unhandled = ++unhandled;
>> if (unhandled == XNINTR_MAX_UNHANDLED)
>> ALARM!
>> }
>
>
> so the idea is that we touch all intr members while they are hopefully in
> the same cache line (if it's 128 bits long) as the cache may be
> disturbed by
> ISR afterwards.
>
> But OTOH, we do an additional write "int unhandled = intr->unhandled;"
>
> (write-through cache) ---> put in cache + syncing with memory immediately
>
> (write-back cache) ---> put in cache + delay syncing (but will it still
> happen?)
>
> So while we avoid one possible read from the main memory into the cache
> when
> intr->unhandled and ->hits (ok, this one can be moved for sure) are called
> after ISR (and they are not in the cache), we introduce another one (at
> least for write-through it's 100%) that takes place before ISR and that's
> actually a "+" component to the IRQ latency.
>
> or I can be wrong though.
>
That also depends on what information the compiler keeps on the stack
and what in registers. On x86, sched of our xnintr_irq_handler remains
in some register while the ISR executes. The same may happen to
unhandled, but it's hard to predict. It's also the question what we want
to improve, ISR latencies or the final user latency (the latter includes
the post ISR part).
Ok, such stuff makes sense if we can say that for most cases (archs),
specifically low-end scenarios, there is some gain. Guess this would
need testing... :-/
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-08-30 17:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-29 19:28 [Xenomai-core] [patch, RFC] detect unhandled interrupts Dmitry Adamushko
[not found] ` <44F496D7.60609@domain.hid>
2006-08-29 19:38 ` [Xenomai-core] " Dmitry Adamushko
2006-08-29 19:50 ` Jan Kiszka
2006-08-29 20:34 ` Dmitry Adamushko
2006-08-30 13:18 ` Philippe Gerum
2006-08-30 16:03 ` Dmitry Adamushko
2006-08-30 16:20 ` Gilles Chanteperdrix
2006-08-30 13:29 ` Jan Kiszka
2006-08-30 17:10 ` Dmitry Adamushko
2006-08-30 17:25 ` Dmitry Adamushko
2006-08-31 8:12 ` Dmitry Adamushko
2006-08-30 17:33 ` Jan Kiszka [this message]
2006-08-30 17:55 ` Philippe Gerum
2006-08-30 18:50 ` Jan Kiszka
2006-08-30 20:47 ` Philippe Gerum
2006-08-30 20:55 ` Jan Kiszka
2006-08-30 20:59 ` Philippe Gerum
2006-08-30 21:01 ` Jan Kiszka
2006-08-30 21:58 ` Philippe Gerum
2006-08-31 8:31 ` [Xenomai-core] " Philippe Gerum
2006-08-31 19:11 ` Jan Kiszka
2006-08-31 19:31 ` Philippe Gerum
2006-08-31 19:49 ` Jan Kiszka
2006-08-31 19:48 ` Philippe Gerum
2006-08-31 20:02 ` Dmitry Adamushko
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=44F5CBE5.9090908@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=dmitry.adamushko@domain.hid \
--cc=xenomai@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.