SlideShare a Scribd company logo
Plan for Today
• Scheduling Intro
• Kernel Timer Winner!
• Scheduling
• Results of Performance Test
1 October 2013 University of Virginia cs4414 1
Shell Demos! (Stride Scheduled)
Evan Teague, Josh Lisko
Chris McFarland, Clarisse Abalos
Nishant Shukla, Jasdev Singh
Daniel Nizri, Alex Fabian
If you requested a demo, but
weren’t selected the
(undocumented) secondary tie-
breaker was submission time
(earlier is better) when multiple
teams had similar extra features.
1 October 2013 University of Virginia cs4414 2
RememberfromClass4:
1. How should the supervisor decide which program to run?
2. How long should the alarm clock be set for?
Scheduler Desiderata
1 October 2013 University of Virginia cs4414 3
Go placidly amid the noise and haste, and
remember what peace there may be in silence.
As far as possible without surrender be on good
terms with all persons. Speak your truth quietly
and clearly; and listen to others, even the dull
and the ignorant; they too have their story.
Avoid loud and aggressive persons, they are
vexations to the spirit. … Exercise caution in
your business affairs; for the world is full of
trickery. …And whether or not it is clear to you,
no doubt the universe is unfolding as it
should…whatever your labors and aspirations,
in the noisy confusion of life keep peace with
your soul. With all its sham, drudgery, and
broken dreams, it is still a beautiful world. Be
cheerful. Strive to be happy.
Max Ehrmann, “Desiderata” (1927)
1 October 2013 University of Virginia cs4414 4
How well do traffic lights do?
1 October 2013 University of Virginia cs4414 5
How well do traffic lights do?
Kernel Timer: Wil Thomason
1 October 2013 University of Virginia cs4414 6
1 October 2013 University of Virginia cs4414 7
Midterm
Exemption
vs.
“Dare and Do”
“To Dare is To Do” (Tottenham Hotspur FC)
About the Midterm
• It is not meant to be painful or tedious!
• A web form you will do outside of class
(posted Thursday Oct 10, due Monday Oct 14)
• Open resources except other humans
• You should not be surprised if questions from
the notes appear on the midterm
– It is fine (and encouraged!) to discuss those
questions in the course forum before the midterm
is posted
1 October 2013 University of Virginia cs4414 8
Scheduling Strategies
1 October 2013 University of Virginia cs4414 9
First Come, First Served (FIFO)
P1 P2 P3
(effectively: non-preemptive multi-processing)
Scheduling Strategies
1 October 2013 University of Virginia cs4414 10
First Come, First Served (FIFO)
P1 P2 P3
(effectively: non-preemptive multi-processing)
Round-Robin
P1 P1 P1P1P2 P2P3 P3P3P3
Time Slice Blocked
Each process gets to run for a set time slice, or until it finished or gets blocked.
Comparison
First Come, First Served Round Robin
1 October 2013 University of Virginia cs4414 11
Which one is my laptop using?
1 October 2013 University of Virginia cs4414 12
Priorities
• More important processes: “higher priority”
(except Linux inverts priority values!)
– Highest priority = 0 (gets most preferential
treatment)
– Lowest priority = 99 (highest number varies by
Linux flavor)
1 October 2013 University of Virginia cs4414 13
1 October 2013 University of Virginia cs4414 14
$ ps -e -o uid,pid,pri,command | sort -n --key=3 (with some manual editing)
UID PID PRI COMMAND
222 48 4 /usr/sbin/netbiosd
501 1536 4
/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.fr
amework/Versions/A/Support/mdworker -s 
mdworker -c MDSImporterWorker -m com.apple.mdworker.shared
501 38470 4 /Applications/Preview.app/Contents/MacOS/Preview -
psn_0_4777102
501 38921 4
/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.fr
amework/Versions/A/Support/mdworker -s 
mdworker-lsb -c MDSImporterWorker -m com.apple.mdworker.lsb
-2 36 23 /usr/libexec/warmd
0 1 31 /sbin/launchd
0 37965 31 /Library/DropboxHelperTools/Dropbox_u501/dbfseventsd
0 37966 31 /Library/DropboxHelperTools/Dropbox_u501/dbfseventsd
0 38871 31 /usr/sbin/ocspd
0 38923 31 ps -e -o uid,pid,pri,command
-2 1099 31 /sbin/launchd
… many others at PRI=31 elided
501 38913 31 /bin/bash --noediting -i
501 38914 31 rust run listspawn.rs
501 38920 31 ./listspawn08~
501 38924 31 sort -n --key=3
0 11 33 /usr/libexec/UserEventAgent (System)
Should I be happy?
Shell Demos!
1 October 2013 University of Virginia cs4414 15
Evan Teague and Josh Lisko
Chris McFarland and Clarisse Abalos
1 October 2013 University of Virginia cs4414 16
$ ps -e -o uid,pid,pri,command | sort -n --key=3 (with some manual editing)
UID PID PRI COMMAND
222 48 4 /usr/sbin/netbiosd
501 1536 4
/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.fr
amework/Versions/A/Support/mdworker -s 
mdworker -c MDSImporterWorker -m com.apple.mdworker.shared
501 38470 4 /Applications/Preview.app/Contents/MacOS/Preview -
psn_0_4777102
501 38921 4
/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.fr
amework/Versions/A/Support/mdworker -s 
mdworker-lsb -c MDSImporterWorker -m com.apple.mdworker.lsb
-2 36 23 /usr/libexec/warmd
0 1 31 /sbin/launchd
0 37965 31 /Library/DropboxHelperTools/Dropbox_u501/dbfseventsd
0 37966 31 /Library/DropboxHelperTools/Dropbox_u501/dbfseventsd
0 38871 31 /usr/sbin/ocspd
0 38923 31 ps -e -o uid,pid,pri,command
-2 1099 31 /sbin/launchd
… many others at PRI=31 elided
501 38913 31 /bin/bash --noediting -i
501 38914 31 rust run listspawn.rs
501 38920 31 ./listspawn08~
501 38924 31 sort -n --key=3
0 11 33 /usr/libexec/UserEventAgent (System)
Should I be happy?
1 October 2013 University of Virginia cs4414 17
1 October 2013 University of Virginia cs4414 18
“mdworker is short for ‘metadata server
worker’ and if you’re still confused don’t feel
bad. mdworker is basically the core technology
behind Mac OS X’s awesome search engine
Spotlight, it spiders meta data from your Mac
and its files and creates a readable index so
that you can find things practically
instantaneously via Spotlight (command-
spacebar).”
Pre-emptive Priority Scheduling
• Always run the highest priority process that is
ready to run
• Round-robin schedule among equally high,
ready to run, highest-priority processes
1 October 2013 University of Virginia cs4414 19
Scheduler Queue
1 October 2013 University of Virginia cs4414 20
Shell Demos!
1 October 2013 University of Virginia cs4414 21
Nishant Shukla and Jasdev Singh
Daniel Nizri and Alex Fabian
1 October 2013 University of Virginia cs4414 22
2013 MacBook Pro
Intel i7-3740QM
2.7 GHz, 4 cores (8 threads)
6MB shared L3 cache
2011 MacBook Air
Intel i5-2557M
1.7 GHz, 2 cores (4 threads)
3 MB shared L3 cache
both support “hyperthreading” (two threads per core)
60 seconds
(normalized time,
running on 16-
element list)
?
From Class 9: How much faster will my Rust
mapping program be on my new machine?
1 October 2013 University of Virginia cs4414 23
impl Map for List {
fn mapr(&self, f: extern fn(int) -> int) -> List {
match(*self) {
None => None,
Some(ref node) => {
let (port, chan) : (Port<int>, Chan<int>) = stream();
let val = node.head;
do spawn {
chan.send(f(val));
}
let newtail = node.tail.mapr(f);
Some(~Node{ head: port.recv(), tail: newtail })
}
}
}
}
1 October 2013 University of Virginia cs4414 24
fn collatz_steps(n: int) -> int {
if n == 1 { 0 } else { 1 + collatz_steps(if n % 2 == 0 { n / 2 } else { 3*n + 1 }) }
}
fn find_collatz(k: int) -> int { // Minimum value, n, with Collatz stopping time >= k.
let mut n = 1;
while collatz_steps(n) < k { n += 1; }
n
}
fn test_list(n: int, x: int) -> List {
if n == 0 { None } else { Some(~Node{head: x, tail: test_list(n - 1, x + 1)}) }
}
fn main() {
let lst0 = test_list(16, 565);
println(lst0.to_str());
let lst1 = lst0.mapr(find_collatz);
println(lst1.to_str());
}
Formatted to fit on slide. Your code should
have many more newlines than this!
1 October 2013 University of Virginia cs4414 25
x 105
Stopping Time distribution for 1-100 Million
http://en.wikipedia.org/wiki/File:CollatzStatistic100million.png
Results
Old MacBook Air
$ rustc listspawn.rs
$ time ./listspawn
[565, 566, 567, 568, 569, 570, 571, 572,
573, 574, 575, 576, 577, 578, 579, 580]
[3542887, 3542887, 3542887, 3542887,
3542887, 3542887, 3542887, 3542887,
3542887, 3542887, 3542887, 3542887,
3542887, 3542887, 3542887, 3542887]
real 0m58.843s
user 3m39.459s
sys 0m0.266s
New MacBook Pro
$ time ./listspawn
[565, 566, 567, 568, 569, 570, 571, 572,
573, 574, 575, 576, 577, 578, 579, 580]
[3542887, 3542887, 3542887, 3542887,
3542887, 3542887, 3542887, 3542887,
3542887, 3542887, 3542887, 3542887,
3542887, 3542887, 3542887, 3542887]
real 0m18.593s
user 2m17.990s
sys 0m0.120s
1 October 2013 University of Virginia cs4414 26
Checking Results
Old MacBook Air
$ time ./listspawn
real 0m58.843s
user 3m39.459s
sys 0m0.266s
$ !!
real 1m0.931s
user 3m47.609s
sys 0m0.291s
$ !!
real 0m57.967s
user 3m36.343s
sys 0m0.266s
New MacBook Pro
$ time ./listspawn
real 0m18.593s
user 2m17.990s
sys 0m0.120s
$ !!
real 0m18.757s
user 2m20.419s
sys 0m0.116s
$ !!
real 0m18.505s
user 2m18.653s
sys 0m0.130s
1 October 2013 University of Virginia cs4414 27
Median over three trials:
real = 58.8s (user 219.5s)
Median over three trials:
real = 18.6s (user 138.0s)
1 October 2013 University of Virginia cs4414 28
Median over three trials:
real = 18.6s (user 138.0s)
Does this make sense?
Old MacBook Air
1.7 GHz Processor
2 cores (4 hyperthreads)
New MacBook Pro
2.7 GHz Processor
4 cores (8 hyperthreads)
1 October 2013 University of Virginia cs4414 29
Median over three trials:
real = 58.8s (user 219.5s)
Median over three trials:
real = 18.6s (user 138.0s)
Cycle speed increase:
(2.7/1.7) = 1.59
Thread increase: 2
>>> 219.5 / 138.0
1.5905797101449275
>>> 58.8 / 18.6
3.1612903225806446
>>> (2.7 / 1.7) * 2
3.1764705882352944
What sh-Ould I have done
to make it faster?
1 October 2013 University of Virginia cs4414 30
-O >> $$Old MacBook Air
$ rustc -O listspawn.rs
$ time ./listspawn
real 0m10.573s
user 0m36.498s
sys 0m0.127s
bash-3.2$ time ./listspawn
real 0m10.299s
user 0m36.545s
sys 0m0.119s
bash-3.2$ time ./listspawn
real 0m10.330s
user 0m36.555s
sys 0m0.112s
New MacBook Pro
$ time ./listspawn
real 0m2.975s
user 0m22.913s
sys 0m0.022s
$ time ./listspawn
real 0m2.922s
user 0m22.950s
sys 0m0.016s
$ time ./listspawn
real 0m2.982s
user 0m22.875s
sys 0m0.019s
1 October 2013 University of Virginia cs4414 31
Median over three trials:
-- real = 58.8s (user 219.5s)
-O real = 10.3s (user 36.5s)
Median over three trials:
-- real = 18.6s (user 138.0s)
-O real = 2.97s (user 22.91s)
predicted (2.7/1.7 * 2): 3.18 times faster
without: 3.16 times faster
with -O: 3.47 times faster
Open Midterm
Exemption/HopperPatch
Opportunities
• Complete implementation of map_reduce
function from Class 9 (must use all cores
effectively and be able to do examples from
MapReduce paper)
• “Good Auld Shell” at UVa Football Game
• [New!] Write a program that runs at least 20x
faster on my new Mac than it does on my old
Mac
1 October 2013 University of Virginia cs4414 32
What algorithm did you use to
schedule your PS2 demos?
1 October 2013 University of Virginia cs4414 33

