SlideShare a Scribd company logo
1 of 49
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
Proportional Share Scheduling
• 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
     • WA(t1, t2) is the amount of service received by client A
        during the time interval (t1, t2).
     • SA is the proportional share of client A
     • ∑i Si is the sum of shares of all the clients.




                                                                  4
Service Time Error (EA)
• The error is the difference between the amount of
  time allocated to the client during interval (t1, t2)
  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
Weighted Round-Robin (WRR)
• 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 user’s 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 VTi(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 client’s share.




       Where
               WA(t) is the amount of service received by client A
               SA 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.

                              A       B      C
                              1/3    1/2     1/1




                                                    15
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.

                              B       A      C
                              1/2    2/3     1/1



         A




                                                    16
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.

                              A       C      B
                              2/3    1/1     2/2



         A      B




                                                    17
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.

                              C       B      A
                              1/1    2/2     3/3



         A      B      A




                                                    18
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.

                              B       A      C
                              2/2    3/3     2/1



         A      B      A       C




                                                    19
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.

                              A       B      C
                              3/3    3/2     2/1



         A      B      A       C      B




                                                    20
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.

                              A       B      C
                              4/3    3/2     2/1



         A      B      A       C      B      A




                                                    21
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
             Si 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,
                             TCA ≥ TCB

 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
               SC 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.

                     Time Counter     3      2     1
                     Client           A     B      C
                     VFT             1/3    1/2   1/1



   Execution
   QVT         1/6   2/6      3/6   4/6    5/6    6/6




                                                        30
VTRR Example
• 3 clients A, B, and C having shares 3, 2, and 1
  respectively.

                     Time Counter          3      2     1
                     Client                A     B      C
                     VFT                  1/3    1/2   1/1



   Execution
   QVT         1/6   2/6      3/6        4/6    5/6    6/6


                                    ::     1/3 – 2/6 < 1/3

                                                             31
VTRR Example
• 3 clients A, B, and C having shares 3, 2, and 1
  respectively.

                     Time Counter          2      2     1
                     Client                A     B      C
                     VFT                  2/3    1/2   1/1



   Execution   A
   QVT         1/6   2/6      3/6        4/6    5/6    6/6


                                    ::     1/2 – 3/6 < 1/2

                                                             32
VTRR Example
• 3 clients A, B, and C having shares 3, 2, and 1
  respectively.

                     Time Counter          2      1     1
                     Client                A     B      C
                     VFT                  2/3    2/2   1/1



   Execution   A     B
   QVT         1/6   2/6      3/6        4/6    5/6    6/6


                                    ::     1/1 – 4/6 < 1/1

                                                             33
VTRR Example
• 3 clients A, B, and C having shares 3, 2, and 1
  respectively.

                     Time Counter          2      1     0
                     Client                A     B      C
                     VFT                  2/3    2/2   2/1



   Execution   A     B        C
   QVT         1/6   2/6      3/6        4/6    5/6    6/6


                                    ::     2/3 – 5/6 < 1/3

                                                             34
VTRR Example
• 3 clients A, B, and C having shares 3, 2, and 1
  respectively.

                     Time Counter            1      1     0
                     Client                A       B      C
                     VFT                  3/3      2/2   2/1



   Execution   A     B        C          A
   QVT         1/6   2/6      3/6        4/6      5/6    6/6


                                    ::       2/2 – 6/6 < 1/2

                                                               35
VTRR Example
• 3 clients A, B, and C having shares 3, 2, and 1
  respectively.

                     Time Counter       1     0     0
                     Client           A      B      C
                     VFT             3/3     3/2   2/1



   Execution   A     B        C     A       B
   QVT         1/6   2/6      3/6   4/6     5/6    6/6




                                                         36
VTRR Example
• 3 clients A, B, and C having shares 3, 2, and 1
  respectively.

                     Time Counter            1      0     0
                     Client                A       B      C
                     VFT                  3/3      3/2   2/1



   Execution   A     B        C          A        B
   QVT         1/6   2/6      3/6        4/6      5/6    6/6


                                    ::       3/3 – 7/6 < 1/3

                                                               37
VTRR Example
• 3 clients A, B, and C having shares 3, 2, and 1
  respectively.

                     Time Counter       1     0     0
                     Client           A      B      C
                     VFT             3/3     3/2   2/1



   Execution   A     B        C     A       B      A
   QVT         1/6   2/6      3/6   4/6     5/6    6/6




                                                         38
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 client’s 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 CA and
     the previous counter value.

                                                                          40
VTRR Complexity
• A client is selected to execute in O(1) time.

• Updating the client’s 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 2.2.12-20 kernel.


• Timestamps were read from hardware cycle
  counter registers.
                                                                        42
VTRR: Measurements & Results




      WRR vs. VTRR Service Time Error

                                        43
VTRR: Measurements & Results




      WFQ vs. VTRR Service Time Error

                                        44
VTRR: Measurements & Results




       Average Scheduling Overhead
                                     45
VTRR: Measurements & Results




                Scheduling Behavior




                                      46
VTRR: Measurements & Results




               MPEG Encoding behavior



                                    47
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?

Please send both your positive and negative feedback
                         on
                 parang@cs.vt.edu



                                                   49

More Related Content

What's hot

Go back-n protocol
Go back-n protocolGo back-n protocol
Go back-n protocolSTEFFY D
 
Distributed document based system
Distributed document based systemDistributed document based system
Distributed document based systemChetan Selukar
 
RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION           RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION AMOGHA A K
 
Direct linking loader
Direct linking loaderDirect linking loader
Direct linking loaderbabyparul
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed applicationRishikese MR
 
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSINGADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING Zena Abo-Altaheen
 
Sliding window and error control
Sliding window and error controlSliding window and error control
Sliding window and error controlAdil Mehmoood
 
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS garishma bhatia
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingVTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingSachin Gowda
 
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysisFinite automata-for-lexical-analysis
Finite automata-for-lexical-analysisDattatray Gandhmal
 
Unit 5 Advanced Computer Architecture
Unit 5 Advanced Computer ArchitectureUnit 5 Advanced Computer Architecture
Unit 5 Advanced Computer ArchitectureBalaji Vignesh
 
Perspective in Informatics 3 - Assignment 2 - Answer Sheet
Perspective in Informatics 3 - Assignment 2 - Answer SheetPerspective in Informatics 3 - Assignment 2 - Answer Sheet
Perspective in Informatics 3 - Assignment 2 - Answer SheetHoang Nguyen Phong
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocolManusha Dilan
 

What's hot (20)

Go back-n protocol
Go back-n protocolGo back-n protocol
Go back-n protocol
 
CSMA/CA
CSMA/CACSMA/CA
CSMA/CA
 
Distributed document based system
Distributed document based systemDistributed document based system
Distributed document based system
 
RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION           RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION
 
Direct linking loader
Direct linking loaderDirect linking loader
Direct linking loader
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed application
 
Error control
Error controlError control
Error control
 
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSINGADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
 
Sliding window and error control
Sliding window and error controlSliding window and error control
Sliding window and error control
 
Flowshop scheduling
Flowshop schedulingFlowshop scheduling
Flowshop scheduling
 
Em algorithm
Em algorithmEm algorithm
Em algorithm
 
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS
 
Types of Compilers
Types of CompilersTypes of Compilers
Types of Compilers
 
24 Multithreaded Algorithms
24 Multithreaded Algorithms24 Multithreaded Algorithms
24 Multithreaded Algorithms
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingVTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computing
 
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysisFinite automata-for-lexical-analysis
Finite automata-for-lexical-analysis
 
Unit 5 Advanced Computer Architecture
Unit 5 Advanced Computer ArchitectureUnit 5 Advanced Computer Architecture
Unit 5 Advanced Computer Architecture
 
Perspective in Informatics 3 - Assignment 2 - Answer Sheet
Perspective in Informatics 3 - Assignment 2 - Answer SheetPerspective in Informatics 3 - Assignment 2 - Answer Sheet
Perspective in Informatics 3 - Assignment 2 - Answer Sheet
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocol
 

Viewers also liked

Ramification of games_double round elimination_by Lester B. Panem
Ramification of games_double round elimination_by Lester B. PanemRamification of games_double round elimination_by Lester B. Panem
Ramification of games_double round elimination_by Lester B. Panemlgabp
 
The History and Evolution of SDN
The History and Evolution of SDNThe History and Evolution of SDN
The History and Evolution of SDNNapier University
 
Operating System Overview
Operating System OverviewOperating System Overview
Operating System OverviewAnas Ebrahim
 
Smp and asmp architecture.
Smp and asmp architecture.Smp and asmp architecture.
Smp and asmp architecture.Gaurav Dalvi
 
Round Robin Scheduling Algorithm (Simulation)
Round Robin Scheduling Algorithm (Simulation)Round Robin Scheduling Algorithm (Simulation)
Round Robin Scheduling Algorithm (Simulation)Everywhere
 
Fundamentals of operating system
Fundamentals of operating systemFundamentals of operating system
Fundamentals of operating systemJayesh Chauhan
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs schedulingmyrajendra
 
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin schedulingRaghav S
 
Ramification of games_round robin_by Lester B. Panem
Ramification of games_round robin_by Lester B. PanemRamification of games_round robin_by Lester B. Panem
Ramification of games_round robin_by Lester B. Panemlgabp
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithmsShanu Kumar
 

Viewers also liked (20)

Round robin
Round robinRound robin
Round robin
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Ramification of games_double round elimination_by Lester B. Panem
Ramification of games_double round elimination_by Lester B. PanemRamification of games_double round elimination_by Lester B. Panem
Ramification of games_double round elimination_by Lester B. Panem
 
cpu scheduling2 in os
cpu scheduling2 in os cpu scheduling2 in os
cpu scheduling2 in os
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
The History and Evolution of SDN
The History and Evolution of SDNThe History and Evolution of SDN
The History and Evolution of SDN
 
Microkernel
MicrokernelMicrokernel
Microkernel
 
Operating System Overview
Operating System OverviewOperating System Overview
Operating System Overview
 
Symmetric multiprocessing
Symmetric multiprocessingSymmetric multiprocessing
Symmetric multiprocessing
 
Microkernel
MicrokernelMicrokernel
Microkernel
 
2. microkernel new
2. microkernel new2. microkernel new
2. microkernel new
 
Smp and asmp architecture.
Smp and asmp architecture.Smp and asmp architecture.
Smp and asmp architecture.
 
Round Robin Scheduling Algorithm (Simulation)
Round Robin Scheduling Algorithm (Simulation)Round Robin Scheduling Algorithm (Simulation)
Round Robin Scheduling Algorithm (Simulation)
 
Scheduling
SchedulingScheduling
Scheduling
 
Fundamentals of operating system
Fundamentals of operating systemFundamentals of operating system
Fundamentals of operating system
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs scheduling
 
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin scheduling
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
Ramification of games_round robin_by Lester B. Panem
Ramification of games_round robin_by Lester B. PanemRamification of games_round robin_by Lester B. Panem
Ramification of games_round robin_by Lester B. Panem
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 

More from Parang Saraf

Email and Network Analyzer
Email and Network AnalyzerEmail and Network Analyzer
Email and Network AnalyzerParang Saraf
 
Slides: Safeguarding Abila through Multiple Data Perspectives
Slides: Safeguarding Abila through Multiple Data PerspectivesSlides: Safeguarding Abila through Multiple Data Perspectives
Slides: Safeguarding Abila through Multiple Data PerspectivesParang Saraf
 
Slides: Safeguarding Abila: Real-time Streaming Analysis
Slides: Safeguarding Abila: Real-time Streaming AnalysisSlides: Safeguarding Abila: Real-time Streaming Analysis
Slides: Safeguarding Abila: Real-time Streaming AnalysisParang Saraf
 
Slides: Safeguarding Abila: Spatio-Temporal Activity Modeling
Slides: Safeguarding Abila: Spatio-Temporal Activity ModelingSlides: Safeguarding Abila: Spatio-Temporal Activity Modeling
Slides: Safeguarding Abila: Spatio-Temporal Activity ModelingParang Saraf
 
Safeguarding Abila: Discovering Evolving Activist Networks
Safeguarding Abila: Discovering Evolving Activist NetworksSafeguarding Abila: Discovering Evolving Activist Networks
Safeguarding Abila: Discovering Evolving Activist NetworksParang Saraf
 
EMBERS AutoGSR: Automated Coding of Civil Unrest Events
EMBERS AutoGSR: Automated Coding of Civil Unrest EventsEMBERS AutoGSR: Automated Coding of Civil Unrest Events
EMBERS AutoGSR: Automated Coding of Civil Unrest EventsParang Saraf
 
EMBERS at 4 years: Experiences operating an Open Source Indicators Forecastin...
EMBERS at 4 years: Experiences operating an Open Source Indicators Forecastin...EMBERS at 4 years: Experiences operating an Open Source Indicators Forecastin...
EMBERS at 4 years: Experiences operating an Open Source Indicators Forecastin...Parang Saraf
 
Slides: Forex-Foreteller: Currency Trend Modeling using News Articles
Slides: Forex-Foreteller: Currency Trend Modeling using News ArticlesSlides: Forex-Foreteller: Currency Trend Modeling using News Articles
Slides: Forex-Foreteller: Currency Trend Modeling using News ArticlesParang Saraf
 
Slides: Epidemiological Modeling of News and Rumors on Twitter
Slides: Epidemiological Modeling of News and Rumors on TwitterSlides: Epidemiological Modeling of News and Rumors on Twitter
Slides: Epidemiological Modeling of News and Rumors on TwitterParang Saraf
 
Slides: Concurrent Inference of Topic Models and Distributed Vector Represent...
Slides: Concurrent Inference of Topic Models and Distributed Vector Represent...Slides: Concurrent Inference of Topic Models and Distributed Vector Represent...
Slides: Concurrent Inference of Topic Models and Distributed Vector Represent...Parang Saraf
 
EMBERS AutoGSR: Automated Coding of Civil Unrest Events
EMBERS AutoGSR: Automated Coding of Civil Unrest EventsEMBERS AutoGSR: Automated Coding of Civil Unrest Events
EMBERS AutoGSR: Automated Coding of Civil Unrest EventsParang Saraf
 
DMAP: Data Aggregation and Presentation Framework
DMAP: Data Aggregation and Presentation FrameworkDMAP: Data Aggregation and Presentation Framework
DMAP: Data Aggregation and Presentation FrameworkParang Saraf
 
Concurrent Inference of Topic Models and Distributed Vector Representations
Concurrent Inference of Topic Models and Distributed Vector RepresentationsConcurrent Inference of Topic Models and Distributed Vector Representations
Concurrent Inference of Topic Models and Distributed Vector RepresentationsParang Saraf
 
Bayesian Model Fusion for Forecasting Civil Unrest
Bayesian Model Fusion for Forecasting Civil UnrestBayesian Model Fusion for Forecasting Civil Unrest
Bayesian Model Fusion for Forecasting Civil UnrestParang Saraf
 
‘Beating the News’ with EMBERS: Forecasting Civil Unrest using Open Source In...
‘Beating the News’ with EMBERS: Forecasting Civil Unrest using Open Source In...‘Beating the News’ with EMBERS: Forecasting Civil Unrest using Open Source In...
‘Beating the News’ with EMBERS: Forecasting Civil Unrest using Open Source In...Parang Saraf
 
Safeguarding Abila through Multiple Data Perspectives
Safeguarding Abila through Multiple Data PerspectivesSafeguarding Abila through Multiple Data Perspectives
Safeguarding Abila through Multiple Data PerspectivesParang Saraf
 
Safeguarding Abila: Real-time Streaming Analysis
Safeguarding Abila: Real-time Streaming AnalysisSafeguarding Abila: Real-time Streaming Analysis
Safeguarding Abila: Real-time Streaming AnalysisParang Saraf
 
Safeguarding Abila: Spatio-Temporal Activity Modeling
Safeguarding Abila: Spatio-Temporal Activity ModelingSafeguarding Abila: Spatio-Temporal Activity Modeling
Safeguarding Abila: Spatio-Temporal Activity ModelingParang Saraf
 

More from Parang Saraf (20)

Email and Network Analyzer
Email and Network AnalyzerEmail and Network Analyzer
Email and Network Analyzer
 
Slides: Safeguarding Abila through Multiple Data Perspectives
Slides: Safeguarding Abila through Multiple Data PerspectivesSlides: Safeguarding Abila through Multiple Data Perspectives
Slides: Safeguarding Abila through Multiple Data Perspectives
 
Slides: Safeguarding Abila: Real-time Streaming Analysis
Slides: Safeguarding Abila: Real-time Streaming AnalysisSlides: Safeguarding Abila: Real-time Streaming Analysis
Slides: Safeguarding Abila: Real-time Streaming Analysis
 
Slides: Safeguarding Abila: Spatio-Temporal Activity Modeling
Slides: Safeguarding Abila: Spatio-Temporal Activity ModelingSlides: Safeguarding Abila: Spatio-Temporal Activity Modeling
Slides: Safeguarding Abila: Spatio-Temporal Activity Modeling
 
Safeguarding Abila: Discovering Evolving Activist Networks
Safeguarding Abila: Discovering Evolving Activist NetworksSafeguarding Abila: Discovering Evolving Activist Networks
Safeguarding Abila: Discovering Evolving Activist Networks
 
News Analyzer
News AnalyzerNews Analyzer
News Analyzer
 
EMBERS AutoGSR: Automated Coding of Civil Unrest Events
EMBERS AutoGSR: Automated Coding of Civil Unrest EventsEMBERS AutoGSR: Automated Coding of Civil Unrest Events
EMBERS AutoGSR: Automated Coding of Civil Unrest Events
 
EMBERS at 4 years: Experiences operating an Open Source Indicators Forecastin...
EMBERS at 4 years: Experiences operating an Open Source Indicators Forecastin...EMBERS at 4 years: Experiences operating an Open Source Indicators Forecastin...
EMBERS at 4 years: Experiences operating an Open Source Indicators Forecastin...
 
Slides: Forex-Foreteller: Currency Trend Modeling using News Articles
Slides: Forex-Foreteller: Currency Trend Modeling using News ArticlesSlides: Forex-Foreteller: Currency Trend Modeling using News Articles
Slides: Forex-Foreteller: Currency Trend Modeling using News Articles
 
Slides: Epidemiological Modeling of News and Rumors on Twitter
Slides: Epidemiological Modeling of News and Rumors on TwitterSlides: Epidemiological Modeling of News and Rumors on Twitter
Slides: Epidemiological Modeling of News and Rumors on Twitter
 
Slides: Concurrent Inference of Topic Models and Distributed Vector Represent...
Slides: Concurrent Inference of Topic Models and Distributed Vector Represent...Slides: Concurrent Inference of Topic Models and Distributed Vector Represent...
Slides: Concurrent Inference of Topic Models and Distributed Vector Represent...
 
EMBERS AutoGSR: Automated Coding of Civil Unrest Events
EMBERS AutoGSR: Automated Coding of Civil Unrest EventsEMBERS AutoGSR: Automated Coding of Civil Unrest Events
EMBERS AutoGSR: Automated Coding of Civil Unrest Events
 
DMAP: Data Aggregation and Presentation Framework
DMAP: Data Aggregation and Presentation FrameworkDMAP: Data Aggregation and Presentation Framework
DMAP: Data Aggregation and Presentation Framework
 
EMBERS Posters
EMBERS PostersEMBERS Posters
EMBERS Posters
 
Concurrent Inference of Topic Models and Distributed Vector Representations
Concurrent Inference of Topic Models and Distributed Vector RepresentationsConcurrent Inference of Topic Models and Distributed Vector Representations
Concurrent Inference of Topic Models and Distributed Vector Representations
 
Bayesian Model Fusion for Forecasting Civil Unrest
Bayesian Model Fusion for Forecasting Civil UnrestBayesian Model Fusion for Forecasting Civil Unrest
Bayesian Model Fusion for Forecasting Civil Unrest
 
‘Beating the News’ with EMBERS: Forecasting Civil Unrest using Open Source In...
‘Beating the News’ with EMBERS: Forecasting Civil Unrest using Open Source In...‘Beating the News’ with EMBERS: Forecasting Civil Unrest using Open Source In...
‘Beating the News’ with EMBERS: Forecasting Civil Unrest using Open Source In...
 
Safeguarding Abila through Multiple Data Perspectives
Safeguarding Abila through Multiple Data PerspectivesSafeguarding Abila through Multiple Data Perspectives
Safeguarding Abila through Multiple Data Perspectives
 
Safeguarding Abila: Real-time Streaming Analysis
Safeguarding Abila: Real-time Streaming AnalysisSafeguarding Abila: Real-time Streaming Analysis
Safeguarding Abila: Real-time Streaming Analysis
 
Safeguarding Abila: Spatio-Temporal Activity Modeling
Safeguarding Abila: Spatio-Temporal Activity ModelingSafeguarding Abila: Spatio-Temporal Activity Modeling
Safeguarding Abila: Spatio-Temporal Activity Modeling
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Virtual time round-robin scheduler presented by Parang Saraf (CS4204 VT)

  • 1. Virtual-Time Round-Robin: An O(1) Proportional Share Scheduler Jason Nieh; Chris Vaill; & Hua Zhong Columbia University Presented By: Parang Saraf
  • 3. Proportional Share Scheduling • 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
  • 4. Perfect Fairness • An ideal state in which each client receives service exactly proportional to its share. where • WA(t1, t2) is the amount of service received by client A during the time interval (t1, t2). • SA is the proportional share of client A • ∑i Si is the sum of shares of all the clients. 4
  • 5. Service Time Error (EA) • The error is the difference between the amount of time allocated to the client during interval (t1, t2) 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
  • 6. Background Art • Weighted Round-Robin Scheduling • Fair-Share Scheduling • Lottery Scheduling • Weighted Fair Queuing Scheduling 6
  • 8. Weighted Round-Robin (WRR) • 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
  • 9. 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
  • 10. Fair-Share Scheduling • Fair-Share provides proportional sharing among users by adjusting the priorities of a user’s 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
  • 12. 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
  • 13. Weighted Fair Queuing (WFQ) • Virtual Time VTi(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 client’s share. Where WA(t) is the amount of service received by client A SA is the share of client A • Virtual Finish Time (VFT) is the virtual time after running the client for one time quantum. 13
  • 14. 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
  • 15. 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. A B C 1/3 1/2 1/1 15
  • 16. 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. B A C 1/2 2/3 1/1 A 16
  • 17. 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. A C B 2/3 1/1 2/2 A B 17
  • 18. 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. C B A 1/1 2/2 3/3 A B A 18
  • 19. 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. B A C 2/2 3/3 2/1 A B A C 19
  • 20. 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. A B C 3/3 3/2 2/1 A B A C B 20
  • 21. 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. A B C 4/3 3/2 2/1 A B A C B A 21
  • 22. 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
  • 23. 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
  • 24. 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
  • 25. 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
  • 26. 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 Si 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
  • 27. 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
  • 28. Basic VTRR Algorithm Role of Time Counters o Time Counter Invariant: for any two consecutive clients in the queue A and B, TCA ≥ TCB 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
  • 29. Basic VTRR Algorithm VFT Inequality Where, Q is the time quantum SC 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
  • 30. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 3 2 1 Client A B C VFT 1/3 1/2 1/1 Execution QVT 1/6 2/6 3/6 4/6 5/6 6/6 30
  • 31. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 3 2 1 Client A B C VFT 1/3 1/2 1/1 Execution QVT 1/6 2/6 3/6 4/6 5/6 6/6 :: 1/3 – 2/6 < 1/3 31
  • 32. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 2 2 1 Client A B C VFT 2/3 1/2 1/1 Execution A QVT 1/6 2/6 3/6 4/6 5/6 6/6 :: 1/2 – 3/6 < 1/2 32
  • 33. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 2 1 1 Client A B C VFT 2/3 2/2 1/1 Execution A B QVT 1/6 2/6 3/6 4/6 5/6 6/6 :: 1/1 – 4/6 < 1/1 33
  • 34. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 2 1 0 Client A B C VFT 2/3 2/2 2/1 Execution A B C QVT 1/6 2/6 3/6 4/6 5/6 6/6 :: 2/3 – 5/6 < 1/3 34
  • 35. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 1 1 0 Client A B C VFT 3/3 2/2 2/1 Execution A B C A QVT 1/6 2/6 3/6 4/6 5/6 6/6 :: 2/2 – 6/6 < 1/2 35
  • 36. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 1 0 0 Client A B C VFT 3/3 3/2 2/1 Execution A B C A B QVT 1/6 2/6 3/6 4/6 5/6 6/6 36
  • 37. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 1 0 0 Client A B C VFT 3/3 3/2 2/1 Execution A B C A B QVT 1/6 2/6 3/6 4/6 5/6 6/6 :: 3/3 – 7/6 < 1/3 37
  • 38. VTRR Example • 3 clients A, B, and C having shares 3, 2, and 1 respectively. Time Counter 1 0 0 Client A B C VFT 3/3 3/2 2/1 Execution A B C A B A QVT 1/6 2/6 3/6 4/6 5/6 6/6 38
  • 39. 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 client’s 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
  • 40. 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 CA and the previous counter value. 40
  • 41. VTRR Complexity • A client is selected to execute in O(1) time. • Updating the client’s 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
  • 42. 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 2.2.12-20 kernel. • Timestamps were read from hardware cycle counter registers. 42
  • 43. VTRR: Measurements & Results WRR vs. VTRR Service Time Error 43
  • 44. VTRR: Measurements & Results WFQ vs. VTRR Service Time Error 44
  • 45. VTRR: Measurements & Results Average Scheduling Overhead 45
  • 46. VTRR: Measurements & Results Scheduling Behavior 46
  • 47. VTRR: Measurements & Results MPEG Encoding behavior 47
  • 48. 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
  • 49. Questions? Please send both your positive and negative feedback on parang@cs.vt.edu 49