[patch] Real-Time Preemption, -RT-2.6.10-rc2-mm2-V0.7.30-9

From: Ingo Molnar
Date: Tue Nov 23 2004 - 18:02:16 EST



i have released the -V0.7.30-9 Real-Time Preemption patch, which can be
downloaded from the usual place:

http://redhat.com/~mingo/realtime-preempt/

this is a fixes-only release.

most importantly it includes a JACK related latency fix. With Florian
Schmidt's great detective work we honed in on a big latency source
within JACK: the use of named pipes (fifos) on journalled filesystems.

This issue has been empirically identified before (and is mentioned in
the JACK howto) but has never been given high enough prominence. It
turns out that the atime updates done while read()ing or write()ing
named pipes causes the delays - it may under certain circumstances call
out into the journalling code. It may block even on non-journalled
filesystems.

To work this issue around, when PREEMPT_RT is enabled the -30-9 kernel
skips atime updates on named-fifos. (it's pretty pointless anyway.)
Alternative userspace workarounds are to put the fifos on tmpfs/ramfs,
or to mark the filesystem noatime,nodiratime.

those experiencing xruns under JACK should definitely try the -30-9
kernel.

Changes since -V0.7.30-2:

- named fifo reads/writes are now atomic, whenever possible

- fixed pi_lock related SMP & CRITICAL_IRQSOFF_TIMING lockups, this
could resolve the lockups reported by Mark H. Johnson.

- fixed one more PI buglet: wake up the new owner _after_ restoring
the priority of the old owner.

- made the NMI oopser more robust - it should print out some message
in pretty much any locking scenario.

- added the blocker device used by Esben Nielsen's pi_test suite.

- added user-triggerable ALSA xrun tracing to the patch: if a
sound IO channel has xrun_debug enabled in /proc then
user_trace_stop() will be called before printing the xrun message,
and the current trace will be saved to /proc/latency_trace. This is a
'one-shot' tracing method for now. I can be activated via:

echo 1 > /proc/asound/card0/pcm0p/xrun_debug

echo 1 > /proc/sys/kernel/trace_user_triggered
echo 1 > /proc/sys/kernel/trace_freerunning
echo 0 > /proc/sys/kernel/preempt_max_latency
echo 0 > /proc/sys/kernel/preempt_thresh
echo 0 > /proc/sys/kernel/preempt_wakeup_timing

./gettimeofday 0 1

gettimeofday.c is attached below. The JACK fifo xrun source was found
via this tracing facility.

to create a -V0.7.30-9 tree from scratch, the patching order is:

http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.9.tar.bz2
http://kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.10-rc2.bz2
http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.10-rc2/2.6.10-rc2-mm2/2.6.10-rc2-mm2.bz2
http://redhat.com/~mingo/realtime-preempt/realtime-preempt-2.6.10-rc2-mm2-V0.7.30-9

Ingo


-- gettimeofday.c:

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
#include <linux/unistd.h>

int main (int argc, char **argv)
{
if (argc != 3) {
printf("usage: gettimeofday <val1> <val2>\n");
exit(0);
}
gettimeofday(atol(argv[1]), atol(argv[2]));

return 0;
}

-
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/