2.6.1 Scheduler Latency Measurements (Preemption diabled/enabled)

From: Christoph Stueckjuergen
Date: Tue Feb 03 2004 - 11:26:23 EST


Hi,

I performed a series of measurements comparing scheduler latency of a 2.6.1
kernel with preemption enabled and disabled on an AMD Elan (i486 compatible)
with 133 Mhz clock frequency.

The measurements were performed with a kernel module and a user mode process
that communicate via a character device interface. The user mode process uses
a blocking read() call to obtain data from the kernel. The kernel module
reads the system time every 10 ms by calling do_gettimeofday(), wakes up the
sleeping user mode process and passes the system time to it. After having
received the system time from the kernel, the user mode process reads the
system time by calling gettimeofday() and is thus able to determine the
scheduler latency by subtracting the two times. The user mode process is run
with the SCHED_FIFO scheduling policy.

Measurements were carried out on a âloadedâ and an âunloadedâ system. The
âloadâ was created by a process that continuously writes data to the serial
interface /dev/ttyS0.

The results are:
"loaded" system, 10.000 samples
average scheduler latency (preemption enabled / disabled): 170 us / 232 us
minimum scheduler latency (preemption enabled / disabled): 49 us / 43 us
maximum scheduler latency (preemption enabled / disabled): 840 us / 1063 us

"unloaded" system, 10.000 samples
average scheduler latency (preemption enabled / disabled): 50 us / 44 us
minimum scheduler latency (preemption enabled / disabled): 46 us / 41 us
maximum scheduler latency (preemption enabled / disabled): 233 us / 215 us

Any help in interpreting the data would be highly appreciated. Especially:
- Why does preemption lead to a higher minimum scheduler latency in the loaded
case?
- Why does preemption worsen scheduler latency on the unloaded system?

Best regards,
Christoph

PS: I am not subscribed, please CC me if you answer!
-
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/