dynamic soft real time scheduling dsrt system
Download
Skip this Video
Download Presentation
Dynamic Soft Real Time Scheduling (DSRT) System

Loading in 2 Seconds...

play fullscreen
1 / 35

Dynamic Soft Real Time Scheduling (DSRT) System - PowerPoint PPT Presentation


  • 89 Views
  • Uploaded on

Dynamic Soft Real Time Scheduling (DSRT) System. Klara Nahrstedt cs589kn. Problem Statement. Multimedia applications need guaranteed and continuous processor time allocation. A MPEG decoder running at 10 frames per second. A game animation updating the movements of objects every 50ms.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Dynamic Soft Real Time Scheduling (DSRT) System' - sailor


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
problem statement
Problem Statement
  • Multimedia applications need guaranteed and continuous processor time allocation.
    • A MPEG decoder running at 10 frames per second.
    • A game animation updating the movements of objects every 50ms.
  • Applications have Soft Deadlines.
  • Run on General Purpose OS.
    • Limitations: I/O Interrupts, Layered memory subsystem, priority inversion, ...
dsrt solution
DSRT Solution
  • Basic Features are insufficient.
  • Unique/Advanced Features
    • CPU Service Classes.
    • Probing Service.
    • Adaptive Service.
    • Advanced Reservations*.
    • Security/Access Model*.
    • Multiprocessor Support.
    • Distributed Monitoring Support*.
    • Middleware Implementation.
dsrt concepts
DSRT Concepts
  • CPU Service Classes
  • Mapping CPU Service Classes into a Multiprocessor Partitioning Design
  • Execution Flow of a SRT Process
cpu service classes
Service Classes

Specification Parameters

Guaranteed

P = Period

PPT = Peak Processing Time

PPT

PCPT

(Periodic Constant

Processing Time)

SPT

PVPT

(Periodic Variable

Processing Time)

P = Period

SPT = Sustainable Processing

Time

PPT = Peak Processing Time

BT = Burst Tolerance

ACPU

(Aperiodic Constant

Processor Utilization)

PPU

PPU = Peak Processor

Utilization

Relative Deadline

PPT = Peak Processing Time

Event

PPT

CPU Service Classes
periodic constant processing time class
Periodic Constant Processing Time Class
  • Example Usage Pattern:

Peak Processing Time=10ms

Period = 100ms

0

10

110

210

100

200

Time(ms)

periodic variable processing time class
0

15

120

210

100

200

Periodic Variable Processing Time Class
  • Example Usage Pattern:

Period = 100ms

Peak Processing Time = 30ms

Sustainable Processing

Time = 15ms

Burst Tolerance = 7ms

Time(ms)

multiprocessor partitioning design
Multiprocessor Partitioning Design

Guaranteed Part

Non-guaranteed Part

PCPT Processes

Reserved Run

Overrun

Reserved Run

Burst

Overrun

PVPT Processes

TS Processes

RT Scheduler

Overrun Scheduler

TS Scheduler

Processor #1

RT Partition

Overrun Partition

TS Partition

Processor #2

RT Partition

Overrun Partition

TS Partition

execution flow of a srt process
Execution Phase

Probing Phase

Reservation Phase

Scheduling

Probe

Admission

Control

Extract

Reservation

Monitor/

Conformance

Test

Contract

Processor Binding

Adaptation

SRT Process

Adjusted Contract

Execution Flow of a SRT Process
smart probing 1
Smart Probing (1)
  • Goal: Extract a reservation.
    • Determine the most suitable Service Class and Parameters.
    • Avoid over/under reserve resources.
  • Needed because:
    • Processor usage is hardware platform dependent.
    • Processor usage is input dependent.
smart probing 2
Smart Probing (2)
  • DSRT runs a few iterations of SRT applications without reservation.
  • DSRT monitors the usage iteration by iteration.
  • DSRT analyzes the usage history.

Estimate a Reservation

Processor Usage

Conformance Test ?

Iteration Number

execution flow of a dsrt process
Execution Phase