More Related Content

What's hot

Synchronization
SynchronizationSynchronization
Synchronization
David Evans
 
Scheduling in Linux and Web Servers
Scheduling in Linux and Web ServersScheduling in Linux and Web Servers
Scheduling in Linux and Web Servers
David Evans
 
The Internet
The InternetThe Internet
The Internet
David Evans
 
Making a Process (Virtualizing Memory)
Making a Process (Virtualizing Memory)Making a Process (Virtualizing Memory)
Making a Process (Virtualizing Memory)
David Evans
 
SSL Failing, Sharing, and Scheduling
SSL Failing, Sharing, and SchedulingSSL Failing, Sharing, and Scheduling
SSL Failing, Sharing, and Scheduling
David Evans
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uring
Anne Nicolas
 
Once Upon a Process
Once Upon a ProcessOnce Upon a Process
Once Upon a Process
David Evans
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
Brendan Gregg
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
Andrea Righi
 
Linux Performance Tools
Linux Performance ToolsLinux Performance Tools
Linux Performance Tools
Brendan Gregg
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profit
Andrea Righi
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
Brendan Gregg
 
Profiling your Applications using the Linux Perf Tools
Profiling your Applications using the Linux Perf ToolsProfiling your Applications using the Linux Perf Tools
Profiling your Applications using the Linux Perf Tools
emBO_Conference
 
