Virtual-Time Round-Robin: An O(1) Proportional Share Scheduler Jason Nieh; Chris Vaill; & Hua Zhong Columbia University Presented By: Parang Saraf.

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Symantec 2010 Windows 7 Migration Global Results.
1 A B C
October 31, 2005Copyright © by Erik D. Demaine and Charles E. LeisersonL13.1 Introduction to Algorithms LECTURE 11 Amortized Analysis Dynamic tables.
AP STUDY SESSION 2.
1
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Processes and Operating Systems
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
STATISTICS INTERVAL ESTIMATION Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Objectives: Generate and describe sequences. Vocabulary:
David Burdett May 11, 2004 Package Binding for WS CDL.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
CALENDAR.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
The 5S numbers game..
Media-Monitoring Final Report April - May 2010 News.
Break Time Remaining 10:00.
Factoring Quadratics — ax² + bx + c Topic
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
PP Test Review Sections 6-1 to 6-6
1 The Blue Café by Chris Rea My world is miles of endless roads.
Bright Futures Guidelines Priorities and Screening Tables
The Frequency Table or Frequency Distribution Table
Briana B. Morrison Adapted from William Collins
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
LIAL HORNSBY SCHNEIDER
Outline Minimum Spanning Tree Maximal Flow Algorithm LP formulation 1.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
CS 6143 COMPUTER ARCHITECTURE II SPRING 2014 ACM Principles and Practice of Parallel Programming, PPoPP, 2006 Panel Presentations Parallel Processing is.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
Chapter 1: Expressions, Equations, & Inequalities
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
Artificial Intelligence
Subtraction: Adding UP
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Essential Cell Biology
Converting a Fraction to %
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Clock will move after 1 minute
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
Completing the Square Topic
Copyright Tim Morris/St Stephen's School
1.step PMIT start + initial project data input Concept Concept.
9. Two Functions of Two Random Variables
1 Dr. Scott Schaefer Least Squares Curves, Rational Representations, Splines and Continuity.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
Virtual-Time Round-Robin: An O(1) Proportional Share Scheduler By Jason Nieh, etc Xiaojun Wang 10/07/2005.
Virtual-Time Round-Robin: An O(1) Proportional Share Scheduler Jason Nieh, Chris Vaill, Hua Zhong Columbia University Presented by Adam Binford.
Virtual-Time Round-Robin: An O(1) Proportional Share Scheduler
Presentation transcript:

Virtual-Time Round-Robin: An O(1) Proportional Share Scheduler Jason Nieh; Chris Vaill; & Hua Zhong Columbia University Presented By: Parang Saraf

Proportional Share Scheduling 2

Given a set of clients with associated weights, a proportional share scheduler should allocate resources to each client in proportion to its respective weight. Two types of proportional sharing: o Varying Frequency o Varying Time quantum 3

Perfect Fairness An ideal state in which each client receives service exactly proportional to its share. where W A (t 1, t 2 ) is the amount of service received by client A during the time interval (t 1, t 2 ). S A is the proportional share of client A i S i is the sum of shares of all the clients. 4

Service Time Error (E A ) The error is the difference between the amount of time allocated to the client during interval (t 1, t 2 ) under the given algorithm, and the amount of time what would have been allocated under an ideal scheme that maintains perfect fairness for all clients over all intervals. Measured in time units (tu). 5

Background Art Weighted Round-Robin Scheduling Fair-Share Scheduling Lottery Scheduling Weighted Fair Queuing Scheduling 6

Weighted Round-Robin (WRR) 7

Clients are placed in a queue and allowed to execute in turn. WRR provides proportional sharing by running all clients with the same frequency but adjusting the size of their time quanta. Scheduling overhead: O(1) 8

WRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. (3 tu) (2 tu) (1 tu) A B C The error range is -1 tu to +1.5 tu. 9

Fair-Share Scheduling Fair-Share provides proportional sharing among users by adjusting the priorities of a users clients in a suitable way. Proportional sharing is achieved by running the clients at different frequencies. Scheduling overhead: O(1) – O(N) Where N is the number of clients 10

Lottery Scheduling 11

