On Tue, 2011-02-01 at 10:44 +0100, [email protected]
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.



_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to