A Brief History of System Calls
A Brief History of System CallsA Brief History of System Calls
A Brief History of System Calls
ahl0003
 
Linux Performance Tools 2014
Linux Performance Tools 2014Linux Performance Tools 2014
Linux Performance Tools 2014
Brendan Gregg
 
Lec05 buffers basic_examples
Lec05 buffers basic_examplesLec05 buffers basic_examples
Lec05 buffers basic_examples
Taras Zakharchenko
 
Patching: answers to questions you probably were afraid to ask about oracle s...
Patching: answers to questions you probably were afraid to ask about oracle s...Patching: answers to questions you probably were afraid to ask about oracle s...
Patching: answers to questions you probably were afraid to ask about oracle s...
DATA SECURITY SOLUTIONS
 
Lec09 nbody-optimization
Lec09 nbody-optimizationLec09 nbody-optimization
Lec09 nbody-optimization
Taras Zakharchenko
 
Bpf performance tools chapter 4 bcc
Bpf performance tools chapter 4   bccBpf performance tools chapter 4   bcc
Bpf performance tools chapter 4 bcc
Viller Hsiao
 

What's hot (20)

Synchronization
SynchronizationSynchronization
Synchronization
 
Scheduling in Linux and Web Servers
Scheduling in Linux and Web ServersScheduling in Linux and Web Servers
Scheduling in Linux and Web Servers
 
