inferring scheduling behavior with hourglass
DESCRIPTION
Inferring Scheduling Behavior with Hourglass. John Regehr School of Computing, University of Utah http://www.cs.utah.edu/~regehr 6/14/2002. What is Hourglass?. Synthetic real-time application Only purpose is to take measurements Timing constraints No kernel modules or patches. Goal. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/1.jpg)
1
Inferring Scheduling Behavior with
HourglassJohn Regehr
School of Computing, University of Utahhttp://www.cs.utah.edu/~regehr
6/14/2002
![Page 2: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/2.jpg)
2
What is Hourglass? Synthetic real-time
application Only purpose is to take
measurements Timing constraints No kernel modules or patches
![Page 3: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/3.jpg)
3
Goal Provide fast, accurate
answers to CPU scheduling questions Microbenchmarks: Dispatch
latency? Timer accuracy? Context switch time?
Single-application: Would it help to use a different timer? To reduce compute time by 15%?
Multi-application: Will X, Y, and Z work together?
![Page 4: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/4.jpg)
4
Why Answer Scheduling Questions? Identify / solve application
timing problems Make predictions about
application performance Compare OSs e.g.
Linux 2.2 vs. 2.4 Preemptible vs. low latency Linux Linux vs. Windows XP vs. FreeBSD
Debug schedulers
![Page 5: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/5.jpg)
5
Other Ways to Answer Scheduling Questions
Add instrumentation to a non-synthetic real-time application E.g. Game, DVD player, mp3
player, software modem, … Use an instrumented kernel
E.g. Linux Trace Toolkit More detail in paper…
![Page 6: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/6.jpg)
6
Key Capabilities Create accurate execution
trace Support multiple thread
models Provide portable access to
scheduling functionality
![Page 7: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/7.jpg)
7
Execution Trace Precise map of when each
Hourglass thread runs Threads poll timestamp
counter Log “gaps” to memory buffer
Important details: need to Know CPU speed Select minimum gap size
appropriately Avoid spurious page faults
![Page 8: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/8.jpg)
8
Raw Execution Trace
2 9.976 0.0062 9.976 0.0050 9.972 0.0090 9.976 0.0051 7.574 0.0061 1.242 0.0091 1.139 0.0091 0.122 0.005
Duration GapThread
![Page 9: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/9.jpg)
9
Graphical Execution Trace
Postprocess with Perl, jgraph, etc. to get:
![Page 10: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/10.jpg)
10
Supported Thread Models
Periodic with blocking Most non-game real-time
apps Periodic non-blocking
Most games and other rendering loops
Also: CPU-bound, latency test, scanning
Easy to extend…
![Page 11: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/11.jpg)
11
Portability Uniform command-line
access to Thread models Timers Priorities CPU reservations
![Page 12: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/12.jpg)
12
How It Works main()
Spawns worker threads Sleeps Prints results
Worker threads Run gap-detection loop At appropriate times:
Schedule wakeup and go to sleep
Register deadline hit / miss Touch memory
![Page 13: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/13.jpg)
13
Using Hourglass First: Map the scheduling
question onto a concrete scenario
Second: Create an Hourglass command line that implements the scenario Use other apps to supply
contention Third: Run Hourglass,
interpret the results
![Page 14: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/14.jpg)
14
Example Question 1: Can a demanding
digital audio app reliably meet its deadlines on Linux? App requires 4ms CPU during
every 5ms period Command line:
hourglass -d 20s -n 1 -t 0 \ -p RTHIGH \ -w PERIODIC 4ms 5ms \ -i RTC
![Page 15: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/15.jpg)
15
Example Cont’d Answer: YES
No deadlines missed on a variety of Linux kernels
(On an otherwise quiet machine)
![Page 16: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/16.jpg)
16
Example Cont’d Question 2: How about
during network receive processing? Same Hourglass command
line Use Netperf to receive full-
bandwidth data over 100Mbps Ethernet
Answer: Sometimes…
![Page 17: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/17.jpg)
17
Example Cont’d Numerical answer:
RML == preemptible kernel + lock breaking patches
Netperf baseline: 94 Mbps
Experiment Missed deadlines
Throughput
2.4.17 plain 33.0% 68 Mbps2.4.17 RML 0.4% 66 Mbps2.4.7 TimeSys
0.0% 59 Mbps
![Page 18: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/18.jpg)
18
Example Cont’d Visual answer:
![Page 19: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/19.jpg)
19
Related Work LMBench, HBench,
Latencytest Linux Trace Toolkit Gscope txofy, mptxofy
![Page 20: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/20.jpg)
20
Availability Runs on
Pentium-class x86 Linux, FreeBSD, Win32
BSD style license Home page
www.cs.utah.edu/~regehr/hourglass
Or Google for “regehr hourglass”
![Page 21: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/21.jpg)
21
Conclusion Can learn a lot using a
synthetic real-time application: Execution trace is surprisingly
useful for making inferences about scheduling behavior
A few thread models cover most interesting applications
![Page 22: Inferring Scheduling Behavior with Hourglass](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815b82550346895dc9834b/html5/thumbnails/22.jpg)
22
The End More info atwww.cs.utah.edu/~regehr/
hourglass
Let’s talk…