Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-19
From: Florian Schmidt
Date: Thu Dec 02 2004 - 08:39:23 EST
On Thu, 2 Dec 2004 14:10:02 +0100
Ingo Molnar <mingo@xxxxxxx> wrote:
>
> * Florian Schmidt <mista.tapas@xxxxxxx> wrote:
>
> > Hmm, i wonder if there's a way to detect non RT behaviour in jackd
> > clients. I mean AFAIK the only thing allowed for the process callback
> > of on is the FIFO it waits on to be woken, right? Every other sleeping
> > is to be considered a bug.
>
> there's such a feature in -RT kernels. If a user process calls:
>
> gettimeofday(1,1);
>
> then the kernel turns 'atomic mode' on. To turn it off, call:
>
> gettimeofday(1,0);
>
> while in atomic-mode, any non-atomic activity (scheduling) will produce
> a kernel message and a SIGUSR2 sent to the offending process (once,
> atomic mode has to be re-enabled again for the next message). Preemption
> by a higher-prio task does not trigger a message/signal.
>
> If you run the client under gdb you should be able to catch the SIGUSR2
> signal and then you can see the offending code's backtrace via 'bt'.
Ok, so if i want to find out whether a client violates the RT
constraints for its process callback i would have to add a call to
gettimeofday(1,1) at the start of the process callback and
gettimeofday(1,0) at the end.
Everything which causes a reschedule inbetween will then cause SIGUSR2
to be sent to the client for which i could either add a signal handler
in the client or just use gdb to get notified of it.
Cool!
Flo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/