56
Dynamic Resource Allocation for Priority Processing – Master Project – Martijn van den Heuvel [email protected] Systems Architecture and Networking (SAN) Department of Mathematics and Computer Science Eindhoven University of Technology the Netherlands 23 July 2009 Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 1 / 34

Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Dynamic Resource Allocation for Priority Processing– Master Project –

Martijn van den [email protected]

Systems Architecture and Networking (SAN)Department of Mathematics and Computer Science

Eindhoven University of Technologythe Netherlands

23 July 2009

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 1 / 34

Page 2: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Outline

1 IntroductionScalable Video AlgorithmsPlatformReal-time SystemsPriority Processing

2 Resource Management MechanismsPreliminary TerminationProcessor Allocation

3 Simulation Environment

4 Simulation ResultsPreliminary TerminationProcessor Allocation

5 Conclusions

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 2 / 34

Page 3: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Scalable Video Algorithms Motivation

Trade-off: Quality versus Resources

• Reuse softwaremodules

• Cost-effective

• Time-to-market(Porting to newplatforms)

By courtesy of Hentschel et. al.

Demo ...

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 3 / 34

Page 4: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Scalable Video Algorithms Motivation

Trade-off: Quality versus Resources

• Reuse softwaremodules

• Cost-effective

• Time-to-market(Porting to newplatforms)

By courtesy of Hentschel et. al.

Demo ...Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 3 / 34

Page 5: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Platform Definition

Definition

A platform, which is capable to run software components, is defined by:

1 hardware (resources)

2 programming language

3 operating system (OS)

4 runtime-libraries (provided by - or built on top of - OS)

Note: A resource can also be a software entity!(We especially consider the processor)

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 4 / 34

Page 6: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Platform Definition

Definition

A platform, which is capable to run software components, is defined by:

1 hardware (resources)

2 programming language

3 operating system (OS)

4 runtime-libraries (provided by - or built on top of - OS)

Note: A resource can also be a software entity!(We especially consider the processor)

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 4 / 34

Page 7: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Hardware Architectures Overview

Flexibilityefficiency

General Purpose DSP ASP

Telephone chips

SignalProcessing

Acceleration

Desktop PC /Laptop

By example of: H. Corporaal, B.Mesman

Current trend

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 5 / 34

Page 8: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Operating System Support

1 Abstraction

provide generic concepts;handle complexity.

2 Virtualization

same abstraction for multiple underlying systems;each user is provided a dedicated platform (sharing of platform).

3 Resource management

sharing, protection of resources;optimize performance of resource usage.

Research subject: Resource Management Mechanisms

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 6 / 34

Page 9: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Operating System Support

1 Abstraction

provide generic concepts;handle complexity.

2 Virtualization

same abstraction for multiple underlying systems;each user is provided a dedicated platform (sharing of platform).

3 Resource management

sharing, protection of resources;optimize performance of resource usage.

Research subject: Resource Management Mechanisms

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 6 / 34

Page 10: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Real-time Systems

Definition

A real-time system is a system which has to fulfill:

1 Functional correctness

2 Timeliness correctness

Requires Analysis!

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 7 / 34

Page 11: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Real-time Systems

Definition

A real-time system is a system which has to fulfill:

1 Functional correctness

2 Timeliness correctness

Requires Analysis!

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 7 / 34

Page 12: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Real-time Task Model

Definition

A task is a sequence of actions that must be performed in reaction to anevent

Definition

A job is an instantiation of a task

Properties of a real-time task:

1 Timing parameters known upfront,(i.e.: computation time, deadline, period);

2 Assume worst-case execution time (WCET) near to average-caseexecution time;

3 priority assignment.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 8 / 34

Page 13: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Real-time Task Model

Definition

A task is a sequence of actions that must be performed in reaction to anevent

Definition

A job is an instantiation of a task

Properties of a real-time task:

1 Timing parameters known upfront,(i.e.: computation time, deadline, period);

2 Assume worst-case execution time (WCET) near to average-caseexecution time;

3 priority assignment.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 8 / 34

Page 14: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Policy versus Mechanism

Definition

A policy defines how a system should behave (abstract).

Definition

A mechanism provides the instrument to implement the policy.

Example: processor sharing (scheduling)

Policy:

time

. . .. . .task 1 task 2task 0

Round RobinAssign time-slots, ∆ts, alternating over tasks

∆ts

Mechanism: priority based scheduling and pre-emption

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 9 / 34

Page 15: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Policy versus Mechanism

Definition

