Hi ! This is my first a littl more clean attemt to "measure" the precision that rtl will reach on a system , the idea here is to get the system jitter not in absolute terms (measurement with an osziloscope on some pin) but as rtl sees it. it was basicaly done by having the folowing construct in a periodic thread. rt_task outline: ---------------- ---snip--- for(vec_size=1;vec_size<=5;vec_size++){ min_diff[vec_size] = 2000000000; max_diff[vec_size] = -2000000000; } for (i = 0; i < ntests; i++) { ++cnt; pthread_wait_np(); end[0] = clock_gethrtime(CLOCK_UST); end[1] = clock_gethrtime(CLOCK_UST); end[2] = clock_gethrtime(CLOCK_UST); end[3] = clock_gethrtime(CLOCK_UST); end[4] = clock_gethrtime(CLOCK_UST); end[5] = clock_gethrtime(CLOCK_UST); diff[1] = end[1]-begin; diff[2] = end[2]-end[1]; diff[3] = end[3]-end[2]; diff[4] = end[4]-end[3]; diff[5] = end[5]-end[4]; for(vec_size=1;vec_size<=5;vec_size++){ if (diff[vec_size] < min_diff[vec_size]) { min_diff[vec_size] = diff[vec_size]; } if (diff[vec_size] > max_diff[vec_size]) { max_diff[vec_size] = diff[vec_size]; } } } for(vec_size=1;vec_size<=5;vec_size++){ samp.run[vec_size] = min_diff[vec_size]; samp.jitt[vec_size] = (max_diff[vec_size]-min_diff[vec_size]); } write (fd_fifo, &samp, sizeof(samp)); ---snip--- this is simply the inner loop of rtlinux/examples/measurement/rt_process.c modified , the calls to clock_gethrtime(CLOCK_UST) are simply called consecutive , and basicaly nothing should realy interrupt them. the inner loop (ntest) was 500 long . measurements were done in two cases (more fine-grain and selective measurements will folow when I have time) , first a low-load measurement running 30 minutes which coresponds to 3470 samples of the above thread .The system was as unloaded as posible (see interrupts below) . The second measurement was done at a high load-average and with a maximum of interrupt events . The limiting factor for a longer run than 30 minutes was that I was not willing to klick/move the mouse and hammer the keyboard for more than 30 minutes :) low-load measurement: --------------------- loadaverage of the linux system was between 0.00 and 0.30 . runtime of the test 30min (approximatly) or 3470 samples (exactly). interrupts during this lowload measurement: ------------------------------------------- 0: 172903 RTLinux virtual irq timer 1: 0 RTLinux virtual irq keyboard 2: 0 RTLinux virtual irq cascade 5: 231 RTLinux virtual irq NE2000 12: 0 RTLinux virtual irq PS/2 Mouse 13: 0 RTLinux virtual irq fpu 14: 5182 RTLinux virtual irq ide0 221: 3440 RTLinux virtual irq fifo 222: 0 RTLinux virtual irq RTL-scheduler 223: 0 RTLinux virtual irq rtl_printf ERR: 0 I assume that the fifo interrupts where 3470 , because I had 3470 samples in my data-file , don't know why proc only saw 3440 , and probably the other numbers are to be seen as a good aproximation no more.... jitter between cals: -------------------- min in all exept 2 cases was 5028 (in two casse 2514) , jitter here is max-min. all loops where of equal length (500 calls) the maximum jitter value was obviously not dependant on when the call was issued , running five consecutive calls was done only to ensure that there is now load effect involved (contextswitch or so). call-number 5 4 3 2 1 jitter (ns) 17 1786 2419 912 2146 1677 6 118 88 203 122 2514 3066 1236 879 1774 959 2515 15 18 4 21 6 3352 357 307 64 549 208 3353 1 0 0 1 0 4190 1 1 1 4 2 4191 0 0 0 0 1 4192 1 0 0 0 0 5028 0 0 0 0 1 5029 0 0 2 1 3 15924 0 1 1 1 0 16762 0 1 3 0 2 16763 1 1 3 2 3 17601 0 0 0 0 1 17600 0 0 0 1 0 18438 3 0 0 2 0 18439 1 0 0 0 0 19276 0 0 1 0 0 19277 0 1 0 0 0 20114 1 0 0 0 0 20115 0 0 1 0 0 20953 0 0 0 1 0 21791 first conclusion , the maximum shown here is the smales jitter that a rtl-thread will show , I guess there is no way to get guarantied lower values on this hardware. high-load measurement: ---------------------- load on the linux system was between 6.XX and 9.XX , load was produced by multiple calls to "ls -lR /" , "ping -l 1000 broadcast-addr" and "cp -r localdir nfs-mounted-dir" . The CPU-usage was close to 100% during the entire test (checkt it with top -> nice 0.0% , idle 0.0%-2.0%) . interrupts during the highload measurement: ------------------------------------------- 0: 174003 RTLinux virtual irq timer 1: 21778 RTLinux virtual irq keyboard 2: 0 RTLinux virtual irq cascade 5: 40033 RTLinux virtual irq NE2000 12: 64659 RTLinux virtual irq PS/2 Mouse 13: 0 RTLinux virtual irq fpu 14: 84042 RTLinux virtual irq ide0 221: 3502 RTLinux virtual irq fifo 222: 0 RTLinux virtual irq RTL-scheduler 223: 0 RTLinux virtual irq rtl_printf ERR: 0 again the same holds true , the interrupt counts are not absolutly correct I guess, because the datafile was almost the same size (3484 samples...snipped of the 14 that where too many). jitter between cals: -------------------- min in most cases again was 5028 (in less than 1% min was 1677/2514/3352), jitter here is max-min. All loops where of equal length again (500 calls). call-number 5 4 3 2 1 jitter (ns) 16 6 10 12 11 1677 7 0 0 1 0 2514 674 13 44 4 8 2515 602 6 4 1 3 3352 1501 2831 2785 2807 2756 3353 0 1 0 3 1 4190 1 2 2 0 9 4191 0 0 0 0 2 4192 0 0 1 0 1 5028 3 3 2 0 0 5029 0 1 0 0 1 5030 0 0 1 0 0 5866 0 0 1 0 1 5867 1 0 0 0 0 12571 0 0 1 0 0 13410 1 0 0 0 0 14248 1 2 0 3 1 15086 0 1 2 1 0 15087 1 3 4 1 5 15924 0 2 4 0 3 15925 6 5 7 6 4 16762 6 8 6 5 8 16763 2 0 0 0 0 17599 13 5 11 9 9 17600 12 17 20 17 10 17601 2 0 0 0 0 18437 16 14 11 6 9 18438 28 27 31 25 25 18439 1 0 0 0 0 19275 15 10 9 13 15 19276 42 42 51 54 36 19277 1 0 0 0 0 20113 23 13 7 8 7 20114 51 69 66 72 83 20115 18 3 1 1 3 20952 72 75 89 79 79 20953 7 0 0 0 0 21790 53 64 60 55 79 21791 9 4 6 9 10 21792 11 0 0 0 0 22628 44 53 49 49 77 22629 13 11 11 21 11 22630 6 0 0 0 0 23466 50 36 36 39 69 23467 14 11 21 19 16 23468 4 0 0 0 0 24304 24 30 32 41 34 24305 19 9 23 23 20 24306 4 0 0 0 0 25142 43 22 19 24 24 25143 15 20 0 0 0 25144 3 0 0 0 0 25980 10 18 10 12 7 25981 14 19 11 10 5 25982 4 5 1 1 1 26819 5 8 1 7 0 26820 1 0 0 0 0 27657 1 1 0 3 1 27658 there is a hole between 3 and 15us which I have no explenation for , but maby I would have to take much longer samples to realy be able to say anything sensible about this. interpretation attemt: ---------------------- the jitter is "Modulo 838" wich is the 8254 timmers-tick length in ns. statistic correlation on the consecutive calls is good, event-corelation is low to non-existent . External load clearly has an influence comparing maxima , it shows that the interrupts or periferal computer-components probably are NOT the cause of this jitter. even with high load and high interrupt-rates on all connected devices + CPU the maximum jitter "only" was increased by 27%, although there is also a shift towards higher average values, wich is not of so great importance because the criteria here is WORST not AVERAGE case. one conclusion that I am uncirtain about but I will put it here for discusion is that since the low-load measurement shown a time of 5028ns for clock_gethrtime(CLOCK_UST) (with the noted two exeptions of 17350 samples) and the high-load measurement showd LOWER values in 40 cases , I assume that the time-precision of clock_gethrtime(CLOCK_UST) is limited to something like +/- 2*838ns (again 838 ns being a tick of the 8254). could someone comment on this assumtion ?? a further conclusion is that rtlinux obviously is quite stable concerning worst-case guarantee under high system/interrupt-load. hardware: --------- 486 75MHz (genuine intel) OS SuSE 6.2 Kernel 2.3.35 RTL V3.0.pre1 24MB-RAM IDE-HD (Segate 4.3MB) ISA/VESA BUS no PCI ! any suggestion on what I'm measuring here and how it could be inproved are very wellcomed. thx nmg *------------------------------------------------------------------------* *THERE {__} Universitaet Wien * *IS oo ) Inst. f. Materialphysik * *LIFE O_ `_-------. Mc Guire Nicholas * *IN (-. ,-\ * *THE || )---< ) [EMAIL PROTECTED] * *NET ! ||| | | privat: [EMAIL PROTECTED] * * [EMAIL PROTECTED] * *------------------------------------------------------------------------* *ASCII-COW (C) 1996-2001 [EMAIL PROTECTED] * *------------------------------------------------------------------------* --- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] ---- For more information on Real-Time Linux see: http://www.rtlinux.org/~rtlinux/