Preemption Test

From RTwiki
(Difference between revisions)
Jump to: navigation, search
(Preemption-Test)
(Source Download)
 
(12 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This will test several attributes of the linux RT scheduler.  It checks to
+
=Concept=
 +
Preemption test will test several attributes of the linux RT scheduler.  It checks to
 
make sure that the scheduler allows higher priority tasks to preempt lower
 
make sure that the scheduler allows higher priority tasks to preempt lower
 
ones, and it measures the latency it takes to do so.
 
ones, and it measures the latency it takes to do so.
Line 13: Line 14:
 
The expected result is that we should see short wake-latencies across the
 
The expected result is that we should see short wake-latencies across the
 
board, and the higher priority threads should finish their work first.
 
board, and the higher priority threads should finish their work first.
 +
 +
=RPM Repository=
 +
You can find rpms for various platforms on the OpenSuse Build-Service:
 +
 +
[http://download.opensuse.org/repositories/home:/ghaskins http://download.opensuse.org/repositories/home:/ghaskins]
 +
 +
=Source Download=
 +
You can get code of preemption test from:
 +
 +
[ git://github.com/ghaskins/preempt-test.git ]
 +
 +
Note: You will need to have a development version of [http://boost.org boost] available to compile.
 +
 +
= Installation =
 +
Here, installation under a Debian-based Distro (Lenny) is described:
 +
 +
* Get the latest source
 +
#> git clone git://github.com/ghaskins/preempt-test.git
 +
 +
* Install required libs
 +
#> sudo apt-get install libboost-thread-dev libboost-program-options-dev
 +
 +
* Run '' make ''
 +
<pre>
 +
#> make
 +
g++ preempt-test.cc -g -lboost_thread-mt -lboost_program_options -o preempt-test
 +
/usr/bin/ld: cannot find -lboost_thread-mt
 +
collect2: ld returned 1 exit status
 +
make: *** [preempt-test] Error 1
 +
</pre>
 +
 +
* Fix missing link
 +
#> sudo ln -s /usr/lib/libboost_thread-gcc-mt-1_33_1.so /usr/lib/libboost_thread-mt.so
 +
 +
* Run '' make '' again
 +
 +
=Acknowledgements=
  
 
This test was inspired by Steven Rostedt's "rt-migration-test", so many
 
This test was inspired by Steven Rostedt's "rt-migration-test", so many
 
thanks to him for getting this effort off the ground.
 
thanks to him for getting this effort off the ground.
 +
* http://rostedt.homelinux.com/rt/rt-migrate-test.c
  
[ftp://ftp.novell.com/dev/ghaskins/preempt-test-latest.tar.bz2]
+
Note 1 : rt-migration-test is now part of the rt-tests suite which you can find here.
 +
[http://www.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git/ rt-tests git repo]
  
You will need to have a development version of boost available to compile ([http://boost.org])
+
Note 2 : Not aware if the "Preemption Test" is being actively maintained

Latest revision as of 21:24, 21 May 2012

Contents

[edit] Concept

Preemption test will test several attributes of the linux RT scheduler. It checks to make sure that the scheduler allows higher priority tasks to preempt lower ones, and it measures the latency it takes to do so.

The basic premise of this test is to synchronously launch a series of threads which have a monotonically increasing RT priority by a parent that is running at the highest priority. So for 5 threads, we have 5 worker threads at priorities 1-5, and a parent at 6. The sequence would basically go: 6-1-6-2-6-3-6-4-6-5. We calibrate a busy-loop so that each child gets (by default) 20ms worth of busy work to do. We then measure the latency to wake the child, wake the parent, and run the entire test.

The expected result is that we should see short wake-latencies across the board, and the higher priority threads should finish their work first.

[edit] RPM Repository

You can find rpms for various platforms on the OpenSuse Build-Service:

http://download.opensuse.org/repositories/home:/ghaskins

[edit] Source Download

You can get code of preemption test from:

[ git://github.com/ghaskins/preempt-test.git ]

Note: You will need to have a development version of boost available to compile.

[edit] Installation

Here, installation under a Debian-based Distro (Lenny) is described:

  • Get the latest source
#> git clone git://github.com/ghaskins/preempt-test.git
  • Install required libs
#> sudo apt-get install libboost-thread-dev libboost-program-options-dev
  • Run make
#> make
g++ preempt-test.cc -g -lboost_thread-mt -lboost_program_options -o preempt-test
/usr/bin/ld: cannot find -lboost_thread-mt
collect2: ld returned 1 exit status
make: *** [preempt-test] Error 1
  • Fix missing link
#> sudo ln -s /usr/lib/libboost_thread-gcc-mt-1_33_1.so /usr/lib/libboost_thread-mt.so
  • Run make again

[edit] Acknowledgements

This test was inspired by Steven Rostedt's "rt-migration-test", so many thanks to him for getting this effort off the ground.

* http://rostedt.homelinux.com/rt/rt-migrate-test.c

Note 1 : rt-migration-test is now part of the rt-tests suite which you can find here. rt-tests git repo

Note 2 : Not aware if the "Preemption Test" is being actively maintained

Personal tools