A policy defines how a system should behave (abstract).

Definition

A mechanism provides the instrument to implement the policy.

Example: processor sharing (scheduling)

Policy:

time

. . .. . .task 1 task 2task 0

Round RobinAssign time-slots, ∆ts, alternating over tasks

∆ts

Mechanism: priority based scheduling and pre-emption

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 9 / 34

Page 16: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Fixed Priority Scheduling

Definition

Fixed Priority Pre-emptive Scheduling means:

1 highest priority ready task will always execute

2 during runtime the scheduler can pre-empt a lower priority task infavor of a higher priority task

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 10 / 34

Page 17: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Video Processing Characteristics

Periodic behavior with corresponding deadlines

Data-dependent, highly Fluctuating Load

0.06

0.07

0.08

0.09

0.1

0.11

0.12

0.13

0 200 400 600 800 1000

Tim

e(se

cond

s)

Number of processed frames

Time for deinterlacing a frame (576x720)

VQEG source 6

WCET NOT near to average case

Classical real-time approach leads to under-utilization of (processor)resources.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 11 / 34

Page 18: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing Concept

Basic Analyse Enhancetime

Qua

lity

BasicQuality(0%)

100%

1. Basic: simple and fast output atlow quality;

2. Analysis: Sort video contentin order of importance;

3. Enhance: Process video contentaccording to sorted order;

Termination is allowed after a basic output is available.

prel. termination

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 12 / 34

Page 19: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing Concept

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 13 / 34

Page 20: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing - Overload

Definition

Overload: A task’s computation time exceeds the deadline

time (t)

Period (T )D = T

ta td

basic scalable

preliminary termination

Required: Mechanism for preliminary termination

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 14 / 34

Page 21: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing - Overload

Definition

Overload: A task’s computation time exceeds the deadline

time (t)

Period (T )D = T

ta td

basic scalable

preliminary termination

Required: Mechanism for preliminary termination

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 14 / 34

Page 22: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing - Gain-time

Definition

Gain-time: Assigned, but unused processor resources becoming availablefor other tasks

time (t)

Period (T )D = T

ta td

basic scalable

Gain-time

Desired: Mechanism allowing gain-time consumption

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 15 / 34

Page 23: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing - Gain-time

Definition

Gain-time: Assigned, but unused processor resources becoming availablefor other tasks

time (t)

Period (T )D = T

ta td

basic scalable

Gain-time

Desired: Mechanism allowing gain-time consumption

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 15 / 34

Page 24: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing - Competing Algorithms

Multiple independent algorithms share a single processor

Divide period in fixed-size quanta,e.g. time-slots ∆ts

Decision Scheduler divides time-slots:

time(t)

time(t)

Algorithm 1

Algorithm 2

∆ts

ta td

period(T )

Hence: Dynamic Allocation

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 16 / 34

Page 25: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing - Competing Algorithms

Multiple independent algorithms share a single processor

Divide period in fixed-size quanta,e.g. time-slots ∆ts

Decision Scheduler divides time-slots:

time(t)

time(t)

Algorithm 1

Algorithm 2

∆ts

ta td

period(T )

Hence: Dynamic Allocation

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 16 / 34

Page 26: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing - Competing Algorithms

Multiple independent algorithms share a single processor

Divide period in fixed-size quanta,e.g. time-slots ∆ts

Decision Scheduler divides time-slots:

time(t)

time(t)

Algorithm 1

Algorithm 2

∆ts

ta td

period(T )

Required: Monitoring of time and progress on time-slot scale

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 17 / 34

Page 27: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Outline

1 IntroductionScalable Video AlgorithmsPlatformReal-time SystemsPriority Processing

2 Resource Management MechanismsPreliminary TerminationProcessor Allocation

3 Simulation Environment

4 Simulation ResultsPreliminary TerminationProcessor Allocation

5 Conclusions

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 18 / 34

Page 28: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing Architecture (1/2)

PlatformSyst

emSu

ppor

t

Decision Scheduler

Scalable PriorityProcessing Algorithm 1

Scalable PriorityProcessing Algorithm 2

budgetprogress budgetprogress

App

licat

ion

Lev

el

Resource Management

uses

Decision scheduler aims at maximizing total progress of algorithms

Decision Scheduler defines a scheduling policy,e.g. based on Reinforcement Learning or Round Robin

Focus is on mechanisms to support (optimize) the decision scheduler

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 19 / 34

Page 29: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Priority Processing Architecture (2/2)

PlatformSyst