The Internet
The InternetThe Internet
The Internet
 
Making a Process (Virtualizing Memory)
Making a Process (Virtualizing Memory)Making a Process (Virtualizing Memory)
Making a Process (Virtualizing Memory)
 
SSL Failing, Sharing, and Scheduling
SSL Failing, Sharing, and SchedulingSSL Failing, Sharing, and Scheduling
SSL Failing, Sharing, and Scheduling
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uring
 
Once Upon a Process
Once Upon a ProcessOnce Upon a Process
Once Upon a Process
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
 
Linux Performance Tools
Linux Performance ToolsLinux Performance Tools
Linux Performance Tools
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profit
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
Profiling your Applications using the Linux Perf Tools
Profiling your Applications using the Linux Perf ToolsProfiling your Applications using the Linux Perf Tools
Profiling your Applications using the Linux Perf Tools
 
A Brief History of System Calls
A Brief History of System CallsA Brief History of System Calls
A Brief History of System Calls
 
Linux Performance Tools 2014
Linux Performance Tools 2014Linux Performance Tools 2014
Linux Performance Tools 2014
 
Lec05 buffers basic_examples
Lec05 buffers basic_examplesLec05 buffers basic_examples
Lec05 buffers basic_examples
 
Patching: answers to questions you probably were afraid to ask about oracle s...
Patching: answers to questions you probably were afraid to ask about oracle s...Patching: answers to questions you probably were afraid to ask about oracle s...
Patching: answers to questions you probably were afraid to ask about oracle s...
 
Lec09 nbody-optimization
Lec09 nbody-optimizationLec09 nbody-optimization
Lec09 nbody-optimization
 
Bpf performance tools chapter 4 bcc
Bpf performance tools chapter 4   bccBpf performance tools chapter 4   bcc
Bpf performance tools chapter 4 bcc
 

Viewers also liked

Inventing the Future
Inventing the FutureInventing the Future
Inventing the Future
David Evans
 
Operating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - ThreadsOperating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - Threads
Peter Tröger
 
Invent the Future (Operating Systems in 2029)
Invent the Future (Operating Systems in 2029)Invent the Future (Operating Systems in 2029)
Invent the Future (Operating Systems in 2029)
David Evans
 
Using Git, Pointers in Rust
Using Git, Pointers in RustUsing Git, Pointers in Rust
Using Git, Pointers in Rust
David Evans
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
David Evans
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
Sonali Chauhan
 

Viewers also liked (6)

Inventing the Future
Inventing the FutureInventing the Future
Inventing the Future
 
Operating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - ThreadsOperating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - Threads
 
Invent the Future (Operating Systems in 2029)
Invent the Future (Operating Systems in 2029)Invent the Future (Operating Systems in 2029)
Invent the Future (Operating Systems in 2029)
 
Using Git, Pointers in Rust
Using Git, Pointers in RustUsing Git, Pointers in Rust
Using Git, Pointers in Rust
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 

Similar to Scheduling

Access Control
Access ControlAccess Control
Access Control
David Evans
 
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Anne Nicolas
 
Reflections on Rousting Rust?
Reflections on Rousting Rust?Reflections on Rousting Rust?
Reflections on Rousting Rust?
David Evans
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
Sysdig
 
Creating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksCreating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just Works
Tim Callaghan
 
Storage Systems
Storage SystemsStorage Systems
Storage Systems
David Evans
 
How to find what is making your Oracle database slow
How to find what is making your Oracle database slowHow to find what is making your Oracle database slow
How to find what is making your Oracle database slow
SolarWinds
 
Analyze database system using a 3 d method
Analyze database system using a 3 d methodAnalyze database system using a 3 d method
Analyze database system using a 3 d method
Ajith Narayanan
 
Input and Output Devices and Systems
Input and Output Devices and SystemsInput and Output Devices and Systems
Input and Output Devices and Systems
Najma Alam
 
How Many Slaves (Ukoug)
How Many Slaves (Ukoug)How Many Slaves (Ukoug)
How Many Slaves (Ukoug)
Doug Burns
 
UKOUG, Lies, Damn Lies and I/O Statistics
UKOUG, Lies, Damn Lies and I/O StatisticsUKOUG, Lies, Damn Lies and I/O Statistics
UKOUG, Lies, Damn Lies and I/O Statistics
Kyle Hailey
 
