SlideShare una empresa de Scribd logo
1 de 34
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

Más contenido relacionado

La actualidad más candente

Scheduling in Linux and Web Servers
Scheduling in Linux and Web ServersScheduling in Linux and Web Servers
Scheduling in Linux and Web ServersDavid 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 SchedulingDavid 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_uringAnne Nicolas
 
Once Upon a Process
Once Upon a ProcessOnce Upon a Process
Once Upon a ProcessDavid 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 cloudAndrea Righi
 
Linux Performance Tools
Linux Performance ToolsLinux Performance Tools
Linux Performance ToolsBrendan 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 profitAndrea Righi
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBrendan 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 ToolsemBO_Conference
 
A Brief History of System Calls
A Brief History of System CallsA Brief History of System Calls
A Brief History of System Callsahl0003
 
Linux Performance Tools 2014
Linux Performance Tools 2014Linux Performance Tools 2014
Linux Performance Tools 2014Brendan Gregg
 
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
 
Bpf performance tools chapter 4 bcc
Bpf performance tools chapter 4   bccBpf performance tools chapter 4   bcc
Bpf performance tools chapter 4 bccViller Hsiao
 

La actualidad más candente (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
 

Destacado

Inventing the Future
Inventing the FutureInventing the Future
Inventing the FutureDavid Evans
 
Operating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - ThreadsOperating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - ThreadsPeter 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 RustDavid 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-GalvinSonali Chauhan
 

Destacado (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 a Scheduling

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 ToolsSysdig
 
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 WorksTim Callaghan
 
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 slowSolarWinds
 
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 methodAjith Narayanan
 
Input and Output Devices and Systems
Input and Output Devices and SystemsInput and Output Devices and Systems
Input and Output Devices and SystemsNajma 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 StatisticsKyle Hailey
 
Operationalizing Clojure Confidently
Operationalizing Clojure ConfidentlyOperationalizing Clojure Confidently
Operationalizing Clojure ConfidentlyPrasanna Gautam
 
2015.07.16 Способы диагностики PostgreSQL
2015.07.16 Способы диагностики PostgreSQL2015.07.16 Способы диагностики PostgreSQL
2015.07.16 Способы диагностики PostgreSQLdev1ant
 
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 textJay Kumarr
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing ToolsBrendan 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 Analysis44CON
 
SUS - ease of use perceptions and eportfoliostfolios Stephen Bright
SUS - ease of use perceptions and eportfoliostfolios  Stephen BrightSUS - ease of use perceptions and eportfoliostfolios  Stephen Bright
SUS - ease of use perceptions and eportfoliostfolios Stephen BrightePortfolios Australia
 
SUS - ease of use perceptions and eportfoliostfolios Stephen Bright
SUS - ease of use perceptions and eportfoliostfolios  Stephen BrightSUS - ease of use perceptions and eportfoliostfolios  Stephen Bright
SUS - ease of use perceptions and eportfoliostfolios Stephen BrightePortfolios Australia
 

Similar a 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
 
Benchmarking
BenchmarkingBenchmarking
Benchmarking
 
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"
 
SUS - ease of use perceptions and eportfoliostfolios Stephen Bright
SUS - ease of use perceptions and eportfoliostfolios  Stephen BrightSUS - ease of use perceptions and eportfoliostfolios  Stephen Bright
SUS - ease of use perceptions and eportfoliostfolios Stephen Bright
 
SUS - ease of use perceptions and eportfoliostfolios Stephen Bright
SUS - ease of use perceptions and eportfoliostfolios  Stephen BrightSUS - ease of use perceptions and eportfoliostfolios  Stephen Bright
SUS - ease of use perceptions and eportfoliostfolios Stephen Bright
 

Más de 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 CypherpunksDavid Evans
 
Hidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeHidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeDavid Evans
 
Anonymity in Bitcoin
Anonymity in BitcoinAnonymity in Bitcoin
Anonymity in BitcoinDavid Evans
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm ConfirmationsDavid Evans
 
Scripting Transactions
Scripting TransactionsScripting Transactions
Scripting TransactionsDavid Evans
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in ParadiseDavid Evans
 
Mining Economics
Mining EconomicsMining Economics
Mining EconomicsDavid Evans
 
Becoming More Paranoid
Becoming More ParanoidBecoming More Paranoid
Becoming More ParanoidDavid Evans
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key SignaturesDavid Evans
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographyDavid 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 MassesDavid Evans
 
Proof of Reserve
Proof of ReserveProof of Reserve
Proof of ReserveDavid 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, PermacoinDavid Evans
 

Más de 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
 

Último

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 

Último (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 

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