Lottery Scheduling Each client is given a number of tickets proportional to its share. A ticket is randomly selected by the scheduler and the client that owns the selected ticket is scheduled to run for a time quantum. Scheduling Overhead: O(log N) – O(N). Scheduling accuracy is random, because it relies on the law of randomness. 12

Weighted Fair Queuing (WFQ) Virtual Time VT i (t) o is a measure of the degree to which a client has received its proportional allocation relative to other clients. o advances at the rate inversely proportional to the clients share. Where W A (t) is the amount of service received by client A S A is the share of client A Virtual Finish Time (VFT) is the virtual time after running the client for one time quantum. 13

Weighted Fair Queuing (WFQ) Clients are ordered in a queue sorted from smallest to largest VFT. The first client in the queue is selected for execution. After the client is executed, its VFT is updated and the client is inserted back into the queue. Its position in the queue is determined by its updated VFT. 14

WFQ Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. Initial VFTs are 1/3, 1/2 and 1/1 respectively. 15 ABC 1/31/21/1

WFQ Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. Initial VFTs are 1/3, 1/2 and 1/1 respectively. 16 BAC 1/22/31/1 A

WFQ Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. Initial VFTs are 1/3, 1/2 and 1/1 respectively. 17 ACB 2/31/12/2 AB

WFQ Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. Initial VFTs are 1/3, 1/2 and 1/1 respectively. 18 CBA 1/12/23/3 ABA

WFQ Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. Initial VFTs are 1/3, 1/2 and 1/1 respectively. 19 BAC 2/23/32/1 ABAC

WFQ Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. Initial VFTs are 1/3, 1/2 and 1/1 respectively. 20 ABC 3/33/22/1 ABACB

WFQ Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. Initial VFTs are 1/3, 1/2 and 1/1 respectively. 21 ABACBA ABC 4/33/22/1

WFQ Performance For last example, service time error ranges from -5/6 to +1 tu. It never gets below -1 tu. This means that a client can never fall behind its ideal allocation by more than a single time quantum. Scheduling Overhead: O(log N) – O(N). Most closest to proportional sharing. 22

Virtual-Time Round-Robin (VTRR) Algorithm: 1)Order the clients in the run queue from largest to smallest share. Unlike fair queue, the client's position in the run queue only changes when its share changes. 2)Starting from the beginning of the queue, run each client for one time quantum in a round-robin manner. 3)In step 2, if a client has received more than its proportional allocation, skip the remaining clients in the run queue and start from the beginning. Since, the clients with larger share values are placed first in the queue, this allows them to get more service than the lower-share clients at the end of the queue. 23

Basic VTRR Algorithm For each client, VTRR associates the following: 1) Share : the resource rights of a client. 2) Virtual Finish Time (VFT) : Number of time quanta executed divided by the share of the client. 3) Time Counter : tracks the number of quanta the client must receive before a period is over. 4) ID Number : uniquely identifies a client. 5) Run State : whether the client can be executed or not. 24

Basic VTRR Algorithm VTRR maintains a scheduler state, having following: 1) Time Quantum : How long is one time quantum 2) Run Queue : sorted queue of all runnable clients ordered from largest to smallest share client. 3) Total Shares : Sum of the shares of all the clients. 4) Queue virtual time (QVT) : is the measure of what a client's VFT should be if it has received exactly its proportional share allocation. 25

Basic VTRR Algorithm Queue Virtual Time (QVT) QVT advances whenever any client executes at a rate inversely proportional to the total shares (same for every client): Where, Q is the system time quantum S i is the share of client i The difference between the QVT and a client's virtual time is a measure of whether the respective client has consumed its proportional allocation of resources or not. 26

Basic VTRR Algorithm Role of Time Counters o Scheduling Cycle : a sequence of allocations whose length is equal to the sum of all client shares. In our example its 6 (3+2+1). o Time counter for each client is reset at the beginning of each scheduling cycle to the client's share value, and is decremented every time a client receives a time quantum. o At the end of a scheduling cycle, the time counter of every client should be equal to zero. 27

Basic VTRR Algorithm Role of Time Counters o Time Counter Invariant : for any two consecutive clients in the queue A and B, TC A TC B o Preserving Time Counter Invariant : If the counter value of the next client is greater than the counter of the current client, the scheduler makes the next client the current client and executes it for a quantum, without question. 28