Operationalizing Clojure Confidently
Operationalizing Clojure ConfidentlyOperationalizing Clojure Confidently
Operationalizing Clojure Confidently
Prasanna Gautam
 
2015.07.16 Способы диагностики PostgreSQL
2015.07.16 Способы диагностики PostgreSQL2015.07.16 Способы диагностики PostgreSQL
2015.07.16 Способы диагностики PostgreSQL
dev1ant
 
An online semantic enhanced dirichlet model for short text
An online semantic enhanced dirichlet model for short textAn online semantic enhanced dirichlet model for short text
An online semantic enhanced dirichlet model for short text
Jay Kumarr
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
Brendan Gregg
 
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON
 
Llauferseiler "OU Libraries: Opportunities Supporting Research and Education"
Llauferseiler "OU Libraries: Opportunities Supporting Research and Education"Llauferseiler "OU Libraries: Opportunities Supporting Research and Education"
Llauferseiler "OU Libraries: Opportunities Supporting Research and Education"
National Information Standards Organization (NISO)
 
First Ride on Rust
First Ride on RustFirst Ride on Rust
First Ride on Rust
David Evans
 
Esa 2014 qiime
Esa 2014 qiimeEsa 2014 qiime
Esa 2014 qiime
Zech Xu
 
Adios hadoop, Hola Spark! T3chfest 2015
Adios hadoop, Hola Spark! T3chfest 2015Adios hadoop, Hola Spark! T3chfest 2015
Adios hadoop, Hola Spark! T3chfest 2015
dhiguero
 

Similar to Scheduling (20)

Access Control
Access ControlAccess Control
Access Control
 
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
 
Reflections on Rousting Rust?
Reflections on Rousting Rust?Reflections on Rousting Rust?
Reflections on Rousting Rust?
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
Creating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksCreating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just Works
 
Storage Systems
Storage SystemsStorage Systems
Storage Systems
 
How to find what is making your Oracle database slow
How to find what is making your Oracle database slowHow to find what is making your Oracle database slow
How to find what is making your Oracle database slow
 
Analyze database system using a 3 d method
Analyze database system using a 3 d methodAnalyze database system using a 3 d method
Analyze database system using a 3 d method
 
Input and Output Devices and Systems
Input and Output Devices and SystemsInput and Output Devices and Systems
Input and Output Devices and Systems
 
How Many Slaves (Ukoug)
How Many Slaves (Ukoug)How Many Slaves (Ukoug)
How Many Slaves (Ukoug)
 
UKOUG, Lies, Damn Lies and I/O Statistics
UKOUG, Lies, Damn Lies and I/O StatisticsUKOUG, Lies, Damn Lies and I/O Statistics
UKOUG, Lies, Damn Lies and I/O Statistics
 
Operationalizing Clojure Confidently
Operationalizing Clojure ConfidentlyOperationalizing Clojure Confidently
Operationalizing Clojure Confidently
 
2015.07.16 Способы диагностики PostgreSQL
2015.07.16 Способы диагностики PostgreSQL2015.07.16 Способы диагностики PostgreSQL
2015.07.16 Способы диагностики PostgreSQL
 
An online semantic enhanced dirichlet model for short text
An online semantic enhanced dirichlet model for short textAn online semantic enhanced dirichlet model for short text
An online semantic enhanced dirichlet model for short text
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
 
Llauferseiler "OU Libraries: Opportunities Supporting Research and Education"
Llauferseiler "OU Libraries: Opportunities Supporting Research and Education"Llauferseiler "OU Libraries: Opportunities Supporting Research and Education"
Llauferseiler "OU Libraries: Opportunities Supporting Research and Education"
 
First Ride on Rust
First Ride on RustFirst Ride on Rust
First Ride on Rust
 
Esa 2014 qiime
Esa 2014 qiimeEsa 2014 qiime
Esa 2014 qiime
 
Adios hadoop, Hola Spark! T3chfest 2015
Adios hadoop, Hola Spark! T3chfest 2015Adios hadoop, Hola Spark! T3chfest 2015
Adios hadoop, Hola Spark! T3chfest 2015
 

More from David Evans

Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!
David Evans
 
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksTrick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
David Evans
 
Hidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeHidden Services, Zero Knowledge
Hidden Services, Zero Knowledge
David Evans
 
Anonymity in Bitcoin
Anonymity in BitcoinAnonymity in Bitcoin
Anonymity in Bitcoin
David Evans
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm Confirmations
David Evans
 
Scripting Transactions
Scripting TransactionsScripting Transactions
Scripting Transactions
David Evans
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in Paradise
David Evans
 
Bitcoin Script
Bitcoin ScriptBitcoin Script
Bitcoin Script
David Evans
 
Mining Economics
Mining EconomicsMining Economics
Mining Economics
David Evans
 
Mining
MiningMining
Mining
David Evans
 
The Blockchain
The BlockchainThe Blockchain
The Blockchain
David Evans
 
