Feedback Dynamic Voltage Scaling DVS-EDF Scheduling:
Correctness and PID-Feedback
Yifan Zhu and Frank Mueller
Department of Computer Science/Center for Embedded Systems Research
North Carolina State University,Raleigh, NC 27695-7534
[email protected], phone: +1.919.515.7889, fax: +1.919.515.7925
Abstract
Dynamivoltage saling(DVS)isa promising methodfor
embeddedsystemstoexploitmultiplevoltageandfrequeny
levelsand,subsequently,prolongbatterylife. Inthispaper,
wepresentanovelapproahusingDVStehnologyaswellas
feedbakontrolshemesonreal-timeembeddedsystemsto
ahievelowenergyonsumption.Ourmethodreliesstritly
onoperatingsystemsupportbyintegratingaDVSsheduler
andafeedbakontrolleronthebaseoftheEDFsheduling
algorithm. Contributionsofthisworkinlude(1)tehniques
for preemptionhandling, (2)a simple feedbak shemeas
wellas(3)aPIDfeedbaksheme,(4)aproofoforretness
and (5)an experimental evaluation. Experiments
demon-stratetheviabilityofourshemesfordierentsystem
work-loadswithvaryingexeutiontimes. Simplistiproportional
feedbakoutperformspriorworkonLook-aheadEDFbyup
to37%andisshowntoworkwellfortasksetswithonstant
exeutiontimes. For tasksetswithpreditablyutuating
exeutiontimes,thesimplefeedbakshemeisenhanedby
aPIDontrollerto adaptto dynamiallyhangingsystem
workloads. OurDVSshemeisdemonstratedtobenet
sig-niantlyfromPID-ontrolledfeedbakby ahieving upto
14%additional energysavings overthosewithoutthePID
feedbak sheme. The resulting energy onsumptionfrom
thePID feedbak shememaththeobservedpowerlevels
inonstant exeution timeases evenwhenthe atual
ex-eutiontimesdivergeas muhas 40%from theirWCET
betweendierentjobsofthesametask. Tothebestofour
knowledge, ourfeedbakDVS-EDFshedulingsheme
out-performspreviouslypublishedapproahesinitsabilityand
adaptivity to onserve energy, andit is provedto preserve
thefeasibilityofashedule.
1.
Introduction
Energyonsumptionisamajoronernforreal-time
em-beddedsystemsduetotheirlimitedbatterylifetime. Energy
saving tehniques usually prolong the battery life but, at
thesame,timeimpairsatisfationofthetimingonstraints
of the real-time appliations. Reent trends in embedded
hardwaresupportmultiplevoltageandlokfrequeny
set-tingsattheproessorlevel. Beausepowerdissipation ofa
CMOSiruitisproportionaltothelokfrequenyandto
thesquareofthevoltage[2℄,DVStehnologyisusedto
dy-namiallysale thevoltageandfrequenyofaproessorto
redueenergyonsumptionand ahieve anoptimal energy
management for embedded systems. Theobjetive of this
workistoexploitmaximumenergysavingthroughanovel
dynami voltage saling (DVS) tehnology ombined with
dierentfeedbakshemes.
SupportedinpartbyNSFgrantCCR-0208581.
Traditionally,shedulability theoryforreal-timesystems
reliesonaprioriknowledgeoftheworst-aseexeutiontime
(WCET)ofhardreal-timetaskstoguaranteethefeasibility
of a shedule. However, experiments show a wide
varia-tionbetweenlongestandshortestexeutiontimesformany
embedded appliations. In [16℄, exeution times of
real-worldembeddedtasks varyby asmuhas 87% relative to
their measuredWCET. Budgeting for theWCET may
re-sult inexessive energy onsumption even through atual
utilization levelsarelowomparedtotheworstase. DVS
anremedythisproblembyloweringfrequenieswhilestill
meetingdeadlines inhardreal-time shedules. Prior DVS
tehniques with real-time sheduling shemes have been
demonstratedtoobtain signiant energysavingsfor
time-onstrainedembeddedsystems[15,12,1,4,1,8℄.
Inthiswork, WCET maybe derivedbymeansof stati
timinganalysisorexperimentalassessmentwhileatual
ex-eutiontimeis measuredduringtask exeution. OurDVS
shemes apitalize the potential of savings dueto the
se-veredierenesbetweenWCETandatualexeutiontimes.
However,pureDVStehniquesdonotperformwellfor
dy-nami systems where the system workloads are hard to
model aurately. Feedbak ontrol tehniques have been
exploited by mapping ontrol theory methodology to
real-timesheduling inpriorworkto addressthatproblem[10,
11,14℄. Ourworkgoesbeyondthetehniquesinthese
previ-ousstudiesbyombiningfeedbakontrolshemesintothe
DVSshedulerforreal-timeembeddedsystems.Bothsimple
feedbakshemesand PIDfeedbakshemesare exploited
to makethe system adaptive to varying workloads aswell
as most realisti real-time appliation environments. Our
experimentsdemonstratethat theresulting energysavings
exeedthoseofthepreviouslypublishedwork.
2.
Energy-Aware EDF Scheduling
Energy-awareness funtionality an be integrated into
real-time embedded systems with dierent kinds of
real-timeshedulingpoliies. Wefousonearliestdeadlinerst
(EDF) sheduling [9℄, a dynami sheduling paradigm, to
inorporate energyawareness into the sheduling deision.
Dynamisheduling is usuallymoreexibleand adaptable
tosystemswheretheworkloadvariessigniantly,whihis
often the ase in real-time embedded systems with tasks'
atualexeutiontimesbeingmuhlessthantheirmeasured
WCET. The following periodi task model is used inthis
worktodesribevariousattributesoftheworkload:
T
i
:Thei
th
taskinatasksetT(1in). Eahtask
Tiisasequeneofjobs.
Pi: TheperiodofTi.
Ci: Themaximumomputationalbudget(worst-ase
ij
: Atualexeutiontimefor thej joboftaskT
i .
We assume relative deadlines oftasks equal totheir
pe-riod. Byalwaysshedulingthetaskwiththeearliest
dead-linerstinapreemptivefashion,asheduleisfeasible(i.e.,
none of itsdeadlines are missed)if and onlyif the
follow-ingneessaryand suÆientondition holds:
P n i=1
C i P
i
1:
Basedonthisresult,PillaiandShin[12℄extendedthisresult
toEDFwithDFSmodulation. Thefollowingshedulability
testwasexploitedin[12℄:
n X
i=1 Ci
Pi
(1)
where =
f i fm
denotes the salingfator representingthe
frationoftheurrentproessorfrequenyfioverthe
max-imumfrequeny fm. An optimal value anbe obtained
fromEquation1when
ij =C
i
. Oneofthe limitingfators
ofthisworkwasthatitonlyimplementsaninter-taskDVS
shemewhereanentiretaskwassaledtoexeuteataxed
frequeny. Sine atask's atual exeution time
ij is
un-known inadvane,the optimal value is also diÆult to
obtain. Theapproahproposedin[12℄alsolaks
adaptabil-itytodynamiallyhangingworkloads. Ourworkproposed
amore aggressive approah to redueenergy onsumption
asearlyaspossibleasdetailedinthenextsetion.
3.
DVS-EDF Scheduling
In the following, we develop a framework for greedily
shedulingreal-timetasksunderDFS/DVSand
guarantee-ing deadlines. Oneobjetive of ourapproahis to
aggres-sivelyandoptimistiallyredueenergyonsumptionasearly
aspossible. Aseondobjetiveistoexploittheexisting
in-voationsoftheshedulerduringexeutiontoperform
fre-quenysaling sothatDFS/DVSessentiallyomesforfree
(otherthanthealulation offrequenylevels). Thethird
objetiveistoutilizefeedbakmehanismsforseleting
ap-propriate salinglevels in order to redue the energy
on-sumptionfor taskompletionataertainsalinglevel. We
assumeaset ofperioditasks withknowndeadlines equal
totheirperiods. Ourapproahderivesatualexeution
sav-ingsfroma statiallyompiledworst-ase shedulefor the
hyperperiod. Theworst-ase sheduleis dynamially
om-paredtoatualexeutionstodeterminethelowestpossible
frequenysalinglevelswithoutmissingdeadlines.
AnoptimalshedulinganbeobtainedfromEquation1,
butthereisnowaytoknowinadvanetheoptimalvalueof
thesaling fatorinanunpreditableenvironmentwhere
eahtask'satualexeutiontimeisunknownuntilthetask
ompletes. The worst-ase exeution time of eah task is
generally less than its atual exeution time. Instead of
salingat auniformspeedfor alltasks, onlythefrequeny
oftheurrenttask(thetaskwiththeearliestdeadlineunder
EDF)issaled inoursheme. Allremainingtasksexeute
at the maximum frequeny f
m
with asaling fator of 1.
Hene,
1
Ck
P k
+
X
i2f1;:::;ngnfk g Ci
P i
1 (2)
The motivationof saling only the urrent task is that
agreedyshemeusuallyyields anear-optimalresult when
optimalsolutionsare infeasible dueto their omputational
overhead. The urrent task is always saled as muh as
possibletoahievealoalminimuminenergyonsumption.
Sinetheatualexeutiontimeofataskistypiallysmaller
thanitsWCETCi,theurrenttaskanstillnishearlyand
Inordertoobtainasalingfatorassmallaspossible,
we split eahtask T
k
into two subtasks T
A
and T
B
. The
orrespondingexeutiontimeisalsosplitintotwoparts:
Ck=CA+CB (3)
Whilegreedysaling isa DVS shemeonthe inter-task
level,task-splittingisaDVSshemeontheintra-tasklevel,
whih is expeted to result in an even lower energy
on-sumption. Inthe ideal ase,anenergy-optimal shedule is
obtained when eah task anbesplit into innitely many
smallpiees and whenvoltage salingours ontinuously
duringexeution. However,thisisunrealistisineboth
fre-quenyandvoltagehangesinuroverheadtosystemenergy
onsumption. Exess splitting inreases energy
onsump-tiontowhereitsoverheadosetsanysavings. Furthermore,
sineenergyonsumptionisproportionaltofrequeniesand
tothesquareofthevoltage,thelowestenergyonsumption
ours upona uniformfrequeny. This uniform frequeny
an be derivedas the minimumof a seond-order
polyno-mial(athird-orderpolynomialwhenonsideringvoltageas
a funtionof frequeny)uponperfet knowledgeof atual
exeution time. Sineatualexeutiontimes are generally
not known, we restrit the numberof frequeny and
volt-age hangesfor eahtask tobe nomore thantwo. While
TB alwaysexeutesatthemaximumfrequenylevelfm,TA
is able to exeuteat a lowerfrequeny levelthan it ould
withouttasksplitting. Ourshemeaimsatnishingatual
exeution within TA while reserving enoughtime inTB to
meet the deadlineif the WCET is exhibitedinfull. With
this sheme, we an safely sale the frequeny within T
A
using available slak while T
B
exeutes at maximum
fre-queny following alast-haneapproah[3℄. Letsk be the
slakpassedtoT
k
whenT
k
isreleased,then[5℄:
=
C A C
A
+s
k
(4)
Other methods, suh as idle time utilization and slak
passing,arealsousedinourshemetoahievealowenergy
onsumptionas detailedin[5℄. Bothshemes, onlybriey
outlinedhere,arebasedonaomparisonbetweentheatual
sheduleandtheworst-aseormaximalshedule,thelatter
being onstrutedstatially ahead of any exeution (or at
admissiontime). Thekeytoidleutilization istoreatean
idletask,whihinreasesutilizationunderWCETto100%
whileitsatualexeutionisalwayszero. Equation2triesto
exploitall availableidleslakfrom atask'sativatingtime
to itsdeadlineandusesit tosale thetaskat alowspeed
orrespondingto a low frequeny and voltage level in the
proessor. Byhoosingtheminimumperiodofalltasksfor
theidle task,slak inthemaximalshedulebeomes
avail-able early for saling other tasks with non-zero exeution
budgets. Slak passing is another tehnique that exploits
earlyompletionofataskbypassingtheunusedremianing
timetonexttask. Basedonthemaximalshedule,eligible
portions forslak passinganbedeterminedwhile
preserv-ingthefeasibleofashedule,andareaugmentedbyanyidle
slotsintheintervalbetweenreleasetimeanddeadline. The
slakfortheurrenttaskanbeomputedbythefollowing
equation:
S=S+idl e(d1:::d2) (idleslots) (5)
where S is the slak passed from the previous task and
idle(d1..d2)istheamountofidlebetweenthepreviousand
theurrenttask'sdeadline. Next,wedemonstratethat
re-3.1
Preemption Handling
Whenpreemptionours, thepreemptedtask will
relin-quishitsremainingslakandpassitontothenexttask,just
asitdoeswhenataskompletes. Itfollowsagreedysheme
inthatwetrytopassasmuhslakaspossibletosale
run-ningtasks and speulateonearlyompletion to aggregate
moreslak. Butthereare two diereneshere. First, the
preemptedtaskitselfannotgenerateanyslakbasedonits
ownexeutionatpreemptionpointssinetask'sompletion
timeisunknown. Hene,noadditional slakisaddedtoits
inheritedtotalslak. Seond,thepreemptedtaskstillneeds
sometimetoompleteitsexeutioninthefuture. The
re-mainingexeutiontimemustbereservedinadvanetoavoid
futuredeadlinemissesausedbyover-exploitingslakfrom
othertasks. Atthepreemptionpoint,theexpeted
remain-ingexeutiontimel eftij ofthepreemptedtaskis:
l eftij =Ci ij0 (6)
Ourslakpassingshemepromisesthatthepreemptedtask
willnotmissitsdeadlinebyreservingorrespondingslak:
S=S l eftij (future slots) (7)
Theold slakis derivedfrom Equation5andtheresulting
slakS anbepassedtothenexttask.
Future slot alloation in this manneris essential to
en-surethefeasibility ofthesheduleunderDVS.Futureslots
will be alloated only if the worst-ase shedule does not
inludesuÆientslotsforthepreemptedtask'sjobbetween
thepreemptionpointanditsdeadline. Wedevisedmultiple
shemesfor reservingtheseslots.
Forward sweep: When a task T1 is preempted and
requires l eft 1j
future slots, the preempting task T2
deduts this amount from its available slak S. If
l eft1j>S,thenT2remainswithoutslak. Ifanother
taskT3isinitiated, thealulationrepeatsitself.
Bakwardsweep: Future slots ofT1are alloated in
idleslotswithintheworst-aseshedulefromits
dead-line d1 bakwards. Any of these idle slots beome
unavailable for slak generation, i.e., these slots are
exludedinEquation5.
AnexampleisdepitedinFigure1. Theuppertimeline
of idle slots presents a exerpt of the worst-ase shedule
thatdepitsidletaskalloations, only. Thelowertimeline
showsthedynamisheduleoftasks. UponreleaseofT2at
t2,T1ispreempted. Let usassumethatT1doesnothave
suÆient stati slots (three slots) beyond t2 to nish its
exeution. Hene,ithastorelyonfutureidleslots. During
T2'sexeution,T3isreleased. BothT2andT3havesmaller
deadlinesthanT1(d2<d3<d1). Subsequently,T1 only
resumessometimeafterT3ompletes.
...
t1
t2
d2
d3
d1
idle
idle
idle
idle
idle
idle
idle
T2
T3
T1
preempted
T1
cont.
Fig. 1: FutureSlot Reservation
Future slot alloation of T1 then depends on the
ho-for T2andT3sineidle slotsduringthe tasks'periodsare
not suÆient to over T1's future needs of three slots at
the respetive invoation times. The bakward sweep, on
theotherhand,reservesthelast3idleslots(fromd1
bak-wards),suhthatT2andT3mayonsumeatleasttwoand
one idle slots for saling, respetively, evenif theyuse up
theirtimequantuminfull.
Overall,theforwardsweep isnotas greedyasthe
bak-wardsweepinthesensethatearliertasksmaynotbesaled
duetoT1'sfutureslots. Aforwardsweepislikelytoresult
inzeroslakforthepreemptingtaskT2ifP2<<P1,i.e.,if
itsperiodismuhshorter. Therearesimplyfeweridleslots
available,whihmaynotsuÆetooverT1'sfuture
require-ments. Moreidleslotspastd2willberequiredinthisase.
Thebakwardsweepalwaysresultsinthemostgreedy
ap-proahindelayingtheneedsofT1aslongaspossible. This
is onsistent with the observationthat earlyompletion is
likelytogenerateslakforeahtask,apropertyinherentto
our algorithm. Inthe following, we fous onanother key
issue,namelyonhowtohooseasuitablevalueforCA+CB
(0C
A
C
k
) togetasmallsalingfator. SineC
A is
based ontheestimatedworst-ase exeutiontime, the
ba-siobjetiveistoletCAapproximateTk'satualexeution
time
ij
sothattheatualexeutionofT
k
anbeompleted
at the low frequeny level orresponding to . Inthe
fol-lowing setions several feedbak shemes are desribed to
determinethevalueofC
A
inourDVSsheme.
4.
Proportional Feedback
Feedbakontrolisoneofthefundamentalmehanismfor
dynamisystemstoahieveequilibrium. Inafeedbak
sys-tem,somevariables,i.e.,ontrolledvariables,aremonitored
and measuredbythe feedbak ontrollerand omparedto
theirdesiredvalues,so-alledsetpoints. Thedierenes
(er-rors)betweentheontrolledvariablesandthesetpointsare
fedbaktotheontrollerforfurtherations. Corresponding
system statesare usuallyadjusted aording to the
dier-enestoletthesystemvariablesapproximatethesetpoints
asloselyaspossible.
Intheprevioussetion,westatedthattheeetivenessof
ourDVS-EDFshemedependsontheorretnessofthe
es-timationforCA,theexeutiontimeoftherstpartofatask
aftertasksplitting. IfC A
analwaysbeloseenoughtothe
atualexeutiontimeof thenextjobofthetaskij,there
isnoneedforthetasktoentertheseondsubtaskportion
and swithto themaximumsystem frequeny. Hene, the
entiretaskanexeuteatalowsystemfrequenysuhthat
anear-optimalenergyonsumptionanbeobtained. Sine
a task'satual exeution timetends tovary,alosed-loop
feedbakontrolbeomesanaturalhoietodeterminethe
valueforCA inoursheme.
Aording to the above objetive, we hoose the value
of C
A
as theontrolled variable while
ij
is hosen as the
set point. First, asimplefeedbak ontrol shemeis used
in our DVS-EDFalgorithm. CA is hosen as 50% of the
WCET for the rst instane of eah task. While half of
the task's exeution is budgeted at a low frequeny, half
of it isreservedat themaximumfrequeny. The taskan
still meet its deadline, evenif the worst ase is exhibited.
Initially,theenergyonsumptionmaybesigniantand is
likely todier from the optimalase due toinappropriate
estimations of the atual exeution time. Over time, we
utilized toantiipatefutureC A
portions. Onthe average,
thisshemeallows usto ompletethe entiretask's budget
at a low frequeny level, whih losely approximates the
optimalenergy-savingshedule. LetC
Aj
betheantiipated
CA value forthej
th
jobofatask. Wedenethe following
equationstoget theantiipatedC
A
valuefor jobj+1:
CA1=0:5WCET
C A(j+1)
= C
Aj
(j 1)+
ij j
;j1
(8)
Here, ij is the atual exeution time of the j
th job of
task T
i
. Eah time a job ompletes exeution, its atual
exeutiontimeisfedbakandaggregatedtoantiipatethe
nextjob's atual exeution time, whih is further used to
alulateanidealsalingfatorforthattask.
Althoughsuhasimplefeedbakshemeonlyonsidersa
puregainadjustmentovertheantiipatedCAvalue,
exper-imentsshowthatthisshemeworksquitewellfor real-time
tasksets where eah taskeither hasa onstant atual
ex-eutiontime or it has anexeution time varyingwithin a
smallboundedrange. Fortasksetswithhighlyutuating
exeution times, a more sophistiated feedbak sheme is
required,whihisdetailedinthenextsetion.
5.
PID Feedback Controller
Thesimplefeedbakshemedesribedintheprevious
se-tion follows a proportional adjustment of frequeny levels
relativetotheaverageexeutiontime. Inpratie,real-time
appliations,suhasmediadeoderorimageproessing
sys-tems, often experiene utuating exeution times over a
period of time. Theutuations may result intendenies
leadingtohigherproessingdemandsuptosomepointand
reedingdemandsafterthis peakpoint. Inorderto devise
aDVS-EDFalgorithmadaptivetosuhadynami
environ-ment,moresophistiatedfeedbakshemesare needed.
Past work in dynami real-time sheduling has
demon-stratedthatadaptivetehniquesderivedfromontroltheory
anenhane ashedulebyreatingto tendeniesin
exeu-tiontimeutuations[10℄. Theadaptivetehniques
gener-allyrelyonaPIDfeedbakontroller,whihiswidelyused
inengineeringareas. APIDontrolleronsistsofthree
dif-ferentelements,namely,proportionalontrol,integral
on-trol,andderivativeontrol. Proportionalontrolinuenes
thespeedofthesystemadaptingtoerrors,whihisdened
asthedierenebetweentheontrolledvariableandtheset
point,byapureproportionalgainitem. Integralontrolis
usedtoadjusttheaurayofthesystemthroughthe
intro-dutionofanintegrator onpast errorhistories. Derivative
ontrolusuallyinreasesthestabilityofthesystemthrough
theintrodutionofaderivativeoftheerrors. ThePID
feed-bakontrolleranbedesribedinthreemajor forms: the
ideal form, the disrete form and the parallel form.
Al-thoughthedisreteformisoftenusedindigitalalgorithms
tokeeptuningsimilarto eletroniontrollers, theparallel
formisthesimplestone,andtheintegralandderivative
a-tionsareindependentoftheproportionalgainintheparallel
form. We hoose thefollowing parallel formas thebaseof
ourPIDfeedbakimplementation:
output=Kp(t)+
1 I R
(t)dt+D
d(t) dt
(9)
whereK
p
;IandDaretheproportional,integraland
deriva-tiveoeÆients,respetively,and(t)isthesystemerror.
We integrated the above PID ontroller into our
DVS-EDFfeedbakshemetoontrolthesalinglevelinresponse
toreenttendenies inutuations. Asinthesimple
feed-bak sheme, westill hoose CA as the ontrolled variable
ij
trolledvariableandthesetpoint,i.e.,theerror,ismeasured
periodiallybythePIDontroller. Itsoutputisfedbakto
the DVS-EDF sheduler to adjust the value for CA. Let
C Aij
betheestimatedC
A
valueforthej th
jobofataskT i
.
The following disrete PID ontrol formula is used in our
DVS-EDFsheduler:
CAij=Kp(t)+
1 I
P IW
(t)+D
(t) (t DW)
DW C
Ai(j+1)
=C
Aij
+C
Aij
(10)
whereK
p
,IandDareproportional,integral,andderivative
oeÆients,respetively,and(t)=ij CAij isthe
moni-torederror. TheoutputCAijisfedbaktothesystemand
is usedto regulatethe nextantiipatedvalue for C
A
. IW
and DW are tunableparameterssuhthat onlytheerrors
fromthelast IW(andDW)taskjobswillbeonsideredin
theintegral(andderivative)term. WeuseDW =1tolimit
thehistory,whihensuresthatmultiplefeedbakorretions
donotaetoneanother. Detailsabouttuningthese
oeÆ-ientsandresultsarepresentedintheexperimentalsetion
to demonstratethebenetsof PID-ontrolledfeedbakfor
frequenysaling.
6.
Example
Combinningall thetehniquesillustratedabove,we now
turn to a desription of the entire algorithm. Our
algo-rithmstartswithanoineonstrutionofthestati
worst-ase EDFShedulewithintheintervalofthehyper-period.
Figure 2(i) shows an example of suh a stati worst-ase
EDFshedule. Allshedulingevents(inludingtaskrelease,
preemption,resumption,andompletion)oftheworst-ase
EDFsheduleare storedina look-up tableto reduetime
omplexity.
Next,the originaltask setis sheduledaording to our
algorithm (without the idle task), justas for regular EDF
sheduling. Additionaloperationstoalulateslak andto
set the CPU frequeny/voltage are inserted at sheduling
points. AsshowninFigure2(ii),whenthersttaskT(with
theearliestdeadline)isativatedattime0,itsinitialslakis
assignedaordingtoEquation5: S=S+idl e(d1::d2)=0+
idl e(0::dT). TheinitialSandd1issetto0sinenoprevious
taskhasbeensheduled. Thevalueofidl e(0::dT)isobtained
from thepre-alulated worst-ase EDFshedule. Then, a
frequenysalingfatoral phaissetaording toEquation
4: al pha=CA=(CA+S)(withCA=50%WCET,initially).
TheCPUfrequenyissettoal phaf
m
. Whenthersttask
ompletes, unused slak is adjusted and passed on to the
nexttask aording to Equations 6 and 7. Theestimated
100%
50%
75%
25%
5
10
15
20
25
30
t
0
T1
T2
T3
T1
T2
T1
T3
T2
T1
T2
I
I
I
I
I
I
I
2 idle for T1
1 idle for T2
(i)StatiWorst-CaseEDFShedulewithIdleTaskI
100%
50%
75%
25%
5
10
15
20
25
30
t
0
T2
T1
T3
T1
T2
T3
T1 T3
T1
T3
cont.
T2
2 idle
1 idle
1 slack
(ii)OurFeedbakDVSatBeginningof1stHyperperiod
foreahT k 2fT 1 ;T 2
;:::;T n gdo C Ak C k =2 l eft k 0 C k ti 0 U C 1 P 1 + C 2 P 2 +:::+ C n P n Pn+1 P1 C n+1 P 1 (1 U) n+1 0g
sl ak 0
ProedureTaskAtivation(T
ij )
if proessorwasidlefordthen
sl ak sl ak d
if T pk preempted/interrupted then l eft pk =Cp pk 0
sl ak sl ak idl e(d
ij ::d
pk )
if l eft pk
>sl ots(T pk ;now::d pk )then reserve pk l eft pk sl ots(T pk ;now::d pk ) alloatereserve pk in idl e(now::d pk
)+ompl eted(now::d
pk )
sl ak sl ak reserve
pk else(T
pk
ompl etedexeution)
if now>d pk
then
sl ak sl ak idl e(d
pk ;now)
sl ak sl ak+idl e(d
pk ::dij) 0 minf f 1 fm ;:::; f m fm j f i fm C Aij C Aij +slak g
if(0=1)then
C A 0 else C A
sl ak0=(1 0)
SetInterrupt(T i ;C A =0) SetFrequeny(0) ProedureTaskCompletion(T ij )
sl ak sl ak
ij +C i ij C Aij C Aij
Kp(t
i )+ 1 I P IW (t i )+ D (t i ) (t i DW) DW C Ai(j+1) =C Aij +C Aij
ti ti+1
l eft i(j+1) =C i ifreserve ij
>0then releaseidl e(now::d
ij )+ ompl eted(now::d
ij
)uptojreserve ij j ProedureSetInterrupt(T ij ;C A ) SettimerinterruptforT
ij ,
triggeredC
A
timeunitslater
ProedureSetFrequeny (0)
f 0fm
Fig. 3: Pseudoode ofFeedbakDVSSheme
value ofC
a
for the rst task is alsoupdated aording to
ourfeedbak sheme. Whenthe seond task issheduled,
itsslakisagaindeterminedbyEquation5,thistimewitha
non-zeroSontherighthandsideoftheequationiftherst
taskeverpassesanyunusedslaktoit. Itsfrequenysetting
levelisdeterminedinasimilarwayasthersttask.Forlater
taskinstanes, the feedbak shemehoosesaC
A
as lose
aspossibletothetasks'atualexeutiontimes. Hene,the
entire taskis saledat a low frequeny level. Preemption
handling,asdesribedinSetion3.1,isalsoappliedbutnot
shownheretosimplifytheexample.
AnalgorithmidesriptionofourDVS-EDFsheme
inte-grated withthePIDfeedbak ontrol isgiveninFigure 3.
Thisalgorithmisarenementofourpreviouswork[5℄and
reetsthePIDfeedbakshemeandpreemptionhandling
withfutureslotreservation. Weusethefollowingnotation:
T
ij
: thej-thjoboftaskT
i
ij;pk:indiesfortheurrentandprevioustasks
rela-tivetoT
ij
now: theurrenttime
rij: thereleasetimeofTij
d
ij
: thedeadlineofT
ij
Ci: theWCETofTi (withoutsaling)
ij
: theatualexeutiontimeofT
ij
up tonow(with
saling)
l eftij: theremainingWCETofTij (withoutsaling)
sl ak: systemurrentslak
idl e(t1::t2): the amount of idle slots between times
[t1,t2℄
ompl eted(t1::t2): slotsofalreadyompletedtasks
be-tweentimes[t1,t2℄
sl ots(T
ij
;t1::t2): theamountoftimeslotsreservedfor
Tij intheworstasebetweentimes[t1,t2℄
The eet of the PID feedbak sheme is shownin the
following example. Consider a task set of three tasks
T1=f12,32g, T2=f12,40g and T3=f4,65g where Ti =
fCi;PigdenotestaskTi'sworstaseexeutiontimeCiand
itsperiod P
i
. Theatualexeution times of dierent jobs
ofataskutuateaordingtoasineurvewithaminimal
valueof50%WCETandamaximalvalueof100%WCET.
Figure4(a)isasnapshotoftheDVS-EDFsheduleforthis
tasksetwithasimplefeedbaksheme. Figure4(b)depits
theDVS-EDFsheduleforthesametasksetusingfeedbak
withPIDparametersCP=0.9, CI=0.08andCI=0.1.
We anseefrom the guresthat the rstjob ofT3 and
theseondjobof T2 are sheduledto runatamuhlower
frequeny level in the PID feedbak shedule than in the
simplefeedbakshedule. TherstjobofT3withanatual
exeutiontimeof2.57startsattime524inthesimple
feed-baksheduleandattime520inthePIDfeedbakshedule.
Thesimplefeedbakshemeomputesanaverageexeution
time Cavg of3.09 for T3 aording to Equation 8,but the
PIDfeedbakshemedeterminesanaverageexeutiontime
of3.06forT3aordingtoEquation5,whihisaloser
ap-proximationtoT3's atualexeutiontime. Withtheloser
approximationofC
avg
,thePIDshedulerisabletosalethe
taskmoreaggressively thanthe simplefeedbaksheduler.
Similarly,thesimplefeedbakshemeanonlyomputean
averageexeutiontimeof5.26fortheseondjobofT
2
,whih
hasanatualexeutiontimeof7.07. ButthePIDfeedbak
shemeangetanatualexeutiontimeof6.76forit,whih
is againloser toT2'satualexeution time. These
exam-ples demonstrate the property of ourDVS-EDFsheduler
withthe PIDfeedbak shemethat thePIDsheduleran
result inhigherenergysavings thansimplefeedbakwhen
asystemexperienesutuatingtaskexeutiontimes.
7.
Correctness
Inthissetion,weshowtheorretnessofourDVS-EDF
algorithm,asstatedbythefollowingtheorem.
Theorem1 (Corretness). The feedbakDVS-EDF
algorithm results ina feasibleshedule for aset T of tasks
with periods equal to their relative deadlines if a feasible
sheduleexistsforTunderpreemptiveEDF.
SineT has feasible shedules under EDF, we onsider
onlythemaximalshedulehere,i.e.,thesheduleprodued
byEDFwhentheexeutiontimeofeverytask'sjobhasits
maximumvaluegivenby theWCET.Weallthe shedule
produedby ourDVS-EDFalgorithm the atual shedule,
100%
50%
75%
25%
480
500
520
540
Ca
Cb
T1
T2
T1
T3 T2
t
25%
50%
75%
100%
480
500
540
Ca
Cb
T1
T2
T1
T2
520
T3
t
(b) DVS−EDF Schedule with PID Feedback
(a) DVS−EDF Schedule with Simple Feedback
wheretheexeutiontimeofeverytask'sjobsmaybesaled. Lets i ands + i
betheabsolutestarttimesforT
i
aordingto
theatualandthemaximalsheduleofT,respetively. (We
usetheshortutofTitodenotesomej
th
jobTij oftaskTi
inthefollowing,andweomitindexjinothertermsaswell
to simplifythe notation.) Let si be the atual start time
ofT i
. Similarly,let f
i
and f
+ i
bethe absoluteompletion
timesofT
i
fortheatual/maximalshedule,respetively.
IntraditionalEDFsheduling,anyjob'satualstarttime
si is less thanor equal to its worst-ase start time inthe
maximal shedule. But this is no longer the ase in our
DVS-EDFshedule. Beause DVS-EDFmay sale ajob's
exeution timeto belarger thanits WCET value, ajob's
atual start time may be later than its start time in the
maximalshedule. Thenextexampleshows aasewherea
job'satualstarttimeexeedsitsworst-asestarttime.
ConsiderthetasksetinFigure5(a). Itsworst-ase
shed-ule with anidle task and itsatual shedule under
DVS-EDFareshowninFigure5(b)andFigure5(),respetively.
WhentaskT3's seondjob startsat time12 intheatual
shedule,itsabsolutedeadlineisat time18. Thereis only
one idle slot between time 12 and time 18, whih an be
usedtosaleT3 ata50%frequenylevel. SineT3'satual
exeutiontimeequalsitsworst-aseexeutiontime,itruns
for2timeunitsandendsattime14withanatual
exeu-tiontimeof2. WhenT4 startsexeutionattime14,ithas
beendelayed by onetimeunitrelativeto itsstart time in
theworst-aseshedule.
TaskT i WCETC i PeriodP i i r i
1 3ms 8ms 3ms 0ms
2 3ms 10ms 3ms 4ms
3 1ms 14ms 1ms 4ms
4 1ms 20ms 1ms 0ms
idle 1ms 5ms 1ms 0ms
(a)TaskSet
100%
50%
75%
25%
T1
t
0
5
10
12
13
14
15
20
T1
T1
T1
T2
T2
T3 T4
T2
T2
I
I
I
I
25%
50%
75%
100%
t
5
10
12
14 15
T1
T2
T1
T3
T4
20
(b) Worst−Case Schedule with Idle Task I
(c)Actual DVS−EDF Schedule
T4 is delayed!
Fig. 5: DelayedStart ofTasksduetoSaling
Proof
Letusreturntotheorretnessofouralgorithm. Inorderto
provethetheorem,wewillrstprovethefollowinglemma:
Lemma 1. The delay between a job's atual start time
and its start time in the maximal shedule is bounded in
feedbakDVS-EDFbythefollowinginequation:
s i s + i idl e(f + i 1 ;d i 1 )+ X T l 2[f + i 1 ;d i 1 ℄;d l >d i C l (11)
where idl e(f + i 1
;d i 1
) isthe length of allidle slots existing
between[f
+ i 1
;di 1℄inthemaximalshedule.C
l
isthe
worst-ase exeution time of jobslot Tl in the maximalshedule
with a priority lower than T
i
. f
i 1
and d
i 1
are the
om-pletion timeandabsolutedeadlineofjobT
i 1
,whihisthe
latestjobexeuted before Ti.
Proof: Inthe following proof, whena task's exeution
time is mentioned, we do not distinguish between a split
taskandanon-splittask.Thisisbeauseourtasksplitting
sheme, asstatedbyEquation3,doesnothangethetotal
exeutiontimeofatask'sjob. Whenataskissplitintotwo
parts(T A
andT
B
)runningatdierentfrequenylevels,their
totalexeutiontimestillequalstheoriginalexeutiontime
when the task is not split (ignoring DVS overhead). The
ratioofTA andTB isdeterminedbyourfeedbakshemes,
whihtriestokeepthetaskatthelowfrequenylevel(T
A )as
longaspossible. Butneitherthetasksplittingmethodnor
the feedbak shemes impatthetiming onstraintsof the
taskset. Hene,wedesribetaskpropertiesinthefollowing
proofwithoutmentioningtasksplittingorfeedbak.
First,thehighestpriorityjobalwaysstartsatitsrelease
timeinbothalgorithms. Hene,
si s
+ i
=0: (12)
Supposethatthei
th
highestpriorityjobssatisfythelemma.
We need to show that Ti+1, the (i+1)
th
highest priority
job in T, also satisfy the lemma. We only need to
on-sider the asewhere si+1 >s
+ i+1
,sinethis is where
DVS-EDF diverges from onventional EDF. Beause DVS-EDF
is priority driven, the only reason for T
i+1
to be delayed
is that some higher priority jobs are still running at time
s + i+1
. LetTi bethelatesthighpriorityjobexeutedbefore
T i+1
,and let T
i 1
be thelatest highpriority jobexeuted
before Ti in the atualshedule. Without loss of
general-ity, we assume that in the maximal shedule there are m
(m 0) idle slots and q (n 0) low priority job slot in
[f + i 1
;d i 1
℄,namelyI
1 ,I 2 ,...,I m and T l , T 2 ,...,T q
. We have
P m i=1
Ii=idl e(f + i 1
;di 1). Similarly,letI h
=idl e(di 1;d h
)
andIp=idl e(dh;di). ItispossiblethatTibepreemptedby
a highpriority jobduring itsexeution, as denotedby T
h
inFigure6. SinebothT
i 1
andT
h
haveprioritieshigher
thanTi,wehavedi di
1
and di dh. Wenote that at
times
+ i
inthemaximalshedule,allotherjobswith
priori-tieshigherthanT
i
musthaveompleted,and allother low
priority jobs will notbe sheduled beforef
+ i
. Onlynewly
releasedhighpriorityjobsanexeutein[s
+ i
,f + i
℄andmay
preemptT
i .
I2
Ip
di
I1
Ti ( cont.)
Tl
Ih
dh
f+i
t
di−1
s+i
Ti
Preempted
(b) Actual Schedule
Preempted
Ti−1
si
fi
Ti
Th
Ti ( cont.)
t
Ih
Ip
I1+I2+Tl
di
(a) Maximal Schedule
Th
Fig. 6: Transform MaximaltoAtual Shedule
LetEquation11be theindutionhypothesis. By
substi-tutingidl e(f + i 1 ;di 1 )with P m i=1
Ii,weanassumethatthe
following holdsfor the i
th
highestpriority jobof Ti inthe
atualsheduleproduedbyDVS-EDF(f. Figure6(b)):
si s + i m X i=1
Ii+Cl=idl e(f
+ i 1
;di 1)+
X T l 2[f + i 1 ;d i 1 ℄;d l >d i Cl (13)
Toprovethat thelemmais alsotruefor T
i+1
, we
trans-form the maximal shedule into the atual shedule
1 2 m T
l
bakwardtos
+ i
,andwemovetheorrespondingportion
of Ti forward. These transformations are legal sine idle
slotsanbemovedarbitrarilywithin[ri;di℄. Thehigh
pri-orityjobT
h
isleft untouhed,beauseT
h
alwayspreempts
Ti ats
+ h
inthe atualase,i.e., sh =s
+ h
. WhenTi is
pre-emptedattimes
h
,theforwardslakreservationshemein
DVS-EDFreservesC
i (s
h s
i
),theworst-aseremaining
exeution timeleft for Ti, from the slots T
l
;Im,...forward.
Thebakward slak reservationshemereservesthe above
amountoftimefromtheslotsI
p ;I
h
,...,bakward. Ineither
asewedenotethetotalexeutiontimeofreservedslotsby
CR. At times
+ h
,the frequenysalingdeisionismadefor
T h
. Theshedulerolletsall availableidle slotsand early
ompletionoflowpriorityjobslotsin[s + h
;d h
℄inthemaximal
sheduleexludinganyslotsreservedforfutureresumption
ofpreemptedtasks. Thenalamountofslakavailablefor
T h
equals to
P m i=2
I i
+I
h
+C
l C
R
. T
h
usesthe slakto
sale itself to a lower frequeny and voltage level. These
steps are equivalent to the transformations that move the
non-reserved portion of I
2 ,...,I
m ,I
h
and T
l
bakward and
movetheorrespondingportionofTiforward. Theresultis
showninFigure6(b). WhenTiresumesexeution,itanbe
saledagainexploitingslakfromtheidle slots(suhasI
p
inFigure6)orearly-ompletedtaskslotsbeforedi. Similar
transformationsapplywhenmovingIpbakwardandTi
for-ward. T
i
releasesallitsunusedslakwhenitompletesand
passesitontofollowingtasks. Althoughweonlyshowfour
idleslots andonelowpriorityjob slotinFigure6, we an
simplyrepeatthetransformationifmoreslotsexist. Exept
for the idle slots and earlyompletion of low-priority job
slots(highpriorityjobslotsannotbeusedas slak inany
ase),therearenootheraseswhere Ti willbemoved
for-wardandthusbedelayedduringtheabovetransformations.
Hene,thefollowing inequationholds:
fi f
+ i
idl e(f
+ i
;di) CR+
X
T l
2[f + i
;d i
℄;d l
>d i+1
Cl (14)
Beausedi di
1
and didh,theaforementioned
trans-formationsnevermoveT
i
forwardbeyondd
i
. Hene,T
i will
notmissitsdeadlineafterthesetransformations.Ifthestart
timeofTi+1isdelayedintheatualshedulebyTi,wehave:
s i+1
=f
i
ands
+ i+1
f
+ i
. Fromtheaboveequationweget:
si+1 s
+ i+1
fi f
+ i
idl e(f
+ i
;di)+ X
T l
2[f + i
;d i
℄;d l
>d i+1
Cl (15)
Hene,thelemmaholdsforT
i+1
. Thelemmaimpliesthat
theDVS-EDFalgorithmalwaysresultsinafeasibleshedule
aslongasafeasibleEDFsheduleexistssineeveryfeasible
EDFsheduleanbetransformedintoaDVS-EDFshedule
andnojobsmisstheirdeadlinesafterthesetransformations.
TheomplexityofouralgorithmisO(n)forntaskssine
attaskativationandompletion,thelengthofslotsinthe
maximalshedulefortheintervalbetweenreleasetimeand
deadlineoftheurrenttaskhavetobeassessed. Thenumber
ofslots inthisintervalis boundedby thenumberof tasks
sine only a onstant numberof jobs for eah task and a
onstantnumberofpreemptionsmayourinthisinterval.
8.
Experiments
Weevaluatetheperformane ofourfeedbak shemesin
asimulationenvironmentthatsupportsDVS-EDF
shedul-ing. Dierent task sets with the total utilization varying
from 0.1 to 1.0 with an inrement of 0.1 are used in the
equalstoitsperiod. Weassumethateahtask'sworst-ase
exeutiontime(WCET)isknownapriori,whihisusually
thease forhardreal-timesystems. Welet theatual
exe-utiontimeofeahtaskvaryinthreedierentways. Inthe
rstase, jobsofeahtaskhaveaonstant exeutiontime
for all itsjobs. Intheseond ase,eahjobhas arandom
atualexeutiontime. Allrandomizations utilizeanormal
distribution. This is expetedto be the worst ase for a
feedbakontrol system. Inthethirdase, eahjob's
exe-utiontimevariesaordingtoasineurve. Wehoosethe
sineurveworkloadbeauseitrepresentssomeofthe
pra-tialreal-timeappliations,suhasmultimediasystemsand
image proessingsystems,whosetaskexeutiontimes
usu-ally utuatewithin a boundedrange overtime. Inorder
tofurtherobservethebehavior ofthefeedbak sheme,we
also simulate the mode hanges representative for ontrol
systems. Thisisaomplishedbydynamiallyhangingthe
phase and amplitude of the sine urve for the atual
ex-eution times of jobs for the same task. Both the simple
feedbakshemeandthe PIDfeedbak shemeare applied
tothosedierenttasksetstoomparetheirimpatonthese
two shemes. We also implemented the Look-ahead DVS
algorithm byPillai andShin[12℄,albeitamodiedversion
sine the original algorithm may result indeadline misses
(seeAppendixfordetails). ThemodiedLook-ahead
algo-rithm is still the best dynami DVS sheduling algorithm
we know of. We provide dierent frequeny and voltage
settings and assume the proessor will sale to the lowest
frequeny level during idle timesine it is not realisti to
puta proessor into sleep modefor frequent taskreleases.
Werestritourselvesheretoreportresultsbasedonfour
fre-quenyandassoiatedvoltagesettings,asdepitedinTable
1. Thehoieofthefrequenyandvoltagelevels is
onsis-tentwithLook-aheadDVSwork[12℄aswellasexperimental
workwiththeStrongARM[13℄.
frequeny voltage
25% 2V
50% 3V
75% 4V
100% 5V
Tab. 1: Proessor Modelfor Saling
Powerlevelsarealulatedinourexperimentusinga
sim-plied approah as frequenyvol tage
2
time and
in-tegrated over time to obtain energy onsumption. Power
valuesfor maximalsalinglevels (withoutonsideration of
pratialdisretefrequenylevelsandtaskdeadlinemisses)
are also omputed asthe optimal value for the theoretial
lowerbounds.
8.1
Simple Feedback Scheme
Figure7omparestheenergyonsumptionofoursimple
feedbakshemewith theLook-ahead DVSsheme[12℄ as
wellastheoptimalase.
Eahtaskinstanehas aonstantatualexeution time
equal to 50% of itsworst-ase exeution time. The gure
shows that for low utilization our simplefeedbak sheme
resultsinenergyonsumptionlosetotheoptimalase. At
high utilization, oursimplefeedbaksheme stillprodues
ex-100000
200000
300000
400000
500000
600000
700000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Utilization
E
n
e
rg
y
cc==50%WCET
cc=sin(t) in [30%WCET, 70%WCET]
cc=sin(t) in [10%WCET, 90%WCET]
Fig. 8: Flutuating Times
100000
200000
300000
400000
500000
600000
700000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Utilization
E
n
e
rg
y
cc==50% WCET
cc=rand() in [30%WCET,70%WCET]
cc=rand() in [10%WCET, 90%WCET]
Fig. 9: RandomTimes
100000
200000
300000
400000
500000
600000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Utilization
E
n
e
rg
y
DVS-EDF, cc==50% WCET
DVS-EDF, cc=sin(t) in [10% WCET,
90%WCET]
Look-ahead
Fig. 10: PID=sin(t)10-90%wet
ases, our DVS-EDF sheme ahieves muh lower energy
onsumptionthantheLook-aheadDVSmethod,i.e.,upto
37%savingsoverLook-aheadshemeareobserved.
Theimpatofdynamiallyutuatingexeutiontimeson
oursimplefeedbakshemeisshowninFigures8and9.
Fig-ure8depitstheenergyonsumptionfor tasksetswith
a-tualexeutiontimesvaryingalongtwosineurves,onewith
anamplitudefrom 30%to 70% of their WCET,the other
withanamplitudefrom10%to90%oftheirWCET.The
en-ergyonsumptionresults produedbyDVS-EDFwiththe
simplefeedbak sheme for sine exeution times are
om-paredtotheresultsfortaskswithonstantexeutiontimes
equalto50%of theirWCET.Onewouldexpetthesetwo
resultsbelosetoeahothersinetheaverageamplitudeof
thesineurvesarealso50%ofWCET.ButFigure8shows
energyonsumption results for sine exeution times up to
25% larger than those for onstant exeution times. This
isnotquite surprisingbeause thesimplefeedbak sheme
onlyonsidersa proportional adjustment aording to the
averageexeutiontimehistory. Itannotadapttovariable
exeution times as well as it does for onstant exeution
times. Figure9showsanothersetofexperimentsperformed
ontaskswithrandomlyhangingexeutiontimes. Foreah
job,itsatualexeutiontimeisgeneratedrandomlywithin
aspeirange. Theutuatingamplitudevariesasinthe
previoustests. Theaverageexeution timefor eahtaskis
still50%oftheWCET.Similarresultsareobservedasinthe
sineexeution timeexperiment. Moreenergyis onsumed
0
100000
200000
300000
400000
500000
600000
700000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Utilization
E
n
e
rg
y
Look-ahead
DVS-EDF with Simple Feedback
Optimal
Fig. 7: Energy for=50%ofWCET
onrandomtasksetsthanononstantexeutiontimetasks.
These three experimentsshow that the simplefeedbak
sheme anhandle the onstant exeution time tasks well
resulting inenergysavings up to 37% overprevious work.
Oneshortomingisthatitdoesnotadaptaswelltovariable
exeutiontimes. Asimplelinearfeedbakshemeisusually
notsuitableinadynamiallyhangingenvironment.
Ina-urateestimations of CA ausemore jobsto engage in
ex-eutingtheir seondsubtaskwiththe maximumfrequeny
level. WewillshowinthefollowingexperimentshowaPID
feedbakshemeoveromesthisshortoming.
8.2
PID Feedback Scheme
InordertoevaluatetheeetofthePIDfeedbaksheme
on pratial real-time workloads, we implemented a PID
feedbakontrollerintheDVS-EDFsimulationenvironment
and testeddierent kindoftasksetswith10tasks ineah
taskset. Figure10showstheenergyonsumptionforatask
setwithasineexeutiontimedistributionutuatingfrom
10% to90%of itsWCET.Inordertomakeaomparison,
theenergyonsumptionfor tasksets(withonstantatual
exeutiontimesequalto50%oftheWCETunderboththe
DVS-EDF sheme and the Look-ahead DVS sheme) are
alsodepitedinFigure10. Weexpetthattheenergy
on-sumption produed for the dynami workloads belose to
theresults foronstantworkloadsaslong astheyhavethe
sameaverage atualexeutiontimes. ThePID oeÆients
ofthesineexeutiontimetasksetaretunedmanuallyforit
asKp=0:9,I =0:08, D=0:1,IW =10andDW =1. It
isobservedthat eitherinreasingordereasingthe
propor-tional oeÆientprodueslessauratesystemestimations
for CA. Thederivativeitemislesssigniantompared to
the other two parameters. The derivative window size is
hosentobe1,andtheintegralwindowsizeishosentobe
10. Inreasingtheintegralwindowsizeimprovestheenergy
savingeetinthe verybeginning,butwhenIW beomes
larger than10, no dramati system performane
improve-mentsareobserved.
InFigure10, we seethatthePID feedbak fortasksets
withsinedistributedexeutiontimeresultsinlowerenergy
onsumption than the Look-ahead DVS for all utilization
levels. ThemaximumofenergysavingovertheLook-ahead
sheme,upto30%,isobservedatthe40%utilizationpoint.
Althoughthetasksetshavedynamiallyutuatingatual
exeution times, theDVS-EDFshemewith PIDfeedbak
resultsinslightlyhigherenergyonsumptionthantasksets
withonstantexeutiontime. Thisisasigniant
100000
200000
300000
400000
500000
600000
700000
800000
900000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Utilization
E
n
e
rg
y
DVS-EDF,cc==75% WCET
DVS-EDF, cc=sin(t) in
[50%WCET, 100%WCET]
Look-ahead
Fig. 11: =sin(t)50%..100% wet
0
100000
200000
300000
400000
500000
600000
700000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Utilization
E
n
e
rg
y
cc==50% WCET
Mode Changed every 10 jobs
Mode Changed every 2 jobs
Fig. 12: PID sin(t)..sin(3t) 10-90%
and 30-70% wet
100000
200000
300000
400000
500000
600000
700000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Utilization
E
n
e
rg
y
cc==50% WCET
cc=rand() in [10%WCET, 90%WCET]
Fig. 13: PIDw/ RandomTimes
times(stillalongasineurve)toasmallerrangefrom50%
to100% oftheWCET withanaverage of75%WCET (as
showninFigure11),PIDfeedbakgivesusenergy
onsump-tionsevenlosertothosefor the onstantexeution times
tasksets. At50%utilization,thePIDfeedbaksheme
on-sumes even less energy than the onstant exeution time
taskset. Thisanbeattributedtotheadaptivenessofthe
PIDontrollerwhenmathingidealsalinglevelsandthe
atual
0
levelssupportedbyanarhiteture.
We further onstruted task sets with modehange
be-havior, whihis often observedin realontrol systems,by
dynamially hanging the phase of the sine urve for the
tasks' atualexeution times. Figure12shows the energy
onsumption results with PID feedbak for two of these
tasksetswhosemodesalternatebetweensin(t)andsin(3t).
Theiramplitudehangesbetween[10%WCET,90%WCET℄
and[30%WCET,70%WCET℄.Thersttasksethangesits
modeevery10thjob,while theseondtasksethangesits
modeeveryseondjob.Theenergyonsumptionresultsfor
onstantexeutiontimetasksetarealsodepitedinFigure
12for omparison. We seethat our PIDfeedbak sheme
stilltraksthedynamiexeutionbehavioroftasksetswell
as long as themode hange does notour too frequently
withinaPIDfeedbakwindow,whihistheasefortherst
tasksetwhosemodehangesevery10thjob. Itproduesa
shedulewithanenergyonsumptionlosetotheonstant
exeutiontimease. Onlywhenthemodehange happens
too frequentlywithin thePID window,as the seondtask
setshowsinFigure13,willourPIDfeedbakontrollerfail
toobtainusefulinformationaboutthetasks'pastexeution
times. Hene, we may observe high energy onsumption.
Thisdemonstratesthelimitationoffeedbakingeneral.
ThelimitsofthePIDfeedbakshemeareobservedinan
extremease,whereweapplyPIDfeedbakontrolontask
setswithrandomlydistributedexeutiontimesbetween10%
and90%oftheirWCETwithanaverageof50%WCET.As
shown inFigure 13, PID feedbak produes no additional
benetsfortherandomexeutiontimetasksetsandresults
inhigh energyonsumption omparedto the onstant
ex-eution time ases. Randomly distributed exeution time
annotprovide any useful historyinformation to the PID
ontroller to adjust the shedulerfor the exeution of the
nextjobofatask. Onlywhenthetasks' behaviorpresents
someontinuedtendeniesoveraperiodoftimeanthePID
feedbakshemeprovidebenetsintheestimationexeution
timesforfuturejobs.
Overall,ourFeedbakDVS-EDFalgorithmahievesalow
energy onsumption level for dierent workloads and
ex-hibits onsiderable energy savings not only for ideal
envi-ronments but also for most realisti senarios. Our
pre-viouswork[5℄hasshownthatDVS-EDFalgorithm
outper-formsLook-aheadDVS[12℄inidealenvironmentswheretask
sets haveonstant exeution times. Ourexperiments here
demonstratethattheseresultsstill holdfor future
reserva-tionduringpreemption. TheyalsoshowthatPIDfeedbak
ontrolinonjuntionwithourDVS-EDFshememakesthe
sheduler more adaptive to dynamially hanging system
workloads. Experiments approximate the optimal energy
onsumptionlevelsmoreloselythanlessadaptiveshemes.
9.
Related Work
Therehavebeenanumberofeortsforapplyingfeedbak
tehniques into general-purpose ontrol systems. Butonly
reentlydidresearhersbegin toinorporatefeedbak
on-trol toreal-timeshedulerwithtimingonstraints[10,11℄.
Lu at al. proposed a feedbak ontrol real-time
shedul-ingframeworkforunpreditabledynamireal-timesystems
wheretaskexeutiontimesdivergefromtheworstase[11℄.
Real-time system performane speiations are analyzed
andsatised systematiallythroughaontrol theory-based
methodology. Dynami models of real-time systems are
developed, whih an identify dierent ategories of
real-timeappliationswithdierentfeedbakontrolalgorithms.
While their feedbak ontrol frameworkis mainly used to
satisfyreal-timesystemrequirements,ouralgorithmfouses
onexploitingfeedbakontrolshemestoredueenergy
on-sumptioninembeddedsystems.
Our work is more losely related to that desribed in
[11, 14℄. Lu et al. desribe a formal feedbak ontrol
al-gorithmombinedwithdynami voltage/frequenysaling
tehnologies for multimediasystems [11℄. Bothontinuous
and disreteDVS settingsare exploitedinashemeto
re-dueenergyonsumptionwhile stillguaranteeingreal-time
requirements. Anadaptiveset-point isusedtoahievefast
responseswith astable multimediathroughput. Although
their work and our approah exploit feedbak ontrol to
DVS/DFStehnologies,theirworktargetssoftreal-time
re-quirements,e.g.,formultimediasystems.Ourworkfouses
on hard real-time systems where timing onstraints must
notbeviolated.
Ageneralenergymanagementshemewithfeedbak
on-trol was proposedbyMinerik at al. [14℄. Anaverage
en-ergyusageisahievedbyontinuouslyadjustingthepower
settingonthehardwarearhiteturetomeettheenergy
on-sumption goal. A PI (proportionaland integral) feedbak
tainlowenergy onsumptionfor general purpose systems,
ourworktargetsreal-timesystemstoexploitenergysaving
potentials throughdierentfeedbakontrolshemes.
Other approahes relatedto ourDVSshemeare [12, 1,
6℄. Pillai and Shin proposed a set of dynami DVS
al-gorithms based ontraditional hard real-time mehanisms,
namelyrate-monotone(RM)sheduling andEDF
shedul-ing [12℄. They extend the shedulability test of RM and
EDFalgorithmstoinorporateCPUfrequenysaling.
Un-likeouralgorithmthatappliesfrequenysalingtoonlythe
urrenttask,theyassumethesamefrequenysalingfator
uponalltasksinareal-timetaskset. Intheirmost
aggres-sivevariant,alook-aheadtehniqueisusedtoahieve
exten-siveenergysavings by deferring asmuhworkas possible.
However,thefrequenyvalueobtainedintheiralgorithmis
notalwaysthelowestpossiblefrequenyforasingletask,as
omparisonswiththeoptimalaseandwithourworkshow.
Otheraggressivereal-timeDVSshemesspeulateonand
exploitearlyompletionoftaskexeutionsbasedon
statis-tialinformation abouttheworkloadfor dynami
shedul-ing [1℄ and stati priority sheduling [6℄. Our sheme
adapts even to dynamially hanging exeution demands,
not juststatistial information, dueto its feedbak
meh-anism, whih is shown to be most eetive for dynami
sheduling. Theidea of derivingafeasible dual-levelDVS
shedule from anideal ase was rst proposed by Gruian
[6, 7℄. It ombineso-lineand on-linesheduling, bothat
tasklevelandtask-setlevel. Stohasti datais usedto
de-rive energy-eÆient shedules. We use a dierent method
bysplittingataskintotwo partsand alwaysassigning the
highest frequeny to the seond part. Our algorithm
fo-usesondynamisheduling (EDF)while Gruian restrits
hisapproahtoxed-priorityshemes. Last-hane
shedul-ing algorithmswithoutenergy onsiderations goesbak at
leastto Chetto and Chetto [3℄. We apply this philosophy
inaDVSontextbutnot tothe entiretask, we developa
novelvariantbasedontasksplittingwithexatlytwoparts.
Asdisussed inthe motivation, the dual-subtaskapproah
isoptimal(duetotheseond/thirdorderpolynomialofthe
energyonsumptionasa funtionoffrequeny)iftherst
subtaskisfullyutilizedwhiletheseondsubtasknever
exe-utes. Ourfeedbakapproahtriggersthisbehavior,whih
is superiorto Gruian's step-wiseinreaseof frequenies in
thestohastiapproah.
PastDVSshemeswerebasedonearlyompletionoftasks
and idle time up to the next task's ativation. Statially
ompiledworst-aseshedules(termthealpha-queue)were
usedto quantifythesesavings tothe dynamishedule by
Aydinet al. [1℄. Ourworkexploits not justtheidle prior
to the next task's ativation but any idle time up to the
deadlineofthetaskfromthestatiworst-aseshedule. In
addition,an\idletask"providesguaranteesonslak
gener-ationforsaling thatexeedthoseofpriorwork.
10.
Conclusion
This paper presents a novel sheduling approah
om-biningDFS/DVS with dierent feedbak ontrol shemes,
whihextendsEDFinamostaggressivemanner. The
teh-niquereliesstritlyonoperatingsystem supportto
imple-mentboththe real-timeshedulerandfeedbakontroller.
Our ontributions inlude tehniques for preemption
han-dling, feedbak ontrol and a proof of orretness of the
withvaryingexeutiontimes. Simplistiproportional
feed-bakisshowntoworkwellforonstantexeutiontimetask
sets. For preditablyutuating exeution time task sets,
simple feedbak is enhaned by a PID-ontroller to adapt
to dynamially hangingsystem workloads. The feedbak
DVSshedulingshemeprovides upto37%additional
sav-ingsoverpriorpublishedworkombinedwithlow runtime
omplexity,andthe approahsalesfor varyingnumberof
tasks. Itssupportfor PID-ontrolledfeedbakis shown to
resultinanadditional30%energysavingsevenwhen
exeu-tiontimesdiverge asmuhas40%fromtheirWCET
be-tweenjobsofthesametask,whihisaommonlyobserved
behavior in embedded ontrol systems. Overall, the
feed-bakDVS shemeisthe mostaggressive dynami
shedul-ingapproahtoonserveenergythroughDVS/DFSforhard
real-timesystemsthatweknowof.
Acknowledgments
Ajay Dudani ontributed towards our early work on the
Feedbak-DVS sheme [5℄. Problems in the Look-ahead
DVS-EDF algorithm were disovered togetherwith Harini
RamaprasadandSibinMohan.
11.
REFERENCES
[1℄ H.Aydin,R.Melhem,D.Mosse,and
P.Mejia-Alvarez.Dynamiandagressivesheduling
tehniquesforpower-awarereal-timesystems.In
IEEE Real-TimeSystemsSymposium,Deember2001.
[2℄ A.P.Chandrakasan,S.Sheng,andR.W.Brodersen.
Low-powermosdigitaldesign.InIEEEJournalof
Solid-StateCiruits,Vol.27,pp.473-484.,April,1992.
[3℄ H.ChettoandM.Chetto.Someresultsoftheearliest
deadlineshedulingalgorithm.IEEETransations on
Software Engineering,15(10):1261{1269, Otober
1989.
[4℄ J.KimD.ShinandS.Lee.Intra-taskvoltage
shedulingforlow-energyhardreal-timeappliations.
InIEEEDesignandTest ofComputers,Marh2001.
[5℄ A.Dudani,F.Mueller,andY.Zhu.Energy-onserving
feedbakedfshedulingforembeddedsystemswith
real-timeonstraints.InACMSIGPLAN Joint
Conferene Languages,Compilers,andToolsfor
EmbeddedSystems(LCTES'02)andSoftwareand
CompilersforEmbeddedSystems(SCOPES'02),pages
213{222,June2002.
[6℄ F.Gruian.Hardreal-timeshedulingforlowenergy
usingstohasti dataanddvsproessors. In
ProeedingsoftheInternationalSymposiumon
Low-PowerEletronisandDesignISLPED'01,Aug
2001.
[7℄ F.GruianandKuhinski.Lenes: taskshedulingfor
low-energysystemsusingvariablevoltageproessors.
InProeedings ofASP-DAC,2001.
[8℄ D. Kang,S.Crago,andJ.Suh.Afastresoure
synthesistehniqueforenergy-eÆientreal-time
systems.InIEEEReal-TimeSystemsSymposium,
Deember2002.
[9℄ C.LiuandJ.Layland.Shedulingalgorithmsfor
multiprogramminginahard-real-timeenvironment.J.
of theAssoiation forComputingMahinery,
20(1):46{61, January1973.
Deember1999.
[11℄ Z.Lu,J.Hein,M.Humphrey,M.Stan,J.Lah,and
K.Skadron.Control-theoretidynamifrequenyand
voltagesalingformultimediaworkloads.In
InternationalConfereneonCompilers,Arhitetures,
andSynthesisfor EmbeddedSystems, pages156{63,
2002.
[12℄ P.PillaiandK.Shin.Real-timedynamivoltage
salingforlow-powerembeddedoperatingsystems.In
SymposiumonOperatingSystemsPriniples,2001.
[13℄ J.Pouwelse,K.Langendoen,andH.Sips.Dynami
voltagesalingonalow-powermiroproessor,2000.
[14℄ V.W.FreehR.MinerikandP.M.Kogge.Dynami
powermanagementusingfeedbak.InInProeedings
ofWorkshoponCompilersandOperatingSystemsfor
LowPower,2002.
[15℄ Y.Shin,K.Choi,andT.Sakurai. Poweroptimization
ofreal-timeembeddedsystemsonvariablespeed
proessors. InInt'lConf.onComputer-Aided Design,
2000.
[16℄ J.WegenerandF.Mueller.Aomparisonofstati
analysisandevolutionarytestingfortheveriationof
timingonstraints.Real-TimeSystems, 21(3):241{268,
November2001.
[17℄ Y.ZhuandF.Mueller.Preemptionhandlingand
salabilityoffeedbakdvs-edf.InWorkshopon
CompilersandOperatingSystemsforLowPower,
September2002.
Modified Look-ahead DVS-EDF
AnumberofDVSshemeswereproposedbyPillaiandShin
forsheduling hardreal-timesystems[12℄. Asimple,stati
saling version uniformlysalesthe frequeny for all tasks
basedon utilization testsfor shedulability, both for
rate-monotoneandEDFsheduling. Cyle-onservingEDF
low-ersutilizationupontaskompletiontemporarilytothe
pro-portionoftheatualexeutiontime.Look-aheadEDFisan
extensiontotheseshemethatapitalizesonearlytask
om-pletionbydeferringworkforfuturetasksinfavorofsaling
theurrenttask. Saling of theurrent task ours based
ona modiedutilization test that benetsfrom both idle
slotsand earlytask ompletion. At any ompletion (both
earlyandontime),theutilizationis eetivelyreduedfor
theompletingtask(upuntilitsnextreleasetime).
Speially,upontask ompletion,i=l eft1 =0
a-ordingtoCyle-ConservingEDFandLook-aheadEDF,
re-spetively. Thedeferalulations ofLook-aheadEDFthen
reassessestheutilizationbasedonfutureandpastdeadlines
forreleasedandompletedtasks,respetively.
WemodiedtheLook-aheadEDFbysettingl efti=Ci
attaskompletioninsteadofassigningazero value. In
ad-dition,wereassesstheutilizationstritly basedonthenext
deadlineinthefuture, irregardlessof whethertasksare
al-readyreleasedand not. This allowsus tolook aheadeven
further in the shedule and, thereby, potentially save
ad-ditional energy by lowering frequenies more aggressively,
anditretainsthe safetyoftheshedule byadheringtothe
EDFutilizationtest. IftheWCETisnotfullyutilized,then
othertasksmaystillbenetfromearlyompletionuptothe
thresholdgivenbytheidletimes leftintheshedule. This
modiedLook-aheadEDFshemewas implementedinour
modiedshemesavesanadditional5-11%ofenergyfor
uti-lizationsbetween25% and100%. At highutilizations, our
modiationoasionallyrequiresbetween0.5-8%more
en-ergy,whihisduetoonsideringanatualtimeof
i
=0in
theoriginalshemeuptothenextreleaseofatask. Hene,it
wouldbepossibletoswithbetweenthetwoshemesbased
on autilization threshold as a trigger. Additional savings
overthemodiedshemeduetoearlyompletionanonly
beobtainedbyonsideringthedensityofasheduleatsome
instaneintime,suhasgivenbythemaximalshedule