Probing Phase

Reservation Phase

Scheduling

Probe

Admission

Control

Extract

Reservation

Monitor/

Conformance

Test

Contract

Processor Binding

Adaptation

SRT Process

Adjusted Contract

Execution Flow of a DSRT Process
conformance test 1
Conformance Test (1)

Processor Usage

Nonconformance

Conformance

Burst Tolerance

Reserved Usage

conformance test 2
Conformance Test (2)
  • SSBTR = System Specific Burst Tolerance Rate.

PVPT Class

PCPT Class

Processor Usage

Processor Usage

SPT(1+SSBTR)+BT

PPT(1+SSBTR)

PPT(1+SSBTR)

SPT Leak every P

PPT Leak every P

PPT Leak every P

smart probing 3
12ms

50ms

62ms

10ms

55ms

40ms

60ms

5ms

Smart Probing (3)
  • Compute average processor usage = 50ms
  • Compute peak processor usage = 62ms.
  • Max Burst = 12ms

50ms

40ms

62ms

43ms

55ms

50ms

50ms

50ms

50ms

50ms

smart probing 4
Smart Probing (4)
  • SSBTR = 10%
  • Average Processor Usage * SSBTR = 5ms
  • If Max Burst < 5ms
    • Constant Processing Time Class
  • else if Max Burst (12ms) > 5ms,
    • Variable Processing Time Class
      • Sustainable Processing Time =50ms
      • Peak Processing Time = 62ms
      • Burst Tolerance = 12ms - 5ms = 7ms
execution flow of a dsrt process1
Execution Phase

Probing Phase

Reservation Phase

Scheduling

Probe

Admission

Control

Extract

Reservation

Monitor/

Conformance

Test

Contract

Processor Binding

Adaptation

SRT Process

Adjusted Contract

Execution Flow of a DSRT Process
admission control test
Admission Control Test
  • Given a reservation request, determine
    • Resource Availability. (1) + (2)
    • Processor Binding. (2)
  • Preemptive Earliest Deadline First:
execution flow of a dsrt process2
Execution Phase

Probing Phase

Reservation Phase

Scheduling

Probe

Admission

Control

Extract

Reservation

Monitor/

Conformance

Test

Contract

Processor Binding

Adaptation

SRT Process

Execution Flow of a DSRT Process

Adjusted Contract

partition scheduling
Proportional Sharing

RT Scheduler

Overrun Scheduler

TS Scheduler

Multi-Level

Round Robin

Priority Queues

Kernel

Scheduler

Preemptive

EDF

Processor #1

RT Partition

Overrun Partition

TS Partition

Processor #2

RT Partition

Overrun Partition

TS Partition

Partition Scheduling

Top-Level Scheduler

rt partition scheduler
RT Partition Scheduler

Processor #1

Waiting Queue:

(Sorted with the

earliest released

time)

p

(2a) finished one

iteration

p

(3) released for

next iteration

(1) admitted

p

Runnable Queue:

(Sorted with the

earliest deadline)

(2b) overrunning

Overrun Partition Queues

overrun partition scheduler
Highest Priority

Burst Queue (FIFO)

(2) Miss Deadline

p

(1a) Conformed?

Overrun Queue (FIFO)

(1b) Nonconformed?

p

Permanent Non-conforming Queue (FIFO)

(1c) Nonconformed frequently?

Lowest Priority

Overrun Partition Scheduler
execution flow of a dsrt process3
Execution Phase

Probing Phase

Reservation Phase

Scheduling

Probe

Admission

Control

Extract

Reservation

Monitor/

Conformance

Test

Contract

Processor Binding

Adaptation

SRT Process

Adjusted Contract

Execution Flow of a DSRT Process
adaptation
Adaptation

Scene #1

Scene #2

  • Adjust Reservation.
  • 3 Strategies
    • Exponential Average
    • Range
    • Statistical

Frame 275

exponential average adaptation strategy
X1

X2

X3

...

Xws-1

Xws

Xws+1