Becoming More Paranoid
Becoming More ParanoidBecoming More Paranoid
Becoming More Paranoid
David Evans
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key Signatures
David Evans
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
David Evans
 
Class 1: What is Money?
Class 1: What is Money?Class 1: What is Money?
Class 1: What is Money?
David Evans
 
Multi-Party Computation for the Masses
Multi-Party Computation for the MassesMulti-Party Computation for the Masses
Multi-Party Computation for the Masses
David Evans
 
Proof of Reserve
Proof of ReserveProof of Reserve
Proof of Reserve
David Evans
 
Silk Road
Silk RoadSilk Road
Silk Road
David Evans
 
Blooming Sidechains!
Blooming Sidechains!Blooming Sidechains!
Blooming Sidechains!
David Evans
 
Useful Proofs of Work, Permacoin
Useful Proofs of Work, PermacoinUseful Proofs of Work, Permacoin
Useful Proofs of Work, Permacoin
David Evans
 

More from David Evans (20)

Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!
 
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksTrick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
 
Hidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeHidden Services, Zero Knowledge
Hidden Services, Zero Knowledge
 
Anonymity in Bitcoin
Anonymity in BitcoinAnonymity in Bitcoin
Anonymity in Bitcoin
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm Confirmations
 
Scripting Transactions
Scripting TransactionsScripting Transactions
Scripting Transactions
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in Paradise
 
Bitcoin Script
Bitcoin ScriptBitcoin Script
Bitcoin Script
 
Mining Economics
Mining EconomicsMining Economics
Mining Economics
 
Mining
MiningMining
Mining
 
The Blockchain
The BlockchainThe Blockchain
The Blockchain
 
Becoming More Paranoid
Becoming More ParanoidBecoming More Paranoid
Becoming More Paranoid
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key Signatures
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Class 1: What is Money?
Class 1: What is Money?Class 1: What is Money?
Class 1: What is Money?
 
Multi-Party Computation for the Masses
Multi-Party Computation for the MassesMulti-Party Computation for the Masses
Multi-Party Computation for the Masses
 
Proof of Reserve
Proof of ReserveProof of Reserve
Proof of Reserve
 
Silk Road
Silk RoadSilk Road
Silk Road
 
Blooming Sidechains!
Blooming Sidechains!Blooming Sidechains!
Blooming Sidechains!
 
Useful Proofs of Work, Permacoin
Useful Proofs of Work, PermacoinUseful Proofs of Work, Permacoin
Useful Proofs of Work, Permacoin
 

Recently uploaded

HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
andagarcia212
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
BPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end examBPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end exam
sonukumargpnirsadhan
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxxSimple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
RandolphRadicy
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 

Recently uploaded (20)

HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
BPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end examBPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end exam
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxxSimple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 

