From: Philippe Gerum <rpm@xenomai.org>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: xenomai@xenomai.org
Subject: [Xenomai-core] Re: [REQUEST] eliminate the rthal_critical_enter/exit() from rthal_irq_request()
Date: Mon, 24 Apr 2006 10:19:00 +0200 [thread overview]
Message-ID: <444C89F4.3040302@domain.hid> (raw)
In-Reply-To: <b647ffbd0604220254l154fcc7dh462c7d45bcd2c441@domain.hid>
Dmitry Adamushko wrote:
> Hi,
>
> I haven't had access to my laptop during this week so the patches
> follow only now.
>
Merged, thanks.
> Yet another issue remains that may lead to a deadlock under some circumstances:
>
> - rt_intr_delete() calls xnintr_detach() while holding the "nklock".
>
> - xnintr_detach() (with CONFIG_SMP) spins in xnintr_shirq_spin()
> when a corresponding ISR is currently running.
>
> - now this ISR calls any function that uses "nklock" (everything make
> use of it) ... Bum!
>
> I first thought about moving xnintr_detach() out of the locked section
> in rt_intr_delete() but it somewhat breaks interface consistency ---
> e.g. xeno_mark_delete() is called before the object is completely
> destroyed.
>
That's not a problem, the deletion marker will never be anything else
than a pure magic word stored in some object's descriptor, so we could
indeed first mark the object as deleted, then release the lock before
proceeding to the actual deletion.
> Another approach would be to introduce a service like
> xnintr_synchronize() and enfource the upper interfaces (e.g. skins) to
> make use of it in their _delete() methods.
That would be useful too for solving the "concurrent ISR while deleting
issue", but would not enforce single deletion in the SMP case, I guess.
>
> The problem here is that the xnintr_shirq - interface is not complete
> and safe without xnintr_shirq_spin() on detaching step and it becomes
> somewhat blured with the enforcement like "on SMP systems one should
> always call xnintr_synchronize() right after calling xnintr_detach()".
>
> So I'm still thinking how to fix it better...
>
>
> --
> Best regards,
> Dmitry Adamushko
--
Philippe.
next prev parent reply other threads:[~2006-04-24 8:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-12 8:38 [Xenomai-core] [REQUEST] eliminate the rthal_critical_enter/exit() from rthal_irq_request() Dmitry Adamushko
2006-04-15 21:44 ` [Xenomai-core] " Philippe Gerum
2006-04-22 9:54 ` Dmitry Adamushko
2006-04-24 8:19 ` Philippe Gerum [this message]
2006-04-24 9:28 ` Dmitry Adamushko
2006-04-27 8:16 ` Dmitry Adamushko
2006-04-27 12:21 ` Philippe Gerum
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=444C89F4.3040302@domain.hid \
--to=rpm@xenomai.org \
--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.