Difference between revisions of "Order One Study"

From eLinux.org
Jump to: navigation, search
(add prefix explaning content)
(/ Thread wakeup time: fix typo)
Line 82: Line 82:
 
* The elapsed time between write() issues in "write" task and return of read() execution issued in "read" task.
 
* The elapsed time between write() issues in "write" task and return of read() execution issued in "read" task.
 
[[Image:fig2a.jpg]]
 
[[Image:fig2a.jpg]]
===  / Thread wakeup time ===
+
===  Thread wakeup time ===
 
* write() read()
 
* write() read()
 
* The elapsed time between the timing of write() command accepted in virtual device file and the timing of "read" task start.
 
* The elapsed time between the timing of write() command accepted in virtual device file and the timing of "read" task start.

Revision as of 16:08, 12 May 2009

This page describes a presentation that was given at the CELF Technical Jamboree #4, on September 30, 2005.

Please see here for details. The original material was in Japanese, and has been translated.

Abstract

  • Linux 2.6 O(1) test of 2.6 NPTL(Native POSIX Thread Library)
  • The presentation gives the results of testing the behavior of the O(1) scheduler. The tests consists of measuring the real-time thread response time. The thread library used was NPTL (Native POSIX Thread Library).
  • 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 Task

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

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() read()
  • 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

Experiment Results

  • 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