All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Tschaeche IT-Services <services@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Handling Linux Signals in primary domain context
Date: Tue, 01 Jun 2010 15:59:48 +0200	[thread overview]
Message-ID: <4C051254.3000103@domain.hid> (raw)
In-Reply-To: <20100601135005.GA5483@domain.hid>

Tschaeche IT-Services wrote:
> Hi,
> 
> we have the following scenario:
> 
> A high priority periodic primary domain task (H), which calls
> rt_task_suspend(L) in each even period and rt_task_resume(L)
> in each odd period on a low priority primary domain task (L).
> L-task consumes all available CPU resources (while(1)).
> Thus, the rest of each cycle (after H has got the CPU) is used
> alternately by L-task, ROOT-task, L-task,...
> 
> In our debugging implementation, we send a SIGTRAP to L-task.
> H-task recognizes this by reporting EINTR when calling rt_task_suspend(L).
> But, the while(1) in L-task is not interrupted although there is a SIGTRAP
> pending.

That is expected, the automatic migration from primary mode to secondary
mode when recieving a signal only works if the task emits syscall.

> 
> Our workaround could be, to send a rt_signal when rt_task_suspend()
> returns EINTR and, then, in the rt-signal handler migrate L-task
> to secondary domain (calling rt_task_set_mode(T_PRIMARY,0))
> initiating the Linux scheduler, which, then, initiates the SIGTRAP handling
> in secondary domain context.
> 
> Is there a simpler way to get primary domain tasks interrupted
> by Linux signals? Xenomai already knows about the pending signal
> and, maybe, could initiate the secondary domain switch on a primary scheduler
> event.

Xenomai tasks are expected to emit system calls from time to time. I am
afraid your use case is kind of out of what Xenomai was made for.

-- 
					    Gilles.


  parent reply	other threads:[~2010-06-01 13:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 13:50 [Xenomai-help] Handling Linux Signals in primary domain context Tschaeche IT-Services
2010-06-01 13:52 ` Gilles Chanteperdrix
2010-06-01 13:59 ` Gilles Chanteperdrix [this message]
2010-06-01 14:32 ` Philippe Gerum
2010-06-01 15:54   ` Tschaeche IT-Services
2010-06-01 16:52     ` Tschaeche IT-Services
2010-06-01 16:58     ` Jan Kiszka
2010-06-02  8:36       ` Gilles Chanteperdrix
2010-06-02  9:14         ` Jan Kiszka
2010-06-02  9:15         ` Philippe Gerum
2010-06-02  9:20           ` Jan Kiszka
2010-06-02  9:28             ` Philippe Gerum
2010-06-02  9:37               ` Gilles Chanteperdrix
2010-06-02 10:06                 ` Philippe Gerum
2010-06-02 10:19                   ` Gilles Chanteperdrix
2010-06-02 10:42                     ` Philippe Gerum
2010-06-02 10:51                       ` Gilles Chanteperdrix
2010-06-02 10:29                   ` Gilles Chanteperdrix
2010-06-02  9:21           ` Gilles Chanteperdrix
2010-06-02  9:23             ` Jan Kiszka
2010-06-02 10:19               ` Tschaeche IT-Services
2010-06-02 10:48                 ` Gilles Chanteperdrix
2010-06-02  9:34             ` Philippe Gerum
2010-06-02  9:43               ` Gilles Chanteperdrix
2010-06-02 12:02           ` Daniele Nicolodi
2010-06-02 13:47             ` Gilles Chanteperdrix
2010-06-02 15:14             ` 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=4C051254.3000103@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=services@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.