From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: Jan Kiszka <jan.kiszka@domain.hid>, Xenomai-core@domain.hid
Subject: Re: [Xenomai-core] Houston, we have a circular problem
Date: Tue, 06 May 2008 09:57:49 +0200 [thread overview]
Message-ID: <48200F7D.9020004@domain.hid> (raw)
In-Reply-To: <481F4741.4080207@domain.hid>
Jan Kiszka wrote:
> Philippe Gerum wrote:
>> Jan Kiszka wrote:
>>> Gilles Chanteperdrix wrote:
>>>> On Mon, May 5, 2008 at 6:08 PM, Philippe Gerum <rpm@xenomai.org> wrote:
>>>>> do_schedule_event() is the culprit when it reads the pending signals on the
>>>>> shared queue (XNDEBUG check for rearming the timers),
>>>> A stupid suggestion: if we know that the spinlock is always locked
>>>> when calling do_schedule_event, maybe we can simply avoid the lock
>>>> there ?
>>> Would be the best solution - but I don't think so. After reading a bit
>>> more into the lockdep output, I think the issue is that _some_other_
>>> task my hold the siglock and then acquire our rq_lock, but not
>>> necessarily along a similar code path we took to acquire the siglock now.
>>>
>> Actually, this locking around the sigmask retrieval looks overkill, since we
>> only address ptracing signals here, and those should go through the shared
>> pending set, not through the task's private one. I.e. There should be no way to
>> get fooled by any asynchronous update of that mask.
>
> This is a debug helper anyway, so we risk (if I got this right) at worst
> a spurious unfreeze of the Xenomai timers. Does not really compare to
> the current deadlock...
>
As a matter of fact, we don't test any condition under the protection of this
lock, so aside of the memory barrier induced on SMP, this lock does not buy us
anything. Except a deadlock, that is...
> I will let my colleagues run the hunk below tomorrow (which works for me) -
> let's see if they manage to crash it again :P (they are experts in this!).
>
> Jan
>
> Index: xenomai-2.4.x/ksrc/nucleus/shadow.c
> ===================================================================
> --- xenomai-2.4.x/ksrc/nucleus/shadow.c (Revision 3734)
> +++ xenomai-2.4.x/ksrc/nucleus/shadow.c (Arbeitskopie)
> @@ -2194,9 +2194,7 @@ static inline void do_schedule_event(str
> if (signal_pending(next)) {
> sigset_t pending;
>
> - spin_lock(&wrap_sighand_lock(next)); /* Already interrupt-safe. */
> wrap_get_sigpending(&pending, next);
> - spin_unlock(&wrap_sighand_lock(next));
>
> if (sigismember(&pending, SIGSTOP) ||
> sigismember(&pending, SIGINT))
>
--
Philippe.
prev parent reply other threads:[~2008-05-06 7:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-05 15:44 [Xenomai-core] Houston, we have a circular problem Jan Kiszka
2008-05-05 16:04 ` Jan Kiszka
2008-05-05 16:08 ` Philippe Gerum
2008-05-05 16:12 ` Gilles Chanteperdrix
2008-05-05 16:23 ` Jan Kiszka
2008-05-05 16:35 ` Philippe Gerum
2008-05-05 16:52 ` Philippe Gerum
2008-05-05 17:43 ` Jan Kiszka
2008-05-06 7:57 ` Philippe Gerum [this message]
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=48200F7D.9020004@domain.hid \
--to=rpm@xenomai.org \
--cc=Xenomai-core@domain.hid \
--cc=jan.kiszka@domain.hid \
/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.