Basic VTRR Algorithm VFT Inequality Where, Q is the time quantum S C is the share of client C o Only if the VFT inequality is true, the scheduler selects and executes the next client in the run queue. o If at any point, the VFT inequality is not true, the scheduler returns to the beginning of the run queue and selects the first client to execute. 29

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 30 Time Counter321 ClientABC VFT1/31/21/1 Execution QVT1/62/63/64/65/66/6

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 31 Time Counter321 ClientABC VFT1/31/21/1 Execution QVT1/62/63/64/65/66/6 :: 1/3 – 2/6 < 1/3

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 32 Time Counter221 ClientABC VFT2/31/21/1 ExecutionA QVT1/62/63/64/65/66/6 :: 1/2 – 3/6 < 1/2

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 33 Time Counter211 ClientABC VFT2/32/21/1 ExecutionAB QVT1/62/63/64/65/66/6 :: 1/1 – 4/6 < 1/1

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 34 Time Counter210 ClientABC VFT2/32/22/1 ExecutionABC QVT1/62/63/64/65/66/6 :: 2/3 – 5/6 < 1/3

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 35 Time Counter110 ClientABC VFT3/32/22/1 ExecutionABCA QVT1/62/63/64/65/66/6 :: 2/2 – 6/6 < 1/2

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 36 Time Counter100 ClientABC VFT3/33/22/1 ExecutionABCAB QVT1/62/63/64/65/66/6

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 37 Time Counter100 ClientABC VFT3/33/22/1 ExecutionABCAB QVT1/62/63/64/65/66/6 :: 3/3 – 7/6 < 1/3

VTRR Example 3 clients A, B, and C having shares 3, 2, and 1 respectively. 38 Time Counter100 ClientABC VFT3/33/22/1 ExecutionABCABA QVT1/62/63/64/65/66/6

VTRR Dynamic Considerations Inserting a new client o A new client is inserted into the run queue so that the run queue remains sorted from largest to smallest client share. o We set the clients implicit virtual time to be the same as the QVT. o Subsequently, VFT is calculated as follows: o The initial counter value is set as follows: 39

VTRR Dynamic Considerations Removing and re-inserting an existing client o When a client becomes not runnable, it is removed from the queue and its last-previous and last-next clients are recorded. o VFT is not updated any more. While re-inserting VFT is calculated as follows: o Similarly, if the client is inserted in the same cycle in which it was removed, the counter is set to the minimum of C A and the previous counter value. 40

VTRR Complexity A client is selected to execute in O(1) time. Updating the clients VFT and the current run queue are both O(1) time operations. The complete counter reset takes O(N) time, where N is the number of clients. o However, this reset is done after every scheduling cycle. o As a result, the reset of the time counters is amortized over all the clients giving an effective running time of O(1). 41

VTRR: Measurements & Results Conducted simulation studies to compare the proportional sharing accuracy of VTRR against both WRR and WFQ. The System used has following configuration: o Gateway 2000 E1400 system o One 433 MHz Intel Celeron CPU o 128 MB RAM o 10 GB hard drive o Red Hat Linux 6.1 distribution running Linux kernel. Timestamps were read from hardware cycle counter registers. 42

VTRR: Measurements & Results 43 WRR vs. VTRR Service Time Error

VTRR: Measurements & Results 44 WFQ vs. VTRR Service Time Error

VTRR: Measurements & Results 45 Average Scheduling Overhead

VTRR: Measurements & Results 46 Scheduling Behavior

VTRR: Measurements & Results 47 MPEG Encoding behavior

Conclusion & Future Work VTRR is simple to implement and easy to integrate into existing commercial operating systems. o Implementing VTRR requires just 100 lines of code in Linux. VTRR combines the benefits of accurate proportional share resource management with very low overhead. Future work involves, evaluating VTRR in a multi- processor context. o Group Ratio Round-Robin: O(1) Proportional Share Scheduling for Uniprocessor and Multiprocessor Systems; 2005 USENIX Annual Technical Conference 48

Questions? Questions? Please send both your positive and negative feedback on 49