From: Philippe Gerum <rpm@xenomai.org>
To: roderik.wildenburg@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] CONFIG_XENO_OPT_SELECT
Date: Tue, 01 Feb 2011 10:59:13 +0100 [thread overview]
Message-ID: <1296554353.2071.17.camel@domain.hid> (raw)
In-Reply-To: <3FF315C710820E47A04E55C6F7D9B0AD5F32E2@domain.hid>
On Tue, 2011-02-01 at 10:44 +0100, roderik.wildenburg@domain.hid
wrote:
> > What bothers me, is that we should not even be able to
> > read /proc/xenomai/sched from an unrelated shell, in case we had a
> > runaway primary or even secondary SCHED_FIFO task. (IIRC, Roderik is
> > running Xenomai over a single core ppc board, mpc52xx/icecube).
> >
>
> Yes this is amazing. The stuck task seems just to be marked running, but isn´t really consuming CPU. Or could the linux kernel also be stuck at the callers prio and therefore execute other syscalls? (Or the task is simply running very often (every time we look at /proc/xenomai sched), so it just seems to be stuck at R).
>
This clearly points the finger at the prio coupling code. Basically, the
root thread is never downgraded to its original priority, despite the
boost should have been lifted (typically because the relaxed thread is
blocked on a linux syscall, or moved back to primary mode -- in your
case, the former case is likely relevant).
> Another irregularity we observed after we replaced the select-call by a poll-call: In this case everything went fine apart from that mode switches and context switches in /proc/xenomai/stat weren´t incremented any more, even though we are sure that the task is running and yielding CPU.
>
I suspect that by calling Xenomai's wrapped select(), your thread moves
to primary mode (this happens regardless of whether OPT_SELECT is
enabled or not). Therefore, that thread migrates back and forth between
the primary and secondary modes, because if OPT_SELECT is switched off,
your request is automatically forwarded to __real_select() after -ENOSYS
is received from the Xenomai nucleus. Because your thread somehow
oscillates between the two runtime modes at high frequency, the prio
coupling bug is more prone to happen.
OTOH, if your thread directly calls __real_select(), it simply remains
in secondary mode, so the prio coupling bug does not bite.
You could try to confirm this by switching off OPT_PRIOCPL.
> Roderik
>
> --------------------------------------------------------
> manroland AG
> Vorsitzender des Aufsichtsrates: Hanno C. Fiedler
> Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus Rall, Paul Steidle
> Sitz der Gesellschaft: Offenbach am Main, Registergericht: Amtsgericht Offenbach HRB-Nr. 42592
> USt-Ident-Nr. DE 250200933
--
Philippe.
next prev parent reply other threads:[~2011-02-01 9:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-31 9:46 [Xenomai-help] CONFIG_XENO_OPT_SELECT roderik.wildenburg
2011-01-31 10:07 ` Philippe Gerum
2011-01-31 14:47 ` Gilles Chanteperdrix
2011-01-31 15:07 ` Philippe Gerum
2011-01-31 15:11 ` Gilles Chanteperdrix
2011-01-31 15:17 ` Philippe Gerum
2011-02-01 9:44 ` roderik.wildenburg
2011-02-01 9:59 ` Philippe Gerum [this message]
2011-02-01 9:23 ` roderik.wildenburg
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=1296554353.2071.17.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=roderik.wildenburg@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.