emSu

ppor

t

Decision Scheduler

Scalable PriorityProcessing Algorithm 1

Scalable PriorityProcessing Algorithm 2

budgetprogress budgetprogress

App

licat

ion

Lev

el

Resource Management

uses

Distribution of Responsibilities:

Application Specific (Policy) System Support (Mechanism)

Roll-forward when deadline reached Preliminary termination

Resource distribution Allocation of processor(Reinforcement Learning policy) (Scheduling)

Monitor Progress values Account consumed time(time-slots)

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 20 / 34

Page 30: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Resource Management Mechanisms

Goal:

Share processor resources among competing priority processing algorithmsas efficient as possible.

Compare performance of different implementations for the mechanisms:

1 Preliminary Termination

2 Processor Allocation

Note: Monitoring is missing and left for discussion.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 21 / 34

Page 31: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Resource Management Mechanisms

Goal:

Share processor resources among competing priority processing algorithmsas efficient as possible.

Compare performance of different implementations for the mechanisms:

1 Preliminary Termination

2 Processor Allocation

Note: Monitoring is missing and left for discussion.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 21 / 34

Page 32: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Preliminary Termination

Terminate all jobs when deadline is reached:

1 Cooperative termination (polling):

Decision Scheduler sets a flag when the deadline expires;Algorithms check on regular intervals for deadline expiration.

1 whi le ( ! endOfFrame and ! d e a d l i n e E x p i r e d )2 p r o c e s s N e x t B l o c k ( ) ;

2 A-synchronous signalling:

Decision Scheduler sends a signal causing all algorithms to preliminaryterminate jobs

Alg. 1

Signal handlerterminateJob();

proceed with next frame

ControlSignal

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 22 / 34

Page 33: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Preliminary Termination

Terminate all jobs when deadline is reached:

1 Cooperative termination (polling):

Decision Scheduler sets a flag when the deadline expires;Algorithms check on regular intervals for deadline expiration.

1 whi le ( ! endOfFrame and ! d e a d l i n e E x p i r e d )2 p r o c e s s N e x t B l o c k ( ) ;

2 A-synchronous signalling:

Decision Scheduler sends a signal causing all algorithms to preliminaryterminate jobs

Alg. 1

Signal handlerterminateJob();

proceed with next frame

ControlSignal

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 22 / 34

Page 34: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Processor Allocation

Dynamically Allocate Processor Resources:

1 Suspend-resume tasks:Suspend only in favor of others!

Resume

Suspend

time(t)

tactivate tdeadline

period(T )∆ts

2 Manipulate priorities:Substitute:

suspend → assign low priorityresume → assign high priority

Low priority tasks can use gain-time.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 23 / 34

Page 35: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Processor Allocation

Dynamically Allocate Processor Resources:

1 Suspend-resume tasks:Suspend only in favor of others!

Resume

Suspend

time(t)

tactivate tdeadline

period(T )∆ts

2 Manipulate priorities:Substitute:

suspend → assign low priorityresume → assign high priority

Low priority tasks can use gain-time.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 23 / 34

Page 36: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Outline

1 IntroductionScalable Video AlgorithmsPlatformReal-time SystemsPriority Processing

2 Resource Management MechanismsPreliminary TerminationProcessor Allocation

3 Simulation Environment

4 Simulation ResultsPreliminary TerminationProcessor Allocation

5 Conclusions

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 24 / 34

Page 37: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Simulation Environment

Priority Processing Applications are prototyped using:

Matlab-Simulink (version 2007b)

Microsoft Windows XP:

use Fixed Priority Scheduler (FPS)administrator privileges required

General Purpose Multi-core machine:

Scalable Video AlgorithmsDecision SchedulerMatlab environment(extract results from simulation)

Video sequences from VQEG

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 25 / 34

Page 38: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Simulation Environment

Priority Processing Applications are prototyped using:

Matlab-Simulink (version 2007b)

Microsoft Windows XP:

use Fixed Priority Scheduler (FPS)administrator privileges required

General Purpose Multi-core machine:

Scalable Video AlgorithmsDecision SchedulerMatlab environment(extract results from simulation)

Video sequences from VQEG

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 25 / 34

Page 39: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Simulation Environment

Priority Processing Applications are prototyped using:

Matlab-Simulink (version 2007b)

Microsoft Windows XP:

use Fixed Priority Scheduler (FPS)administrator privileges required

General Purpose Multi-core machine:

Scalable Video AlgorithmsDecision SchedulerMatlab environment(extract results from simulation)

