From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Stoidner, Christoph" <c.stoidner@arvero.de>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Sleeping function called from invalid context
Date: Thu, 11 Dec 2014 17:38:07 +0100 [thread overview]
Message-ID: <20141211163807.GD27793@hermes.click-hack.org> (raw)
In-Reply-To: <e8d20d65a12c4549a2a1737501ea48dc@EX132MBOX1A.de2.local>
On Thu, Dec 11, 2014 at 04:31:38PM +0000, Stoidner, Christoph wrote:
> >> > Ok, maybe we have some hope with the tracer though. What should
> >> > trigger a trace is the fact that a relax request has been sent, but
> >> > that the next linux scheduling point does not wake up the said task.
> >> > This is all debug code, so it does not need to be clean. You can
> >> > define a per-cpu variable (if running on SMP systems, otherwise a
> >> > global variable will do) with the last request posted. And when a
> >> > linux scheduling happens, test that the newly scheduled task is the
> >> > task that was passed to the relax, if that is not the case, trigger
> >> > a trace freeze. The point where the nucleus is informed of a Linux
> >> > task switch is do_schedule_event(). The trick is that if you have
> >> > some tasks with a higher priority than the relaxed task, it is
> >> > normal that the relaxed task is not scheduled immediately, so if you
> >> > want the condition to hold, you need to run the xenomai tasks which
> >> > relax with the highest priority. Also, obviously, after the test,
> >> > the pointer should be reset to NULL, because there are several task
> >> > queued, and with a global variable you have no way of knowing which
> >> > is next.
> >>
> >> I will do so. Do I have to change the gatekeeper's priority behind the relaxing
> >> task to assure that the gatekeeper would be scheduled before?
> >
> > The gatekeeper is not involved.
>
> Sorry, I wanted to say: "that gatekeeper would NOT be scheduled before?". Otherwise
> we see possibly the gatekeeper instead of the relaxed task? Or am I wrong?
I meant to say the gatekeeper is not involved in the primary to
secondary mode switches, only in the secondary to primary mode
switches. But yes, since it runs with the highest priority, it may
be the one scheduled when back to primary mode. Though I would say
it is probably very unlikely, since the events activating the
gatekeeper is a secondary mode event, which by definition could not
have happened while another task was in primary mode. So what could
happen is that one task running in secondary mode tries to switch to
primary mode, at which point, before the gatekeeper is even
activated, another task running in primary mode is activated
(perhaps because it is waiting for an interrupt, may it be atimer).
--
Gilles.
next prev parent reply other threads:[~2014-12-11 16:38 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-10 18:58 [Xenomai] Sleeping function called from invalid context Stoidner, Christoph
2014-12-10 19:01 ` Gilles Chanteperdrix
2014-12-11 10:00 ` Stoidner, Christoph
2014-12-11 10:05 ` Gilles Chanteperdrix
2014-12-11 10:18 ` Stoidner, Christoph
2014-12-11 10:22 ` Gilles Chanteperdrix
2014-12-11 10:29 ` Stoidner, Christoph
2014-12-11 10:47 ` Gilles Chanteperdrix
2014-12-11 11:17 ` Stoidner, Christoph
2014-12-11 14:47 ` Gilles Chanteperdrix
2014-12-11 15:47 ` Stoidner, Christoph
2014-12-11 16:06 ` Gilles Chanteperdrix
2014-12-11 16:31 ` Stoidner, Christoph
2014-12-11 16:38 ` Gilles Chanteperdrix [this message]
2014-12-11 19:23 ` Stoidner, Christoph
2014-12-12 16:42 ` Stoidner, Christoph
2014-12-15 11:42 ` Stoidner, Christoph
2014-12-15 13:23 ` Gilles Chanteperdrix
2014-12-15 13:29 ` Stoidner, Christoph
2014-12-15 14:20 ` Gilles Chanteperdrix
2014-12-15 15:11 ` Stoidner, Christoph
2014-12-15 15:19 ` Gilles Chanteperdrix
2014-12-17 12:24 ` Stoidner, Christoph
2014-12-17 12:38 ` Gilles Chanteperdrix
2014-12-17 13:22 ` Gilles Chanteperdrix
2014-12-17 15:46 ` Gilles Chanteperdrix
2014-12-17 22:40 ` Stoidner, Christoph
-- strict thread matches above, loose matches on Subject: below --
2014-12-06 14:19 Stoidner, Christoph
2014-12-06 14:25 ` Gilles Chanteperdrix
2014-12-06 15:11 ` Stoidner, Christoph
2014-12-07 12:32 ` Stoidner, Christoph
2014-12-07 12:40 ` Gilles Chanteperdrix
2014-12-07 13:50 ` Stoidner, Christoph
2014-12-07 13:52 ` Gilles Chanteperdrix
2014-12-07 15:05 ` Stoidner, Christoph
2014-12-09 20:06 ` Stoidner, Christoph
2014-12-09 20:08 ` Gilles Chanteperdrix
2014-12-09 20:18 ` Stoidner, Christoph
2014-12-09 20:24 ` Gilles Chanteperdrix
2014-12-09 20:34 ` Stoidner, Christoph
2014-12-09 20:37 ` Gilles Chanteperdrix
2014-12-09 20:47 ` Stoidner, Christoph
2014-12-09 20:55 ` Gilles Chanteperdrix
2014-12-09 20:49 ` Stoidner, Christoph
2014-12-09 20:59 ` Gilles Chanteperdrix
2014-12-10 16:23 ` Stoidner, Christoph
2014-12-10 16:26 ` Gilles Chanteperdrix
2014-12-10 18:23 ` Stoidner, Christoph
2014-12-10 18:41 ` Gilles Chanteperdrix
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=20141211163807.GD27793@hermes.click-hack.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=c.stoidner@arvero.de \
--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.