All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Watchdog / immediate Linux signal delivery
Date: Tue, 10 Mar 2009 14:17:03 +0100	[thread overview]
Message-ID: <49B6684F.5050204@domain.hid> (raw)
In-Reply-To: <49B64A7F.4030809@domain.hid>

Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> Philippe Gerum wrote:
>>> Jan Kiszka wrote:
>>>> Philippe Gerum wrote:
>>>>> Jan Kiszka wrote:
>>>>>> Meanwhile I played with some light-weight approach to relax a thread
>>>>>> that received a signal (according to do_sigwake_event). Worked, but only
>>>>>> once due to a limitation (if not bug) of I-pipe x86: in __ipipe_run_isr,
>>>>>> it does not handle the case that a non-root handler may alter the
>>>>>> current domain, causing corruptions to the IPIPE_SYNC_FLAG states of the
>>>>>> involved domains.
>>>>> It is not a bug, this is wanted. ISR must neither change the current
>>>>> domain nor migrate CPU; allowing this would open Pandora's box.
>>>> And if there is no way to migrate from within an ISR, we can bury any
>>>> attempt to deliver signals to spinning Xenomai threads - or what other
>>>> context would remain to Xenomai for triggering migration?
>>>>
>>> The two-phase solution I have mentioned would work.
>> Something like:
>>
>> Index: ksrc/nucleus/sched.c
>> ===================================================================
>> --- ksrc/nucleus/sched.c        (revision 4678)
>> +++ ksrc/nucleus/sched.c        (working copy)
>> @@ -75,7 +75,13 @@ static void xnsched_watchdog_handler(str
>>                            thread, xnthread_name(thread));
>>                 xnprintf("watchdog triggered -- killing runaway thread
>> '%s'\n",
>>                          xnthread_name(thread));
>> -               xnpod_delete_thread(thread);
>> +#ifdef CONFIG_XENO_OPT_PERVASIVE
>> +               if (xnthread_user_task(thread)) {
>> +                       xnpod_suspend_thread(thread);
>> +                       xnshadow_send_sig(thread, SIGSEGV, 0, 1);
>> +               } else
>> +#endif /* CONFIG_XENO_OPT_PERVASIVE */
>> +                       xnpod_delete_thread(thread);
>>                 xnsched_reset_watchdog(sched);
>>         }
>>  }
> 
> Looks good - but we first have to establish that famous relax-on-pending
> signal thing...

Yes, obviously, it does not work, in other words...

-- 
                                                 Gilles.


  reply	other threads:[~2009-03-10 13:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-08 10:42 [Xenomai-core] Watchdog / immediate Linux signal delivery Jan Kiszka
2009-03-08 13:41 ` Gilles Chanteperdrix
2009-03-08 14:23   ` Jan Kiszka
2009-03-08 14:43     ` Gilles Chanteperdrix
2009-03-08 14:55       ` Jan Kiszka
2009-03-09 15:50 ` Philippe Gerum
2009-03-09 16:44   ` Jan Kiszka
2009-03-09 17:02     ` Gilles Chanteperdrix
2009-03-09 17:15       ` Jan Kiszka
2009-03-09 17:27       ` Philippe Gerum
2009-03-09 17:09     ` Philippe Gerum
2009-03-09 17:12       ` Jan Kiszka
2009-03-09 17:37         ` Philippe Gerum
2009-03-09 23:49           ` Jan Kiszka
2009-03-10  9:20             ` Philippe Gerum
2009-03-09 17:27       ` Jan Kiszka
2009-03-09 17:38         ` Philippe Gerum
2009-03-09 17:58           ` Gilles Chanteperdrix
2009-03-10 11:09             ` Jan Kiszka
2009-03-10 13:17               ` Gilles Chanteperdrix [this message]
2009-03-09 23:46           ` 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=49B6684F.5050204@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@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.