Order One Study

From eLinux.org
Revision as of 07:27, 8 March 2007 by RBot (talk | contribs)
Jump to: navigation, search

Table Of Contents:

/ Abstract

  • Linux 2.6O(1)2.6NPTL(Native POSIX Thread Library)
  • For the purpose of examining the behavior of the O(1) scheduler which was migrated from the Kernel 2.6, we have tested the real-time thread response time experiment. We have used the NPTL (Native POSIX Thread Library) which also was migrated from the Kernel 2.6.
  • English translation is not completed yet. Please refer to THIS material for your reference.
  • We are looking for your comments or suggestions. To "celinux-dev@tree.celinuxforum.org" please. / celinux-dev@tree.celinuxforum.org
    • Comment about Order One Study (in Japanese)

Test Environment

Used Platform

  • Target platform
Renesas RTS7751R2D (big-endian) SH4(SH7751) 240MHz
64MB SDRAM
10Base-T Ethernet
Linux 2.6.8.1 (glibc 2.3.4)
  • NFS server siderootfs for R2D)
Intel Celeron 2GHz
512MB RAM
2GB ATA DISK
Linux 2.6.9
10Base-T Ethernet

Fig4small.jpg

/ Program for the Experiment

/ Virtual Device Driver

  • procprocread
  • create new virtual device entry in /proc file.
  • When "write to /proc" event occurs, create a new thread that blocks the same device file using "read"

WRITE / Write Task

  • writeREAD
  • Do "write" to virtual device file create a trigger for "read" task wakeup.

READ / Read Task

  • read
  • Do "read" to virtual device file to block.

/ Load Tasks

  • Rival tasks those have same scheduling priority.

Fig1.jpg

/ Measurement

  • READWRITEread(), write()1
  • WRITE16mswrite()
  • READread()read()
  • WRITE()write()READread()
  • write()READ
  • 1usnanosleep()012481632
  • READWRITE(non-RTRT(1SCHED_RR2
  • Non-RT

  • Each "read" and "write" task execute read() or write() 10,000 times to the virtual device file.
  • "write" task execute write() in every 16msec.
  • "Read" task issues next read() right after returns from read() execution.
  • Measure the elapsed time between write() issues in "write" task and return of read() execution issued in "read" task.
  • And also measure the elapsed time between the timing of write() command accepted in virtual device file and the timing of "read" task start.
  • While measurement, execute some load tasks collaterally that execute 1us nanosleep repeatedly. Numbers of load tasks varies as 0, 1, 2, 4, 8, 16, 32.
  • In this test execute "read" and "write" task as normal thread (non-Realtime) thread and RT-thread (priority=1, round-robin mode = SCHED_RR)
  • Load tasks were always execute as a non-realtime task.

/ Result

/ Thread switch time

  • WRITEwrite() READread()
  • The elapsed time between write() issues in "write" task and return of read() execution issued in "read" task.

Fig2a.jpg

/ Thread wakeup time

  • write()READread()
  • The elapsed time between the timing of write() command accepted in virtual device file and the timing of "read" task start.

Fig3a.jpg

  • RTNon-RT
  • Non-RT
  • Non-RTRT

  • Both thread takes longer time in 1st execution, than 2nd time or later.
  • RT thread can achieve almost constant response time regardless of numbers of load tasks.
  • Non-RT task's response time increase relative to load task number.
  • Initial several response time of Non-RT task almost same as RT task, but after once it takes some long period, long period and short period repeated in every two times.

/ consideration (more like guess)

  • Non-RTRT
    • read()READread()READ
  • Non-RT
    • read()READ

  • 1st execution takes longer response time.
    • Paging access to non-referenced space like library code (that is interrupt disabled period) blocks scheduler execution.
  • Non-RT task response time is similar to that of RT task.
    • "Read" task blocked by read() gains higher priority than other load task(s). Then "read" task returns from read() assigned into higher priority queue and dispatched immediately rather than other load task(s) that has less seeped time.
  • Non-RT task's response time increase relative to load task number.
    • "Read" task returned from read() enter into the tail of queue list of other load task(s). So "read" task will dispatch after all other load task execution was done.

TODO

  • Non-RT
  • RT
  • 2.4, 2.6.X

  • Trace the dynamic priority transition of non-RT task.
  • Measure the effect of kernel pre-emption period when using RT task.
  • Adopt high-resolution timer count for measuring response time.
  • Compare the test result of other architecture.
  • Adopt realistic load task model.
  • compare the test result of 2.4 and 2.6 kernel
  • Measure thread wake up time from hardware interrupt event.

/ Resources

/ Test Program Source Code

/ Result of the Experiment

  • CVS
  • CSV File Columns : (Column1: Frequency) (Column2: Thread Switching Time) (Column3: Thread Wakeup Time)
Non-RT(Non-RT Thread) (case: No Load Task) Media:nonrt-ham00.csv
Non-RT(Non-RT Thread) x 1(case: Load Task x1) Media:nonrt-ham01.csv
Non-RT(Non-RT Thread) x 2(case: Load Task x2) Media:nonrt-ham02.csv
Non-RT(Non-RT Thread) x 4(case: Load Task x4) Media:nonrt-ham04.csv
Non-RT(Non-RT Thread) x 8(case: Load Task x8) Media:nonrt-ham08.csv
Non-RT(Non-RT Thread) x 16(case: Load Task x16) Media:nonrt-ham16.csv
Non-RT(Non-RT Thread) x 32(case: Load Task x32) Media:nonrt-ham32.csv
RT(RT Thread) (case: No Load Task) Media:rt-ham00.csv
RT(RT Thread) x 1(case: Load Task x1) Media:rt-ham01.csv
RT(RT Thread) x 2(case: Load Task x2) Media:rt-ham02.csv
RT(RT Thread) x 4(case: Load Task x4) Media:rt-ham04.csv
RT(RT Thread) x 8(case: Load Task x8) Media:rt-ham08.csv
RT(RT Thread) x 16(case: Load Task x16) Media:rt-ham16.csv
RT(RT Thread) x 32(case: Load Task x32) Media:rt-ham32.csv