Skip to contentSkip to conversation

Rép. : Re: [Xenomai-help] Switch mode with x86

DISCUSSION Nicolas BLANCHARD 1 participant 1 message Dec 5, 2006

lore
Share & tools
lore
#0 lore raw

hello Jan,

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

Jan Kiszka <[email protected]> 04.12 22:06 >>>

Quoted 2 lines · Jan Kiszka

...
This indicates that we face an I-pipe bug: the scheduled Linux call

on

Quoted 1 line
Quoted 1 line

relaxation of TASK2 and then later TASK1 somehow gets lost (there is

no

Quoted 6 lines
Quoted 1 line

rthal_apc_handler in the remaining trace).

I think I got it. No I-pipe bug, but one in the HAL.

What happened? A weird race caused by the unprotected optimisation to only call rthal_schedule_irq() if there is no APC pending yet. This

is

Quoted 16 lines

the constellation I finally worked out via instrumenting and tracing:

PRIO 1:
rthal_apc_schedule()
test&set rthal_apc_pending
(but no rthal_schedule_irq() yet)

                      -PREEMPTION-

                                       PRIO 99:
                                       ...
                                       rthal_apc_schedule()
                                         test rthal_apc_pending
                                         (already set => no
                                         rthal_schedule_irq()!)
Quoted 1 line

So, no one reported the ACP to I-pipe, and no one ever will in

Nicolas

Quoted 3 lines

scenario - soft lock-up!

Nicolas, please give the attached patch a try. Your test is running

fine

Quoted 1 line

for me now.

I've applied your patch and it seems to run correctly ... congratulation.
I've read you discussion about this problem with Gilles, but I've don't really
understand how you have solved the problem (and what was exactly the problem).
If you have time to explain, i'm interested ...

Quoted 3 lines

At this chance: do we need rthal_apc_schedule() returning the

previous

Quoted 1 line

state at all? No current caller checks the return value. If it's OK

to

Quoted 3 lines

clean this up, I will post a combined patch.

Jan

An other things with switch mode, sometime i lose my i/o privilege put with the
system call ioperm (in the main function of my program).
My application stop with a "killed" message in the console and in /proc/xenomai/fault i've an "general fault".
To ignore this problem, i use the call system iopl (with full privilege) or
recall ioperm before each inb or outb.
But there is a problem, why i/o privilege are losted ?
I've read an similar problem in an archive of Rtai/fusion help mailing-list ...
If you have an idea.

thanks
nicolas blanchard