Video sequences from VQEG

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 25 / 34

Page 40: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Outline

1 IntroductionScalable Video AlgorithmsPlatformReal-time SystemsPriority Processing

2 Resource Management MechanismsPreliminary TerminationProcessor Allocation

3 Simulation Environment

4 Simulation ResultsPreliminary TerminationProcessor Allocation

5 Conclusions

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 26 / 34

Page 41: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Preliminary Termination - Overhead

Computational Overhead of polling-based mechanisms:

0

1

2

3

4

5

6

50 100 150 200

Rel

ativ

e C

ompu

tatio

n T

ime

(% a

dd. t

ime)

Number of processed frames

Polling overhead for scalable deinterlacer (VQEG source 6)

Pixel-based pollingBlock-based polling

Conclusion: Polling causes small overhead on general purpose machines.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 27 / 34

Page 42: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Preliminary Termination - Overhead

Computational Overhead of polling-based mechanisms:

0

1

2

3

4

5

6

50 100 150 200

Rel

ativ

e C

ompu

tatio

n T

ime

(% a

dd. t

ime)

Number of processed frames

Polling overhead for scalable deinterlacer (VQEG source 6)

Pixel-based pollingBlock-based polling

Conclusion: Polling causes small overhead on general purpose machines.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 27 / 34

Page 43: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Preliminary Termination - Latency (1/2)

Polling based termination latencies:

40

42

44

46

48

50

52

54

56

58

60

0 50 100 150 200 250 300 350 400 450

Late

ncy(

µs)

Number of processed frames

Termination latency for deinterlacer (VQEG src6)

Latency (dl = 60 ms)

40

42

44

46

48

50

52

54

56

58

60

0 50 100 150 200 250 300 350 400 450

Late

ncy(

µs)

Number of processed frames

Termination Latency for deinterlacer (VQEG src6)

Latency (dl = 60 ms)

Block-based polling Pixel-based polling

Conclusion: Lowerbound on latency due to OS overhead.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 28 / 34

Page 44: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Preliminary Termination - Latency (1/2)

Polling based termination latencies:

40

42

44

46

48

50

52

54

56

58

60

0 50 100 150 200 250 300 350 400 450

Late

ncy(

µs)

Number of processed frames

Termination latency for deinterlacer (VQEG src6)

Latency (dl = 60 ms)

40

42

44

46

48

50

52

54

56

58

60

0 50 100 150 200 250 300 350 400 450

Late

ncy(

µs)

Number of processed frames

Termination Latency for deinterlacer (VQEG src6)

Latency (dl = 60 ms)

Block-based polling Pixel-based polling

Conclusion: Lowerbound on latency due to OS overhead.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 28 / 34

Page 45: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Preliminary Termination - Latency (2/2)

Signalling based termination latencies:

Implemented in Linux (not in Windows)

Unpredictable latencies

Conclusion: Polling is the most general solution.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 29 / 34

Page 46: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Processor Allocation - Gain-time

How suitable is Priority Processing for gain-time consumption?1 Use Round Robin policy within Decision Scheduler2 Non-optimal scheduling (leaving gain-time)

0

10

20

30

40

50

60

40 50 60 70 80 90 100 110 120

Rel

ativ

e G

ain

(% p

roce

ssed

blo

cks)

Period(ms)

Priority Manipulation vs. Suspend/Resume using RR

Enhancement FilterDeinterlacer

Conclusion: Priority manipulation allows gain-time consumption

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 30 / 34

Page 47: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Processor Allocation - Gain-time

How suitable is Priority Processing for gain-time consumption?1 Use Round Robin policy within Decision Scheduler2 Non-optimal scheduling (leaving gain-time)

0

10

20

30

40

50

60

40 50 60 70 80 90 100 110 120

Rel

ativ

e G

ain

(% p

roce

ssed

blo

cks)

Period(ms)

Priority Manipulation vs. Suspend/Resume using RR

Enhancement FilterDeinterlacer

Conclusion: Priority manipulation allows gain-time consumption

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 30 / 34

Page 48: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Processor Allocation - Gain-time

How suitable is Priority Processing for gain-time consumption?1 Use Round Robin policy within Decision Scheduler2 Non-optimal scheduling (leaving gain-time)

0

10

20

30

40

50

60

40 50 60 70 80 90 100 110 120

Rel

ativ

e G

ain

(% p

roce

ssed

blo

cks)

Period(ms)

Priority Manipulation vs. Suspend/Resume using RR