Scheduling

  • 1.
  • 2. Plan for Today • Scheduling Intro • Kernel Timer Winner! • Scheduling • Results of Performance Test 1 October 2013 University of Virginia cs4414 1 Shell Demos! (Stride Scheduled) Evan Teague, Josh Lisko Chris McFarland, Clarisse Abalos Nishant Shukla, Jasdev Singh Daniel Nizri, Alex Fabian If you requested a demo, but weren’t selected the (undocumented) secondary tie- breaker was submission time (earlier is better) when multiple teams had similar extra features.
  • 3. 1 October 2013 University of Virginia cs4414 2 RememberfromClass4: 1. How should the supervisor decide which program to run? 2. How long should the alarm clock be set for?
  • 4. Scheduler Desiderata 1 October 2013 University of Virginia cs4414 3 Go placidly amid the noise and haste, and remember what peace there may be in silence. As far as possible without surrender be on good terms with all persons. Speak your truth quietly and clearly; and listen to others, even the dull and the ignorant; they too have their story. Avoid loud and aggressive persons, they are vexations to the spirit. … Exercise caution in your business affairs; for the world is full of trickery. …And whether or not it is clear to you, no doubt the universe is unfolding as it should…whatever your labors and aspirations, in the noisy confusion of life keep peace with your soul. With all its sham, drudgery, and broken dreams, it is still a beautiful world. Be cheerful. Strive to be happy. Max Ehrmann, “Desiderata” (1927)
  • 5. 1 October 2013 University of Virginia cs4414 4 How well do traffic lights do?
  • 6. 1 October 2013 University of Virginia cs4414 5 How well do traffic lights do?
  • 7. Kernel Timer: Wil Thomason 1 October 2013 University of Virginia cs4414 6
  • 8. 1 October 2013 University of Virginia cs4414 7 Midterm Exemption vs. “Dare and Do” “To Dare is To Do” (Tottenham Hotspur FC)
  • 9. About the Midterm • It is not meant to be painful or tedious! • A web form you will do outside of class (posted Thursday Oct 10, due Monday Oct 14) • Open resources except other humans • You should not be surprised if questions from the notes appear on the midterm – It is fine (and encouraged!) to discuss those questions in the course forum before the midterm is posted 1 October 2013 University of Virginia cs4414 8
  • 10. Scheduling Strategies 1 October 2013 University of Virginia cs4414 9 First Come, First Served (FIFO) P1 P2 P3 (effectively: non-preemptive multi-processing)
  • 11. Scheduling Strategies 1 October 2013 University of Virginia cs4414 10 First Come, First Served (FIFO) P1 P2 P3 (effectively: non-preemptive multi-processing) Round-Robin P1 P1 P1P1P2 P2P3 P3P3P3 Time Slice Blocked Each process gets to run for a set time slice, or until it finished or gets blocked.
  • 12. Comparison First Come, First Served Round Robin 1 October 2013 University of Virginia cs4414 11
  • 13. Which one is my laptop using? 1 October 2013 University of Virginia cs4414 12
  • 14. Priorities • More important processes: “higher priority” (except Linux inverts priority values!) – Highest priority = 0 (gets most preferential treatment) – Lowest priority = 99 (highest number varies by Linux flavor) 1 October 2013 University of Virginia cs4414 13
  • 15. 1 October 2013 University of Virginia cs4414 14 $ ps -e -o uid,pid,pri,command | sort -n --key=3 (with some manual editing) UID PID PRI COMMAND 222 48 4 /usr/sbin/netbiosd 501 1536 4 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.fr amework/Versions/A/Support/mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared 501 38470 4 /Applications/Preview.app/Contents/MacOS/Preview - psn_0_4777102 501 38921 4 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.fr amework/Versions/A/Support/mdworker -s mdworker-lsb -c MDSImporterWorker -m com.apple.mdworker.lsb -2 36 23 /usr/libexec/warmd 0 1 31 /sbin/launchd 0 37965 31 /Library/DropboxHelperTools/Dropbox_u501/dbfseventsd 0 37966 31 /Library/DropboxHelperTools/Dropbox_u501/dbfseventsd 0 38871 31 /usr/sbin/ocspd 0 38923 31 ps -e -o uid,pid,pri,command -2 1099 31 /sbin/launchd … many others at PRI=31 elided 501 38913 31 /bin/bash --noediting -i 501 38914 31 rust run listspawn.rs 501 38920 31 ./listspawn08~ 501 38924 31 sort -n --key=3 0 11 33 /usr/libexec/UserEventAgent (System) Should I be happy?
  • 16. Shell Demos! 1 October 2013 University of Virginia cs4414 15 Evan Teague and Josh Lisko Chris McFarland and Clarisse Abalos
  • 17. 1 October 2013 University of Virginia cs4414 16 $ ps -e -o uid,pid,pri,command | sort -n --key=3 (with some manual editing) UID PID PRI COMMAND 222 48 4 /usr/sbin/netbiosd 501 1536 4 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.fr amework/Versions/A/Support/mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared 501 38470 4 /Applications/Preview.app/Contents/MacOS/Preview - psn_0_4777102 501 38921 4 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.fr amework/Versions/A/Support/mdworker -s mdworker-lsb -c MDSImporterWorker -m com.apple.mdworker.lsb -2 36 23 /usr/libexec/warmd 0 1 31 /sbin/launchd 0 37965 31 /Library/DropboxHelperTools/Dropbox_u501/dbfseventsd 0 37966 31 /Library/DropboxHelperTools/Dropbox_u501/dbfseventsd 0 38871 31 /usr/sbin/ocspd 0 38923 31 ps -e -o uid,pid,pri,command -2 1099 31 /sbin/launchd … many others at PRI=31 elided 501 38913 31 /bin/bash --noediting -i 501 38914 31 rust run listspawn.rs 501 38920 31 ./listspawn08~ 501 38924 31 sort -n --key=3 0 11 33 /usr/libexec/UserEventAgent (System) Should I be happy?
  • 18. 1 October 2013 University of Virginia cs4414 17
  • 19. 1 October 2013 University of Virginia cs4414 18 “mdworker is short for ‘metadata server worker’ and if you’re still confused don’t feel bad. mdworker is basically the core technology behind Mac OS X’s awesome search engine Spotlight, it spiders meta data from your Mac and its files and creates a readable index so that you can find things practically instantaneously via Spotlight (command- spacebar).”
  • 20. Pre-emptive Priority Scheduling • Always run the highest priority process that is ready to run • Round-robin schedule among equally high, ready to run, highest-priority processes 1 October 2013 University of Virginia cs4414 19
  • 21. Scheduler Queue 1 October 2013 University of Virginia cs4414 20
  • 22. Shell Demos! 1 October 2013 University of Virginia cs4414 21 Nishant Shukla and Jasdev Singh Daniel Nizri and Alex Fabian
  • 23. 1 October 2013 University of Virginia cs4414 22 2013 MacBook Pro Intel i7-3740QM 2.7 GHz, 4 cores (8 threads) 6MB shared L3 cache 2011 MacBook Air Intel i5-2557M 1.7 GHz, 2 cores (4 threads) 3 MB shared L3 cache both support “hyperthreading” (two threads per core) 60 seconds (normalized time, running on 16- element list) ? From Class 9: How much faster will my Rust mapping program be on my new machine?
  • 24. 1 October 2013 University of Virginia cs4414 23 impl Map for List { fn mapr(&self, f: extern fn(int) -> int) -> List { match(*self) { None => None, Some(ref node) => { let (port, chan) : (Port<int>, Chan<int>) = stream(); let val = node.head; do spawn { chan.send(f(val)); } let newtail = node.tail.mapr(f); Some(~Node{ head: port.recv(), tail: newtail }) } } } }
  • 25. 1 October 2013 University of Virginia cs4414 24 fn collatz_steps(n: int) -> int { if n == 1 { 0 } else { 1 + collatz_steps(if n % 2 == 0 { n / 2 } else { 3*n + 1 }) } } fn find_collatz(k: int) -> int { // Minimum value, n, with Collatz stopping time >= k. let mut n = 1; while collatz_steps(n) < k { n += 1; } n } fn test_list(n: int, x: int) -> List { if n == 0 { None } else { Some(~Node{head: x, tail: test_list(n - 1, x + 1)}) } } fn main() { let lst0 = test_list(16, 565); println(lst0.to_str()); let lst1 = lst0.mapr(find_collatz); println(lst1.to_str()); } Formatted to fit on slide. Your code should have many more newlines than this!
  • 26. 1 October 2013 University of Virginia cs4414 25 x 105 Stopping Time distribution for 1-100 Million http://en.wikipedia.org/wiki/File:CollatzStatistic100million.png
  • 27. Results Old MacBook Air $ rustc listspawn.rs $ time ./listspawn [565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580] [3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887] real 0m58.843s user 3m39.459s sys 0m0.266s New MacBook Pro $ time ./listspawn [565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580] [3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887, 3542887] real 0m18.593s user 2m17.990s sys 0m0.120s 1 October 2013 University of Virginia cs4414 26
  • 28. Checking Results Old MacBook Air $ time ./listspawn real 0m58.843s user 3m39.459s sys 0m0.266s $ !! real 1m0.931s user 3m47.609s sys 0m0.291s $ !! real 0m57.967s user 3m36.343s sys 0m0.266s New MacBook Pro $ time ./listspawn real 0m18.593s user 2m17.990s sys 0m0.120s $ !! real 0m18.757s user 2m20.419s sys 0m0.116s $ !! real 0m18.505s user 2m18.653s sys 0m0.130s 1 October 2013 University of Virginia cs4414 27 Median over three trials: real = 58.8s (user 219.5s) Median over three trials: real = 18.6s (user 138.0s)
  • 29. 1 October 2013 University of Virginia cs4414 28 Median over three trials: real = 18.6s (user 138.0s)
  • 30. Does this make sense? Old MacBook Air 1.7 GHz Processor 2 cores (4 hyperthreads) New MacBook Pro 2.7 GHz Processor 4 cores (8 hyperthreads) 1 October 2013 University of Virginia cs4414 29 Median over three trials: real = 58.8s (user 219.5s) Median over three trials: real = 18.6s (user 138.0s) Cycle speed increase: (2.7/1.7) = 1.59 Thread increase: 2 >>> 219.5 / 138.0 1.5905797101449275 >>> 58.8 / 18.6 3.1612903225806446 >>> (2.7 / 1.7) * 2 3.1764705882352944
  • 31. What sh-Ould I have done to make it faster? 1 October 2013 University of Virginia cs4414 30
  • 32. -O >> $$Old MacBook Air $ rustc -O listspawn.rs $ time ./listspawn real 0m10.573s user 0m36.498s sys 0m0.127s bash-3.2$ time ./listspawn real 0m10.299s user 0m36.545s sys 0m0.119s bash-3.2$ time ./listspawn real 0m10.330s user 0m36.555s sys 0m0.112s New MacBook Pro $ time ./listspawn real 0m2.975s user 0m22.913s sys 0m0.022s $ time ./listspawn real 0m2.922s user 0m22.950s sys 0m0.016s $ time ./listspawn real 0m2.982s user 0m22.875s sys 0m0.019s 1 October 2013 University of Virginia cs4414 31 Median over three trials: -- real = 58.8s (user 219.5s) -O real = 10.3s (user 36.5s) Median over three trials: -- real = 18.6s (user 138.0s) -O real = 2.97s (user 22.91s) predicted (2.7/1.7 * 2): 3.18 times faster without: 3.16 times faster with -O: 3.47 times faster
  • 33. Open Midterm Exemption/HopperPatch Opportunities • Complete implementation of map_reduce function from Class 9 (must use all cores effectively and be able to do examples from MapReduce paper) • “Good Auld Shell” at UVa Football Game • [New!] Write a program that runs at least 20x faster on my new Mac than it does on my old Mac 1 October 2013 University of Virginia cs4414 32
  • 34. What algorithm did you use to schedule your PS2 demos? 1 October 2013 University of Virginia cs4414 33