From: Jan Kiszka <jan.kiszka@domain.hid>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] [RFC][PATCH] shirq locking rework
Date: Wed, 20 Jun 2007 23:58:26 +0200 [thread overview]
Message-ID: <4679A302.2060403@domain.hid> (raw)
In-Reply-To: <b647ffbd0706201404r256038b7sbb9318cdc1746b7c@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 1790 bytes --]
Dmitry Adamushko wrote:
> Hello Jan,
>
>> Well, I hate nested locks when it comes to real-time, but in this case I
>> really found no simpler approach. There is the risk of deadlocks via
>>
>> IRQ: xnintr_shirq::lock -> handler -> nklock vs.
>> Application: nklock -> xnintr_attach/detach -> xnintr_shirq::lock,
>
> it's also relevant for the current code - xnintr_attach/detach() must
> not be called while holding the 'nklock'.
That's good, no new restriction (the existing one will be documented now).
>
> I think, your approach should work as well.. provided we have only a
> single reader vs. a single writter contention case, which seems to be
> the case here ('intrlock' is responsible for synchronization between
Single writer is ensured by intrlock, single reader comes from the
per-IRQ scope of the inner lock.
> xnintr_attach/detach()).. your approach does increase a worst case
> length of the lock(&intrlock) --> unlock(&intrlock) section... but
> that's unlikely to be critical.
>
> I think, the patch I sent before addresses a reported earlier case
> with xnintr_edge_shirq_handler().. but your approach does make code
> shorter (and likely simpler), right? I don't see any problems it would
> possibly cause (maybe I'm missing smth yet :)
I must confess I didn't get your idea immediately. Later on (cough,
after hacking my own patch, cough) I had a closer look, and it first
appeared fairly nice, despite the additional "ifs". But then I realised
that "end == old_end" may produce false positives in case we have
several times the same (and only the same) IRQ in a row. So, I'm afraid
we have to live with only one candidate. :->
OK, will point our bug reporter to that patch now and ask for testing.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2007-06-20 21:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-19 18:40 [Xenomai-core] [RFC][PATCH] shirq locking rework Jan Kiszka
2007-06-20 21:04 ` Dmitry Adamushko
2007-06-20 21:58 ` Jan Kiszka [this message]
2007-06-21 8:03 ` Dmitry Adamushko
2007-06-21 9:20 ` Jan Kiszka
2007-06-21 9:52 ` Dmitry Adamushko
2007-06-21 12:56 ` Jan Kiszka
2007-06-21 13:14 ` Dmitry Adamushko
2007-06-21 13:40 ` Jan Kiszka
2007-06-22 11:53 ` Jan Kiszka
2007-06-22 12:17 ` Dmitry Adamushko
2007-06-22 12:24 ` Jan Kiszka
[not found] ` <467A5B85.9010103@domain.hid>
2007-06-21 17:24 ` Philippe Gerum
2007-06-21 17:46 ` Jan Kiszka
-- strict thread matches above, loose matches on Subject: below --
2007-06-25 19:11 Dmitry Adamushko
2007-06-25 20:29 ` Jan Kiszka
2007-06-30 8:36 ` 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=4679A302.2060403@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.