Enhancement FilterDeinterlacer

Conclusion: Priority manipulation allows gain-time consumption

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 30 / 34

Page 49: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Optimized Control

1 Use block-based polling

2 Use Windows FPS

3 Reduced context-switching

4 Allow gain-time consumption

0

2

4

6

8

10

12

14

30 40 50 60 70 80 90 100 110 120

Rel

ativ

e G

ain

(% p

roce

ssed

blo

cks)

Period(ms)

Priority Manipulation vs. Suspend/Resume using RL

Enhancement FilterDeinterlacer

Conclusion: Significant improvement by reducing control overhead

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 31 / 34

Page 50: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Optimized Control

1 Use block-based polling

2 Use Windows FPS

3 Reduced context-switching

4 Allow gain-time consumption

0

2

4

6

8

10

12

14

30 40 50 60 70 80 90 100 110 120

Rel

ativ

e G

ain

(% p

roce

ssed

blo

cks)

Period(ms)

Priority Manipulation vs. Suspend/Resume using RL

Enhancement FilterDeinterlacer

Conclusion: Significant improvement by reducing control overhead

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 31 / 34

Page 51: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Outline

1 IntroductionScalable Video AlgorithmsPlatformReal-time SystemsPriority Processing

2 Resource Management MechanismsPreliminary TerminationProcessor Allocation

3 Simulation Environment

4 Simulation ResultsPreliminary TerminationProcessor Allocation

5 Conclusions

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 32 / 34

Page 52: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Conclusions

Identification of 3 mechanisms for dynamic resource allocation:1 Preliminary termination:

Most platforms, including Windows, do not support signallingPolling is preferred (trade-off granularity)

2 Processor allocation:

Reduced context-switchingPriority manipulation allows gain-time consumption

3 Monitoring:

On a time-slot scaleRelies on availability of high-resolution timers

Open challenges:1 Optimize processor utilization:

Overhead caused by interference of simulation environmentOptimize memory management

2 Mapping on embedded platform (real-time environment)

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 33 / 34

Page 53: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Conclusions

Identification of 3 mechanisms for dynamic resource allocation:1 Preliminary termination:

Most platforms, including Windows, do not support signallingPolling is preferred (trade-off granularity)

2 Processor allocation:

Reduced context-switchingPriority manipulation allows gain-time consumption

3 Monitoring:

On a time-slot scaleRelies on availability of high-resolution timers

Open challenges:1 Optimize processor utilization:

Overhead caused by interference of simulation environmentOptimize memory management

2 Mapping on embedded platform (real-time environment)

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 33 / 34

Page 54: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Conclusions

Identification of 3 mechanisms for dynamic resource allocation:1 Preliminary termination:

Most platforms, including Windows, do not support signallingPolling is preferred (trade-off granularity)

2 Processor allocation:

Reduced context-switchingPriority manipulation allows gain-time consumption

3 Monitoring:

On a time-slot scaleRelies on availability of high-resolution timers

Open challenges:1 Optimize processor utilization:

Overhead caused by interference of simulation environmentOptimize memory management

2 Mapping on embedded platform (real-time environment)

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 33 / 34

Page 55: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

Conclusions

Identification of 3 mechanisms for dynamic resource allocation:1 Preliminary termination:

Most platforms, including Windows, do not support signallingPolling is preferred (trade-off granularity)

2 Processor allocation:

Reduced context-switchingPriority manipulation allows gain-time consumption

3 Monitoring:

On a time-slot scaleRelies on availability of high-resolution timers

Open challenges:1 Optimize processor utilization:

Overhead caused by interference of simulation environmentOptimize memory management

2 Mapping on embedded platform (real-time environment)

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 33 / 34

Page 56: Dynamic Resource Allocation for Priority Processing - Master …mheuvel/presentations/23072009_2im91... · 2009-10-31 · Dynamic Resource Allocation for Priority Processing { Master

References

L. F. Bic and A. C. Shaw.Operating Systems Principles.Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 2002.

C. Hentschel and S. Schiemenz.Priority-processing for optimized real-time performance with limitedprocessing resources.International Conference on Consumer Electronics (ICCE), 2008.Digest of Technical Papers., Jan. 2008.

S. Schiemenz.Echtzeitsteuerung von skalierbaren Priority-Processing Algorithmen.Tagungsband ITG Fachtagung - Elektronische Medien, pages 108 –113, 17–18 March 2009.

Martijn van den Heuvel (TU/e, SAN) Dynamic Resource Allocation 23 July 2009 34 / 34