25
Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems Wanghong Yuan, Klara Nahrstedt Department of Computer Science University of Illinois at Urbana- Champaign GRACE

Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

  • Upload
    kylar

  • View
    35

  • Download
    0

Embed Size (px)

DESCRIPTION

Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems. Wanghong Yuan, Klara Nahrstedt Department of Computer Science University of Illinois at Urbana-Champaign. GRACE. Mobile Multimedia Devices. Challenges - PowerPoint PPT Presentation

Citation preview

Page 1: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Energy-Efficient Soft Real-Time CPU Scheduling for

Mobile Multimedia Systems

Wanghong Yuan, Klara Nahrstedt

Department of Computer Science

University of Illinois at Urbana-Champaign

GRACE

Page 2: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Mobile Multimedia Devices

Challenges– Manage resources to save energy while

supporting multimedia quality

CPU

Opportunities– Dynamic frequency/voltage scaling (DVS)

– Applications release job periodically and meet deadline statistically (e.g., 95%)

Page 3: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

GRACE-OS

Enhanced CPU scheduler

– Soft real-time scheduling + DVS

Which application, when, how long, how fast

– Stochastic scheduling decisions

Minimize energy while supporting quality

Part of cross-layer adaptation frameworkGRACE

Page 4: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Architecture

CPU

monitoring scheduling

speed scaling

demand

distribution

GR

AC

E-O

S

SRT Scheduler

Speed Adaptor

Profiler

Multimedia Applications

stochastic requirements

time constraint

Page 5: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Three Subproblems

1. Profiler: demand prediction

– Basis for scheduling and DVS

2. SRT scheduler: stochastic scheduling

– Which app, when, and how long to execute

3. Speed adaptor: stochastic DVS

– How fast to execute

Page 6: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Demand Prediction

Online profiling and estimation

1. Count number of cycles used by each job

2. Group and count occurrence frequency

b1 b2Cmin=b0 br=Cmax

1

br-1

cum

ulat

ive

prob

abil

ity

CDF F(x) = P [X x]

Page 7: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

ObservationsDemand distribution of MPGDec

0

0.2

0.4

0.6

0.8

1

4.5 5.7 6.9 8.1 9.3frame cycles (millions)

cum

ulat

ive

prob

abilit

y

first 50first 100all frames

Demand distribution is stable or changes slowly

Demand distribution of H263Dec

0

0.2

0.4

0.6

0.8

1

7.2 8.2 9.2 10.2 11.2 12.2frame cycles (millions)

cum

ulat

ive p

roba

bility

first 50first 100all frames

Page 8: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Three Subproblems

1. Profiler: demand prediction

– Basis for scheduling and DVS

2. SRT scheduler: stochastic scheduling

– Which app to execute, when, and how long

3. Speed adaptor: stochastic DVS

– How fast to execute

Page 9: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Stochastic Allocation

How many cycles to allocate per job?

Application requires percent of deadlines

Each job meets deadline with probability

Allocate C cycles, such that F(C)=P[XC]

b1 b2 b0 br

1

br-1

cum

ulat

ive

prob

abil

ity

F(x)

C

Page 10: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Scheduling

Earliest deadline first (EDF) scheduling

1. Allocate cycle budget per job

2. Execute job with earliest deadline and +budget

3. Charge budget by number of cycles consumed

Preempt if budget is exhausted

Which job to execute, when, how long

Page 11: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Three Subproblems

1. Profiler: demand prediction

– Basis for scheduling and DVS

2. SRT scheduler: stochastic scheduling

– Which app to execute, when, and how long

3. Speed adaptor: stochastic DVS

– How fast to execute

Page 12: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

How Fast ?

Intuitively, uniform speed

– Minimum energy if use the allocated exactly

However, jobs use cycles statistically

– Often complete before using up the allocated

– Potential to save more energy

Stochastic DVS

Page 13: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Stochastic DVS

For each job

1. Allocate time

2. Find speed Sx for each allocated cycle x

Time is 1/Sx and energy is (1 - F(x))S2x

such that

Page 14: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Speed Schedule

Piece-wise approximation

– Uniform speed within group

– Change speed at group boundaries, b0,…,bk

Speed schedule

– List of points (cycle bi, speed Sbi)

Change speed to Sbi at bi cycles

Page 15: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Example

0100 MHz

1 x 106

200 MHz2 x 106

400 MHzcycle:speed:

Job 12.5x106 cycles

spe

ed (

MH

z)

100

400

106106

5x105200

106

2x105

Job 21.2x106 cycles

Page 16: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Three Subproblems

1. Profiler: demand prediction

– Basis for scheduling and DVS

2. SRT scheduler: stochastic scheduling

– Which app to execute, when, and how long

3. Speed adaptor: stochastic DVS

– How fast to execute

Page 17: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

SRT + DVS s

peed

A1 A1 B1B1 A1

A1

execution

speed upwithin job

context switch1. Store speed for switched-out2. New speed for switched-in

new job

A2

Page 18: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Implementation

Hardware: HP N5470 laptop

– Athlon CPU (300, 500, 600, 700, 800, 1000MHz) Round speed schedule to upper bound

GRACE-OS: extension to Linux kernel 2.4.18

– 716 lines of C code

process control block

standardLinux

scheduler

SRT-DVS modules• PowerNow speed scaling• Soft real-time scheduling

systemcall

Page 19: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Evaluation

Compare GRACE-OS with schemes performing deterministic allocation or DVS

DVS

uniform reclamation stochastic

allocation

worst-case wrsUni wrsRec wrsSto

stochastic stoUni stoRec GRACE-OS

Page 20: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Metrics

Quality evaluation

– Deadline miss ratio

Applications require to meet 95%

Energy evaluation

– CPU time distribution at speeds [Flautner02]

More time in low speeds better

– Normalized energy

Page 21: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

GRACE-OS consumes least energyHowever, limited due to few speed options

Normalized Energy28.8

3.7 7

.8

5

56.7

17.2

3.3 7

.8

5

32.5

8.2

2.7

7.8

5

21.92

8.8

3.7 7

.8

5

42.1

17.2

3.3 7

.8

5

30.1

8.2

2.7

7.8

5

20.5

0

15

30

45

60

75

MPGDec H263Dec GSMEnc MP3Dec concurrent

no

rma

lzie

d e

ne

rgy

wrsUni wrsRec wrsSto stoUni stoRec grace-os

Page 22: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Time Distribution (concurrent run)

GRACE-OS spends most busy time at lowest

20.6

52.7 64

.4

20.7

53.2

83.8

0

20

40

60

80

100

wrsUni wrsRec wrsSto stoUni stoRec grace-os

% o

f CP

U ti

me

300MHz 500MHz 600MHz 700MHz 800MHz 1000MHz

Page 23: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

GRACE-OS bounds miss ratio

Deadline Miss Ratio

0.4 0.3 0.5 0.5 0.6 0.40.3 0.5 0.4

4.85.2 4.9

0

2

4

6

8

10

wrsUni wrsRec wrsSto stoUni stoRec grace-os

mis

s ra

tio (

%)

MPGDec

concurrent

Page 24: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Conclusion

GRACE-OS– Energy-efficient soft real-time scheduler

Lessons– Effective for multimedia applications

Periodic with stable demand distribution

– Limited by few speed options

Future work– Extension to manage network bandwidth– GRACE http://rsim.cs.uiuc.edu/grace

Page 25: Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems

Backup s

peed

1

t 2t

deadline

E = p(1) x t = t

1/2

t 2t

deadline

E = p(1/2) x 2t = (1/2)3 x 2t = t/4

Power P(s) s3 Energy E(s) s2