On Tue, 2004-07-27 at 12:12, Marc Kleine-Budde wrote: > # idle system > Demo thread now sampling at 1000 Hz ... > 5000 samples: > nanosleep jitter: min = 7928 ns, max = 19156 ns, avg = 19670174733 ns > sema4 handshake: min = 1749 ns, max = 6489 ns, avg = 1802 ns > simple kernel thread unloaded > > # while true; do echo `seq 1 46`; done > nanosleep jitter: min = 11326 ns, max = 49537 ns, avg = 19670193298 ns > sema4 handshake: min = 2538 ns, max = 22492 ns, avg = 8549 ns > > # while true; do echo `seq 1 46`; done > # ping -f > nanosleep jitter: min = 9078 ns, max = 63771 ns, avg = 19670193781 ns > sema4 handshake: min = 2141 ns, max = 35318 ns, avg = 8525 ns > > # while true; do echo `seq 1 46`; done > # ping -f > # dd if=/dev/zero of=/tmp/test > nanosleep jitter: min = 10028 ns, max = 113471 ns, avg = 19670201296 ns > sema4 handshake: min = 2080 ns, max = 57584 ns, avg = 11123 ns > > Philippe, have you an explanation for that still high jitter? >
Likely because you are not measuring the same thing as LXRT/latency does. The current POSIX skin nanosleep() implementation is bound to a _periodic_ nucleus watchdog that expresses time in ticks (this happens even if the nucleus is asked to use the timer hardware in one-shot mode; this is not related here), so your delay is always rounded to the next tick. What you see is not a jitter, but a loss of timing accuracy caused by the way the skin waits for the next wakeup time. If you want to compare fusion with LXRT, use the testsuite/latency test, it has been crafted exactely for that. On my 1Ghz laptop, your "dd" test gives the following, which is rather correct: min = 4130 ns, max = 46003 ns, avg = 4908 ns, overrun = 0 min = 4130 ns, max = 46003 ns, avg = 4900 ns, overrun = 0 min = 4130 ns, max = 46003 ns, avg = 4909 ns, overrun = 0 min = 4130 ns, max = 46003 ns, avg = 4904 ns, overrun = 0 min = 4130 ns, max = 46003 ns, avg = 4910 ns, overrun = 0 min = 4130 ns, max = 46003 ns, avg = 4905 ns, overrun = 0 min = 4130 ns, max = 46003 ns, avg = 4912 ns, overrun = 0 min = 4130 ns, max = 46003 ns, avg = 4910 ns, overrun = 0 > regard - Marc > > > P.S.: ported fusion demo example attached... -- Philippe.
