58 Pages

lecture7

Course: CPS 110, Fall 2009
School: Duke
Rating:
 
 
 
 
 

Word Count: 2542

Document Preview

i Outl ne for Today Real time scheduling Advanced topics in scheduling Real Ti me Schedul er s Real-time schedulers must support regular, periodic execution of tasks (e.g., continuous media). CPU Reservations "I need to execute for X out of every Y units." Scheduler exercises admission control at reservation time: application must handle failure of a reservation request. Proportional...

Register Now

Unformatted Document Excerpt

Coursehero >> North Carolina >> Duke >> CPS 110

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
i Outl ne for Today Real time scheduling Advanced topics in scheduling Real Ti me Schedul er s Real-time schedulers must support regular, periodic execution of tasks (e.g., continuous media). CPU Reservations "I need to execute for X out of every Y units." Scheduler exercises admission control at reservation time: application must handle failure of a reservation request. Proportional Share "I need 1/n of resources" Time Constraints "Run this before my deadline at time T." Assumpti ons Tasks are periodic with constant interval between requests, Ti (request rate 1/Ti) Each task must be completed before the next request for it occurs Tasks are independent Run-time for each task is constant (max), Ci Any non-periodic tasks are special Task M odel C1 = 1 t t 1 Ti 2 Ti T2 C2 = 1 time Defi ni ti ons Deadline is time of next request Overflow at time t if t is deadline of unfulfilled request Feasible schedule - for a given set of tasks, a scheduling algorithm produces a schedule so no overflow ever occurs. Critical instant for a task - time at which a request will have largest response time. Occurs when task is requested simultaneously with all tasks of higher priority Rate M onotoni c Assign priorities to tasks according to their request rates, independent of run times Optimal in the sense that no other fixed priority assignment rule can schedule a task set which can not be scheduled by rate monotonic. If feasible (fixed) priority assignment exists for some task set, rate monotonic is feasible for that task set. Ear l i est Deadl i ne Fi r st Dynamic algorithm Priorities are assigned to tasks according to the deadlines of their current request With EDF there is no idle time prior to an overflow For a given set of m tasks, EDF is feasible iff C1/T1 + C2/T2 + ... + Cm/Tm 1 If a set of tasks can be scheduled by any algorithm, it can be scheduled by EDF Pr opor ti onal Shar e Goals: to integrate real-time and non-real-time tasks, to police ill-behaved tasks, to give every process a well-defined share of the processor. Each client, i, gets a weight wi Instantaneous share fi (t) = wi /(P wj ) j A(t) Service time (fi constant in interval) Si(t0, t1) = fi (t) Pt > Set of active clients varies - fi varies over time t 1 Si(t0 , t1) = t0 fi (P) dP A Ri al to Schedul e Rialto schedules constrained tasks according to a static task graph. For each base period, pick a path from root to a leaf. At each visited node, execute associated task for specified time t. Visit subsequent leaves in subsequent base periods. Modify the schedule only at request time. 4 2 free slots start 3 1 2 1 5 3 Time Common Pr opor ti onal Shar e Competi tor s Weighted Round Robin RR with quantum times equal to share RR: WRR: Fair Share adjustments to priorities to reflect share allocation (compatible with multilevel feedback algorithms) 20 30 Linux 20 10 Common Pr opor ti onal Shar e Competi tor s Weighted Round Robin RR with quantum times equal to share RR: WRR: Fair Share adjustments to priorities to reflect share allocation (compatible with multilevel feedback algorithms) 20 10 Linux 10 10 Common Pr opor ti onal Shar e Competi tor s Weighted Round Robin RR with quantum times equal to share RR: WRR: Fair Share adjustments to priorities to reflect share allocation (compatible with multilevel feedback algorithms) 10 Linux 10 0 Common Pr opor ti onal Shar e Competi tor s Fair Queuing Weighted Fair Queuing Stride scheduling VT Virtual Time advances at a rate proportional to share 2/3 2/2 1/1 VTA(t) = WA(t) / SA t VFT Virtual Finishing Time: VT a client would have after executing its next time quantum VFT = 3/3 WFQ schedules by smallest VFT VFT = 3/2 EA never below -1 VFT = 2/1 L otter y Schedul i ng Lottery scheduling technique. [Waldspurger96] is another scheduling Elegant approach to periodic execution, priority, and proportional resource allocation. Give Wp "lottery tickets" to each process p. GetNextToRun selects "winning ticket" randomly. If Wp = N, then each process gets CPU share Wp/N ... ...probabilistically, and over a sufficiently long time interval. Flexible: tickets are transferable to allow application-level adjustment of CPU shares. Simple, clean, fast. Random choices are often a simple and efficient way to produce the desired overall behavior (probabilistically). L otter y Schedul i ng Wal dspur ger and Wei hl (OSDI 94) Goal: responsive control over the relative rates of computation Claims: Support for modular resource management Generalizable to diverse resources Efficient implementation of proportionalshare resource management: consumption rates of resources by active computations are proportional to relative shares allocated Basi c I dea Resource rights are represented by lottery tickets Give Wp "lottery tickets" to each process p. abstract, relative (vary dynamically wrt contention), uniform (handle heterogeneity) responsiveness: adjusting relative # tickets gets immediately reflected in next lottery At allocation time: hold a lottery; Resource goes to the computation holding the winning ticket. GetNextToRun selects "winning ticket" randomly.. Fai r ness Expected allocation is proportional to # tickets held - actual allocation becomes closer over time. Number of lotteries won by client E[w] = n p where p = t/T Response time (# lotteries w # wins t # tickets to wait for first win) T total # tickets E[n] = 1/p n # lotteries Exampl e L i st-based L otter y T = 20 10 Summing: 10 2 12 5 17 1 2 Random(0, 19) = 15 Bel l s and Whi stl es Ticket transfers - objects that can be explicitly passed in messages Can be used to solve priority inversions Ticket inflation Create more - used among mutually trusting clients to dynamically adjust ticket allocations Currencies - "local" control, exchange rates Compensation tickets - to maintain share use only f of quantum, ticket inflated by 1/f in next Ker nel Objects 1000 base ticket amount currency C_name 300 Backing tickets Currency name Active amount Issued tickets base 1000 base 3000 2000 base Exchange rate: 1 bob = 20 base 100 bob alice 200 100 alice 200 alice bob 100 task1 0 100 task1 task3 task2 200 task2 500 300 task2 100 task3 100 thread1 thread2 thread3 thread4 Exampl e L i st-based L otter y T = 3000 base 10 task2 2bob 5 task3 1 base 2bob Random(0, 2999) = 1500 Compensati on A holds 400 base, B holds 400 base A runs full 100msec quantum, B yields at 20msec B uses 1/5 allotted time Gets compensation ticket valued at 400/(1/5) = 2000 base at next lottery Ti cket Tr ansfer Synchronous RPC between client and server create ticket in client's currency and send to server to fund it's currency on reply, the transfer ticket is destroyed Contr ol Scenar i os Dynamic Control Conditionally and dynamically grant tickets Adaptability Resource abstraction barriers supported by currencies. Insulate tasks. Other Ki nds of Resour ces Control relative waiting times for mutex locks. Mutex currency funded out of currencies of waiting threads Holder gets inheritance ticket in addition to its own funding, passed on to next holder (resulting from lottery) on release. Schedul i ng: Beyond "Or di nar y" Uni pr ocessor s Multiprocessors Co-scheduling and gang scheduling Hungry puppy task scheduling Load balancing Networks of Workstations Harvesting Idle Resources - remote execution and process migration Laptops and mobile computers Power management to extend battery life, scaling processor speed/voltage to tasks at hand, sleep and idle modes. RR and System Thr oughput On a multiprocessor, RR may improve throughput under light load: The scenario: three salmon steaks must cook for 5 minutes per side, but there's only room for two steaks on the hibachi. 30 minutes worth of grill time needed: steaks 1, 2, 3 with sides A and B. FCFS: steaks 1 and 2 for 10 minutes, steak 3 for 10 1 2 2 minutes. 1 Completes in 20 minutes with grill utilization a measly 75%. 1 2 RR and System Thr oughput RR: 1A and 2A...flip...1B and 3A...flip...2B 3B. Completes and in three quanta (15 minutes) with 100% utilization. RR may speed up parallel programs if their inherent parallelism is poorly matched to the real parallelism. E.g., 17 threads execute for N time units on 16 processors. 1 1 2 1 2 2 M ul ti pr ocessor Schedul i ng What makes the problem different? Workload consists of parallel programs Multiple processes or threads, synchronized and communicating Latency defined as last piece to finish. Time-sharing and/or Space-sharing (partitioning up the Mp nodes) Both when and where a process should run Ar chi tectur es Symmetric mp P $ P $ P $ P $ P $ NUMA Node 0 Mem CA Interconnect $ $ CA Mem Node 1 Mem CA CA Mem P $ Memory P P Node 2 Node 3 cluster Effect of Wor kl oad Impact of load-balancing on latency Consider set of processes: 5, 5, 4, 4, 3, 3 3 processors If unrelated: (SJF) avg response time = (3 + 3 + 4 + 7 + 8 + 9)/6 = 5.66 avg response time (SPF) = (8 + 9)/2 = 8.5 avg response time (LPF) = (8 + 8)/2 = Red done 8 If 2 tasks, each 5, 4, 3 (no dependencies) Blue done Affi ni ty Schedul i ng Where (on which node) to run a particular thread during the next time slice? Processor's POV: favor processes which have some residual state locally (e.g. cache) What is a useful measure of affinity for deciding this? Least intervening time or intervening activity (number of processes here since "my" last time) * Same place as last time "I" ran. Possible negative effect on load-balance. Pr ocessor Par ti ti oni ng Static or Dynamic Process Control (Gupta) Vary number of processors available Match number of processes to processors Adjusts # at runtime. Works with task-queue or threads programming model Impact on "working set" Pr ocess Contr ol Cl ai ms Typi cal speed-up pr ofi l e ||ism and working set in memory Lock contention, memory contention, context switching, cache corruption speedup Magic point Number of processes per application Co-Schedul i ng John Ousterhout (Medusa OS) Time-sharing model Schedule related threads simultaneously Why? How? Local scheduling decisions after some global initialization (Medusa) Centralized (SGI IRIX) Effect of Wor kl oad Impact of communication and cooperation Issues: -context switch +common state -lock contention +coordination CM * 's Ver si on Matrix S (slices) x P (processors) Allocate a new set of processes (task force) to a row with enough empty slots Schedule: Round robin through rows of matrix If during a time slice, this processor's element is empty or not ready, run some other task force's entry in this column - backward in time (for affinity reasons and purely local "fall-back" decision) Desi gn Determining how many processors an application should have Centralized server, with system calls for process status info (user-level) (kernel implementation would be desirable, but...) Controlling the number of processes in an application suspend and resume are responsibility of runtime package of application Networ ks of Wor kstati ons What makes the problem different? Exploiting otherwise "idle" cycles. Notion of ownership associated with workstation. Global truth is harder to come by in wide area context H ar vesti ng I dl e Cycl es Remote execution on an idle processor in a NOW (network of workstations) Finding the idle machine and starting execution there. Related to load-balancing work. Vacating the remote workstation when its user returns and it is no longer idle Process migration 41 I ssues Why? Which tasks are candidates for remote execution? Where to find processing cycles? What does "idle" mean? When should a task be moved? How? M oti vati on for Cycl e Shar i ng Load imbalances. Parallel program completion time determined by slowest thread. Speedup limited. Utilization. In trend from shared mainframe to networks of workstations - scheduled cycles > to statically allocated cycles "Ownership" model Heterogeneity Whi ch Tasks? Explicit submission to a "batch" scheduler (e.g., Condor) or Transparent to user. Should be demanding enough to justify overhead of moving elsewhere. Properties? Proximity of resources. Example: move query processing to site of database records. Cache affinity Start here Fi ndi ng Desti nati on Defining "idle" workstations Keyboard/mouse events? CPU load? How timely and complete is the load information (given message transit times)? Global view maintained by some central manager with local daemons reporting status. Limited negotiation with a few peers How binding is any offer of free cycles? Task requirements must match machine capabilities When to M ove At task invocation. Process is created and run at chosen destination. Process migration, once task is already running at some node. State must move. For adjusting load balance (gen...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Wisconsin - STAT - 771
structure(list(reference = structure(list(title = "Construction of Evolutionary Tree Models for Renal Cell Carcinoma from Caparative Genomic Hybridization Data", authors = "Feng Jiang, Richard Desper, Christos H. Papadimitriou, Alejandro A. Scha
BYU - ECE - 466
Agilent 83433A Lightwave Transmitter User's Guide Copyright Agilent Technologies 2000 All Rights Reserved. Reproduction, adaptation, or translation without prior written permission is prohibited, except as allowed under copyright laws. Agilent Part
BYU - ECE - 466
Agilent 83434A Lightwave Receiver User's Guide Copyright Agilent Technologies 2000 All Rights Reserved. Reproduction, adaptation, or translation without prior written permission is prohibited, except as allowed under copyright laws. Agilent Part No
BYU - ECE - 466
Agilent 86140B Series Optical Spectrum Analyzer User's GuideThe OFF symbols are used to mark the positions of the instrument power line switch. The CE mark is a registered trademark of the European Community. The CSA mark is a registered trademark
BYU - ECE - 466
Agilent 86100B Wide-Bandwidth Oscilloscope Getting StartedNotices Agilent Technologies, Inc. 2000-2002 No part of this manual may be reproduced in any form or by any means (including electronic storage and retrieval or translation into a foreign l
BYU - ECE - 466
attenuatorsdatasheetProgrammable AttenuatorsHA SeriesThe HA series attenuators are high-resolution, extended-range, programmable attenuators ideal for testing power meters and for general test and laboratory work. The HA attenuators have a nomin
BYU - ECE - 466
Agilent 83438A Erbium ASE Source User's Guide Copyright 2000 Agilent Technologies All Rights Reserved. Reproduction, adaptation, or translation without prior written permission is prohibited, except as allowed under copyright laws. Agilent Part No.
BYU - ECE - 466
SANTEC TUNABLE LASERSBench Top Tunable LasersTSL-210/220SANTEC TUNABLE LASERSSantec's TSL models are designed as fully-controllable, single-channel benchtop tunable lasers, with superior performance and reasonable cost. Both the TSL-210 and T
BYU - ECE - 466
ST2400A STM-16/OC-48 2.4 Gbit/s Test Set for DWDM ApplicationsOptimized for Dense Wavelength Division Multiplexing (DWDM) Transmission Quality Testing Available in Transceiver, Receiver and Transmitter Only Versions Tributary Testing of STM-64/OC-19
Alabama - ST - 260
|date|time|gender|work|class|attend|like|readnotes|exp|rateprof|resources|rateta|seeta|experience|ohours1|ohours2|studystats|1|2|3|4|5|6|7|8|9|10|11|12|13|14|10/29/2001|16:02:09|1|1|OT|1|"0"|1|1|1|1|1|1|1|MO|34||10/29/2001|16:08:16|Male|Work|OT|Don
Alabama - ST - 260
|date|time|gender|work|class|attend|like|readnotes|exp|rateprof|resources|rateta|seeta|experience|test2score|expgrade|1|2|3|4|5|6|7|8|9|10|11|12|13|14|10/5/2001|13:30:49|1|1|FR|1|no|1|1|2|1|2|67|A||10/5/2001|13:30:56|1|1|FR|1|no|1|1|2|1|2|67|A||10
Alabama - ST - 260
001D11Bond Section: 001 Time: 9ST 260 Fall, 2001 James Homework for: C03 Due in: C04 Seat No. D11 Due date: 8/29/01BCopy and paste histogram from Excel (title, label, all in Excel) hereAnswer the questions: Comment on: shape, Typical value,
Alabama - ST - 260
|date|time|seat_num|name|1|2|3|4|5|6|7|8|9|10|11|12|13|14|4/10/2001|16:35:19||4/10/2001|16:35:50||4/10/2001|16:37:04|x9|my name is this|a|b|a, b|standard|b|a|650|a|c|a|a|c||4/10/2001|16:38:45|x9|my name is this|a|b|a, b|standard|b|a|650|a|c|a|a|c
Alabama - ST - 260
|1/9/2002|12:05:20|male|45|45|no|no|no|yes|no|120|5.50|6|.6||1/9/2002|13:32:18|male|70|19|no|no|no|yes|no|$300.00|$5.00|.5|4||1/10/2002|16:30:40|male|66|23|no|no|yes|yes|yes|$1000|$5.00|2|4||1/10/2002|17:19:02|female|68|29|no|yes|yes|yes|yes|$200
BYU - ECE - 466
Lab #4 OSLO Gaussian beam fiber couplingECEn 466 Introduction to Optical Engineering Introduction The attached linked document is a tutorial for OSLO to familiarize the student with Gaussian beam behavior and fiber coupling. The student version of t
BYU - ECE - 466
Lab #2 Optics Laboratory Familiarization and MeasurementsECEn 493R Optics Lab, Fall 2004 Week 2 (Nov. 1, 2) Introduction This lab introduces the student to the optical test and measurement equipment to be used in the laboratory this semester. Also,
BYU - ECE - 466
Lab #3 Optical Fiber analysis and splicingECEn 493R Optics Lab, Fall 2004 Week 3 Introduction Optical fibers are the principal means for carrying nearly all long distance voice and data traffic. In the near future optical fiber will play an increasi
BYU - ECE - 466
Lab #4 OSLO Gaussian beam fiber couplingECEn 493R Optics Lab, Fall 2004 Introduction The attached linked document is a tutorial for OSLO to familiarize the student with Gaussian beam behavior and fiber coupling. The student version of the package is
BYU - ECE - 466
Lab #5 Source and Detector characterizationECEn 493R Optics Lab, Fall 2004 Due December 7th, beginning of class Introduction This laboratory exercise introduces the student to a variety of optical sources and detectors used in optical systems. Labor
Alabama - ST - 260
ST 260 (sec. 1 & 2) FALL, 1999 Name_Exam 3NNN 11/12/99 Class Time _ Regular seat No._Instructions : This exam is worth 100 points. Point value for each problem is shown on the right. You may use a hand calculator, the supplied formula sheet and t
BYU - ECE - 466
Lab #1 Optics Laboratory Familiarization and MeasurementsECEn 466 Optics Lab, Fall 2005 Week 2 (Oct. 24 - 28) Introduction This lab introduces the student to the optical test and measurement equipment to be used in the laboratory this semester. Also
Alabama - ST - 260
ST 260-990 Name_Exam 3 Class Time _Date: 4/12/01 Regular seat No._Instructions : This exam is worth 100 points. Point value for each problem is shown on the right. You may use a hand calculator, the supplied formula sheet and the table. Show al
Alabama - ST - 260
ST 260 FALL, 1999 Name_Exam 1A 9/17/99 Class Time _ Regular seat No._Instructons : This exam is worth 100 points. Point value for each problem is shown on the right. You may use a hand calculator and the supplied formula sheet. Show all work in a
Alabama - ST - 260
ST 260 FALL, 1999 Name_ Note: This is a 50-minute testExam 2F 10/15/99 Class Time _ Regular seat No._Instructons : This exam is worth 100 points. Point value for each problem is shown on the right. You may use a hand calculator and the supplied f
BYU - ECE - 466
Lab #2 OSLO FamiliarizationECEn 466 Optics Lab, Fall 2005 Week 2 (Oct. 31 Nov 4) Introduction The attached document is a tutorial for an optical design package called OSLO. The student version of the package is loaded on the CAEDM machines. Laborat
Alabama - ST - 260
ST 260 (sec. 1 & 2) FALL, 1999 Name_Exam 2F 10/15/99 Class Time _ Regular seat No._Instructions: This exam is worth 100 points. Point value for each problem is shown on the right. You may use a hand calculator, the supplied formula sheet and the
Alabama - ST - 260
ST 260-990 Name_Exam 2 Date: 3/8/01 Class Time _ Regular seat No._Instructions : This test is worth 100 points. You may use a hand calculator and the supplied formula sheet. Show all work in a neat and logical manner if you expect any partial cre
BYU - ECE - 466
Lab #3 OSLO Optical DesignECEn 466 Optics Lab, Fall 2005 Introduction The attached linked document is a tutorial for OSLO to familiarize the student with Gaussian beam behavior and fiber coupling. The student version of the package is loaded on the
Alabama - ST - 260
ST 260 Practice Final ExamInstructions: This exam is worth 100 points. Point values are given on the right. You may use your formula sheet, z-table, and a non-programmable calculator. Show all work in a neat and logical manner, if you expect to rece
Alabama - ST - 260
Practice Test ST 260Multiple Choice(5 points) 1. Which of the following is a discrete distribution? a. normal b. exponential c. Poisson d. Bayes 2. Which of the following is a continuous distribution? a. uniform b. binomial c. Bernoulli d. Poisson
Alabama - ST - 260
1 ST 260 FALL, 1999 Final ZZZ Name_ Class Time _ 12/17/99 Regular seat No._Instructons : This exam is worth 100 points. Point value for each problem is shownt. You may use a hand calculator and the supplied formula sheet. Show all work in a neat an