...

X2ws

...

X3ws

Iteration Number

Adaptation Points

Exponential Average Adaptation Strategy
  • Specification:
    • Window Size (ws).
    • Alpha ()
    • Xi= Guaranteed Parameter in a reservation.
    • Xi-1 = Actual Usage.
statistical adaptation strategy
X1

X2

X3

...

Xws-1

Xws

Xws+1

...

X2ws

...

X3ws

Iteration

Adaptation Points

Statistical Adaptation Strategy
  • Specification:
    • Window Size (ws).
    • Overrun Tolerance Frequency (f).
  • Example: ws=10, f=20%. Adjust X=40ms.
implementation building blocks
Implementation Building Blocks
  • A Real Time Timer.
    • setiimer() in Solaris and Irix. Lots of Timers in NT.
  • Fixed Real Time Priority.
    • priocntl() in Solaris, sched_setscheduler() in Irix, setPriorityClass() in NT.
  • Processor Affinity.
    • processor_bind() in Solaris, sysmp(MP_MUSTRUN_PID) in Irix, and setProcessAffinityMask() in NT.
user level priority dispatch
User-level Priority Dispatch

Highest Priority

(5) Dispatched

Process runs

for T ms.

(4) Scheduler

sleeps.

Fixed RT

Priority

(3) Scheduler

sets Timer for

T ms.

DSRT Scheduler Process

N

(6) Timer

interrupts

Scheduler

Dispatched Process

N-1

.

.......

(2) Set

Processor

Affinity.

.......

.

Time Sharing Processes

(5) Decrease

Priority

.

(1) Increase

Priority.

.......

Dynamic TS

Priority

.......

RT Process Pool

0

Lowest Priority

c apis
C++ APIs

// Reservation Phase

cpu.reserve(reservation);

cpu.setAdaptStrategy(strategy);

// Execution Phase

cpu.start();

for (;;) {

doJob();

cpu.yield();

}

cpu.stop();

cpu.free();

CpuApi cpu;

CpuReservation reservation;

// Probing Phase;

cpu.probe();

cpu.start();

for (int i=0; i

doJob();

cpu.yield();

}

cpu.stop();

cpu.probeEnd();

cpu.probeMatch(&reservation);

experiment
Experiment
  • Dual Processor Sun Ultra 2 Machine.
  • Solaris 2.6 Operating System.
  • Dispatch Latency 400us. Includes
    • Scheduling Algorithm.
    • Context Switches.
    • Various system calls.
experiment setup
Experiment Setup
  • Run 8 TS processes and 5 SRT processes concurrently.
  • TS1-6: Computational intensive programs.
  • TS7-8: Compilation programs.
  • SRT1: A MPEG player at 10 FPS.
    • Probing (PVPT class, P=100ms,
    • SPT=28ms, PPT=40ms, BT=11ms).
    • Adaptation Strategy: (Statistical,

f = 20%, ws = 20).

experimental setup cont
Experimental Setup (Cont.)
  • SRT2: A MPEG player at 20 FPS.
    • Probing (PVPT class, P=50ms,

SPT=14ms, PPT=21ms, BT=6ms)

  • SRT3: A sampling program.
    • Probing(PCPT class, P=50ms,

PPT=10ms)

  • SRT4: A Java RocksInSpace game.
    • (PCPT class, P=100ms, PPT=30ms).
  • SRT5: Misbehaving greedy program.
    • (PCPT class, P=500ms, PPT=10ms).
experimental result
Experimental Result

SRT2: MPEG player with P=50ms.

SRT1: MPEG player With P=100ms

experimental result cont
Experimental Result (Cont.)

SRT3: Sampling program with P=50ms.

SRT4: Java game with P=100ms.

conclusion
Conclusion
  • Multimedia needs strong support from the OS via scheduling policies, differentiation policies and mechanisms
  • Soft real-time guarantees can be made using priority mechanisms, but in a careful manner
  • Changes can be made via middleware systems or directly inside of kernels, but there are trade-offs
ad