Power Low Modfed Dual Prorty n Hard Real Tme Systems wth Resource Requrements M.Angels Moncusí, Alex Arenas {amoncus,aarenas}@etse.urv.es Dpt d'engnyera Informàtca Matemàtques Unverstat Rovra Vrgl Campus Sescelades, Av dels Països Catalans, 26 E-437 Tarragona, Span Jesus Labarta jesus@ac.upc.es Dpt d Arqutectura de Computadors Unverstat Poltècnca de Catalunya Jord Grona, -3. D6 Campus Nord 834 Barcelona, Span Abstract We present an extenson of the Power Low Modfed Dual Prorty schedulng algorthm that allows hard real system to use shared resources wthout compromsng the tmng constrants of the applcatons whle keepng a low energy consumpton. We compare the energy savng of our algorthm wth a modfcaton of the Low Power Fxed Prorty algorthm that uses shared resources. The results n a Computerzed Numercal Control case study shown that the presented algorthm mproves LPFPSR energy savng. The total energy savng s closely related to the consumpton of the Worst Case Executon Tme (), the savng ranges from the 6% of the energy when the % of the s consumed, to the 98% of the energy when the % of the s consumed.. Introducton Real systems are often located n envronments where low energy consumpton s crucal from the operablty and lfelong of the systems pont of vew. A lot of efforts have been made durng the last decade to mnmze the power consumpton at dfferent levels of the desgn of real- systems rangng from sem-conductor level (the logc gate level and the chpset archtecture) [,2] to the operatng system and complaton level [3,4,5 and references theren]. The most powerful power aware technque nowadays, conssts n to reduce the clock along wth the voltage supply (Dynamc voltage scalng DVS) or even power down the processor whenever the system does not requre ts maxmum performance [5-8]. At the operatng system level, one of the most promsng approaches to save energy s the use of schedulng to perform correct DVS, especally when the constrants of hard real system must be consdered. Takng advantage of the dle of the processor due to the schedulng of task to reduce the has been shown to save sgnfcant amounts of energy [5,6,8,9]. Moreover, the schedulng technques n power savng have been studed n the off-lne and on-lne scenaros. In the frst the schedulng algorthm generates a pror a calendar and calculates clock s, after that, durng run the scheduler follows the marked steps [3]. In the onlne schedulng, the decson of whch task executes and the clock s run- determned [8,9]. However, n all these studes the framework usually gnores the specfcty of many real systems that use shared resources. In these systems tasks are not ndependent snce they nteract wth each other by sharng resources such as data or devces, and the schedulng becomes more complcated. To ensure consstency of these sharng resources, mutual excluson among compettve tasks must be guaranteed (the pece of code executed under mutual excluson constrant s called a crtcal secton). When usng prorty-drven polces to schedule ths real- task sets wth shared resources, we must cope wth the prorty nverson problem [] that occurs when a hgh prorty task s forced to wat for the executon of lower prorty task to preserve mutual excluson n a resource. Ths hgh prorty task s blocked untl the low prorty task releases the mentoned resource. Besdes, the determnaton of the worst blocked s not straghtforward because other tasks could pre-empt the task that holds the resource. So, the prorty nverson problem leads to unbounded worst case response that adversely affects the predctablty of the hard real system. A mechansm to coordnate the access to shared resources n fxed prorty schedulng reducng the prorty nverson problem consst n to use protocols that change the prorty of the tasks accordng wth the access to shared resources. For example, the Prorty Inhertance protocol [] forces the task that holds the resource to nhert the prorty of the hgher prorty task that wants to allocate the resource. Ths protocol bounds the worst blockng, but f a hgh prorty task uses several resources, t can be unfortunately blocked for every resource, ths phenomenon s know as channg blockng. To solve ths problem one can use the Prorty Celng protocol [], ths protocol avods deadlocks and chaned blockng.e. each nstance of each task only can be blocked once durng all ts executon. Ths behavor s obtaned by ncreasng the prorty of the current task to the hghest prorty of the tasks that want to allocate ths resource durng ts lfe (ths prorty s defned as the celng of the resource). In the present work we embedded the Prorty Celng protocol [] n two dfferent schedulng algorthms desgned to save energy. We wll present a comparson of the results obtaned wth the Low Power Fxed Prorty 8 -
Schedulng LPFPS proposed by Shn et al [8] wth shared resources versus the Power Low Modfed Dual Prorty Schedulng [9] wth shared resources. The power effcency of these two algorthms reles n to run the tasks at the lowest that makes possble that the actve task and the rest of tasks meet ther tmng constrants, and power-down the processor when there s a large enough dle nterval. Ths approach s especally nterestng because the quadratc dependency of the power dsspaton, n CMOS crcuts, on the voltage supply []. The power dsspaton satsfes approxmately the formula P p C t where p t s the probablty of swtchng n power transton, C L s the loadng capactance, V dd the voltage supply and f clk the clock frequency. That means that t s always energetcally favorable to perform slowly and at low voltage than quckly at hgh voltage. The rest of ths paper s organzed as follows, n the next secton we descrbe the framework and the basc deas of the Prorty Celng protocol. Secton 3 s devoted to the modfcaton of the algorthm to use shared resources reducng the energy consumpton. Fnally, n secton 4 we present the expermental results and the comparson wth Low Power Fxed Prorty schedulng wth Prorty Celng protocol, and fnally n secton 5 we draw the conclusons. 2. Framework and Prorty Celng protocol The general framework of the hard real- system we are gong to deal wth s made up of perodc tasks. These tasks numbered n are specfed by ther perods, worst case executon s and deadlnes (T, C and D respectvely). The use of shared resources mples that the tasks have crtcal sectons that could be smulated by atomc subtasks. Followng ths lne, these perodc tasks are dvded conceptually pre-run nto subtasks numbered j s wth the same perod T and deadlne D that the perodc task, but dfferent worst case executon C j assurng that ΣC j = C. Some of these subtasks can use shared resources durng all ther executon. Note that the proposed partton n subtasks of the real tasks s performed only at the logcal level of abstracton to deal wth the present problem theoretcally, ths partton has no mplcatons at the physcal level of the mplementaton. Once the problem wll be conceptually solved the mplementaton of the algorthms wll work perfectly wthout affectng the structure of the real tasks. The decomposton of every task n subtasks has been performed as follows: suppose that we have a task T wth a perod T=24 unts and a deadlne D=2 unts, a worst case executon of 7 unts and a prorty P=5 (the lower the number, the hgher prorty). We assume the executon of the worst case executon and, that task T, needs to access a shared resource R durng 4 unts after The results are not exclusve for perodc tasks. We have consdered only perodc tasks as a matter of smplcty. L V 2 dd f clk executng 2 unts and then releases the resource untl the next nstance. See Fgure. T P=5 C=2 T2 P=3 C=4 T3 P=5 C= T P=5 C=7 T=24, D=2 Allocate R Release R R P = 3 Fgure : Example of the dvson of one task nto subtasks. Task T wll be conceptually dvded nto three subtasks wth the followng characterzaton: same perod and deadlne as task T. The frst subtask T wll have a of 2 that corresponds to the executon before allocatng the resource. T 2 wll have a equal to 4, the executon nsde the resource (crtcal secton) and fnally the thrd subtask T 3 wll have a of, that corresponds to the rest of executon outsde the resource. To ensure the causal precedence, as soon as T fnshes t sends a message to provoke the ntaton of T 2. Once T 2 allocates the resource R ncreases ts prorty to the prorty of ths resource (we wll see later how t s determned), t executes, t releases the resource, and t sends a message to provoke the ntaton of T 3 and fnsh. At ths moment T 3 starts to execute normally. Ths process has been reproduced for every task n the task set. We assume that the messages are nstantaneous for the sake of smplcty. The computaton s for context swtchng and for the scheduler are assumed to be neglgble, ths enables us to perform the analyss straghtforward wthout danger of loosng generalty. The extent to whch these assumptons are realstc s dscussed n the analyss of the algorthm gven n [7], and t turns out to be practcal f the swtch s subsumed to the worst case executon s of the dfferent tasks. The whole system s organzed as concurrent tasks ruled by a pre-emptve statc prorty-based scheduler. Ths statc prorty can be volated when two tasks want to access a shared resource, a lower prorty task may block a hgher prorty task f t succeeds to access to the shared resource earler (prorty nverson). Ths problem can be avoded applyng the Prorty Celng protocol []. The Prorty Celng protocol modfes the calculaton of the worst case response (WCRT) accountng for the possble blockng caused by low prorty tasks to hgher prorty tasks. To apply the Prorty Celng protocol, we proceed calculatng frst the celng of each resource as the prorty of the hghest prorty task that can access ths resource. The worst case blockng that a task can experment due to the Prorty Celng protocol s determned by the longest crtcal secton of the lower 8-2
prorty task accessng to shared resources wth celngs equal or hgher than the prorty of task []. The schedulablty of the system can be tested off-lne usng the teratve technque proposed by Joseph and Pandya [] and later extended by Audsley et al. n [2] to deal wth shared resources. It compares the dfferent WCRT obtaned summng all the possble blockng contrbutons of the tasks that could preempt task assumng an ntal WCRT=. The teraton n+ s computed as follows, n n WCRT + WCRT = B + C + * C j T j hp() j where B s the longest blockng due to lower prorty tasks and hp() s the set of task that could preempt task,.e all tasks wth hgher prorty than task The teratve process starts wth WCRT n+ = and t stops when WCRT = WCRT n n+ or when WCRT > D, n ths latter case the system s not schedulable. We can apply ths formula straghtforward to our framework because the scheduler assures that the precedent subtask fnshes before the next subtask starts. The perod, deadlne and prorty of the subtasks of one task are the same. The calculaton of the longest blockng (B ) for a task T, based on [], s shown n Fgure 2. B = for all tasks T j wth lower prorty than T for all subtask Tjk Tj f Tjk accesses to any resource Rp and the celng of Rp prorty of T then B=max(B,wcet of Tjk) end f end for end for Fgure 2. Determnaton of the longest blockng 3. Power Low Modfed Dual Prorty wth Shared Resources Here we extend the Power Low Modfed Dual Prorty Schedulng algorthm (based on the Dual Prorty schedulng [3]) to deal wth shared resources n a hard real- system. The orgnal Power Low Dual Prorty Schedulng algorthm guarantees to meet the temporal constrants and sgnfcant energy consumpton reducton by slowng and voltage jontly (assumng a lnear relaton between and voltage supply decreasng). To extend ths behavor to real systems wth shared resources, we need frst to solve the problem of prorty nverson, because t can cause our algorthm to fnd false schedulablty stuatons. Our new approach determnes when and how to apply the Prorty Celng protocol n PLMDPR to avod the prorty nverson problem. The man dea s to apply the same algorthmc scheme presented n PLMDP, but dealng wth subtasks drectly nstead of wth the whole tasks, n ths way t s possble to reassgn prortes accordng to the Prorty Celng protocol when necessary. Intally, we have fxed prortes assgned to tasks accordng to a fxed prorty crteron. At ths moment, all subtask of the same task have the prorty of the task. The scheduler modfes the prorty of a subtask when t accesses to a shared resource, specfcally the scheduler apples the Prorty Celng protocol ncreasng the prorty of the subtask to the celng of the resource ths subtask accesses. The PLMDPR defnes two levels of prortes that are organzed as follows, the hghest level, or upper run queue (URQ) s for tasks that can no longer be delayed by less prorty tasks otherwse they wll mss ther deadlnes. The second level, or lower run queue (LRQ) s occuped by those perodc tasks whose executon can stll be delayed wthout compromsng the meetng of ther deadlnes. The celng of the resource n ths scheme corresponds to the prorty n the URQ of the hghest prorty task that could gan access to ths resource. The schedulng algorthm s drven by the followng events:. Actvaton of some perodc task. In ths case ths task s queued to the LRQ sorted by ts promoton nstant. At ths moment ths task can pre-empt a lower prorty task currently n executon. 2. Promoton nstant of some task (ths s explctly calculated n [9]). In ths case, ths task s promoted from the LRQ to the URQ, and at ths moment the task can pre-empt a lower prorty task currently n executon. 3. Allocaton of a shared resource. The executng subtask ncreases ts prorty to the celng of ths resource. After allocaton of the resource pre-empton by a hgher prorty task can occur. 4. Release of a shared resource. The subtask decreases ts prorty to the prorty of the task. At ths moment ths task can be pre-empted by a hgher prorty task. Fnally, when a task fnshes ts executon, the next executng task s selected by pckng the hghest prorty task from the hghest non-empty prorty levels (.e. URQ or LRQ, n ths order). Once the scheduler decdes whch task to execute, before start the executon t needs to fx the rato of processor accordng wth the maxmum spreadng n we are allowed. The rato s calculated followng the heurstcs proposed by Shn et al. [8] that s bult on the assumpton that the delay for the reducton s neglgble. The safeness of the system under these condtons s proved on theorem of the cted work. The of the processor s determned as follows:. If there s not any task n the system, then we set the r to the next arrvng task mnus the wake up delay, and power down the processor. 2. If there s more than one task n the URQ then t has to be executed at maxmum. 3. If there s only one task n the URQ then t can be executed at low where the rato s: 8-3
mn(tpk tc, remang(c )) Speed rato = mn(tpk,td ) tc where tp k s the promoton nstant of any task n the system excludng the current executng task, C s the worst executon of the current executng task, td s the deadlne of the current executng task, and fnally tc s the current. 4. If there are not any task n the URQ but there are some tasks n the LRQ then we can execute at low where the rato s calculate as follows: f ta k < tp and tp k < tp then Speed = - - mnmum ta tc k else f tp h< tp l+c then -- h hp(), l lp() mn(tp h tp, remanng(c )) Speed = mn(tp h, td ) tc else mn(tpl + C tp, remanng(c )) Speed = mn(tpl + C,td ) tc endf endf At practce only certan dscrete values of the frequency of the clock, and then, are attanable dependng on the accuracy of the tunng, n ths case the frequency selected should be a frequency equal or larger than the frequency obtaned by the calculatons to ensure constrants. A comprehensve example of the functonng of the algorthm n a toy model s presented n the appendx, n ths example we can observe the effects of coarse or fne granng of the of the processor. 4. Results and dscusson In ths secton we present the comparson results of the Low Power Fxed Prorty schedulng wth shared resources usng Prorty Celng (LPFPSR) versus the Power Low Modfed Dual Prorty schedulng wth shared resources (PLMDPR). LPFPSR s based on a fxed pre-emptve prorty schedulng wth power awareness. Ths algorthm conssts on executng tasks as slow as possble whle satsfyng constrants. LPFPSR reduces clock along wth voltage supply when there s a unque task ready to execute, otherwse the schedulng does not guarantee the constrants of the rest of tasks of system. It also powers down the processor when there are not ready tasks. The dfferences between LPFPS and the PLMDP are studed n [9]. To check the capabltes of both algorthms, we have smulated several stuatons of a Computerzed Numercal Control (CNC) task set [4], ths example represent a typcal benchmark of mult-taskng system sharng data n many nteractng and overlappng data paths. We compare the total energy consumpton results (per hyper-perod) obtaned. In Fgure 3 we present the task graph of ths system just to show the complexty of the real- applcaton. In ths fgure the oval objects represent tasks and the rectangular objects correspond to data tems (shared resources). The characterstcs (Worst Case Executon Tme, Perod, Deadlne and the prorty) of the task set s shown n the Table. We nvestgate dfferent confguratons related to the way n whch the dfferent tasks allocate and release resources. We have placed the non-crtcal secton of the task executon, whch n our approach s represented as a subtask (ncs), n three dfferent postons along the executon process. We assume that the tasks allocate the resource (or crtcal secton, cs) at the begnnng of the executon (cs-ncs), before termnaton (ncs-cs), or n the mddle of the executon process (cs-ncs-cs). Wth these three dfferent stuatons we obtan trends for the most general stuaton were the crtcal secton could appear anywhere, and several s, durng the executon process. Task Perod Deadlne Prorty T 35 µs 24 µs 24 µs T2 4 µs 24 µs 24 µs 2 T3 8 µs 48 µs 48 µs 3 T4 72 µs 48 µs 48 µs 4 T5 65µs 24 µs 24 µs 5 T6 65 µs 24 µs 24 µs 6 T7 57 µs 96 µs 4 µs 7 T8 57 µs 78 µs 4 µs 8 Table : Parameters of CNC task set. T5 T7 R9 R5 R R3 T T2 R,R2, R3,R4 T3 R,R2 R7,R8 T4 R Fgure 3: Task graph of the CNC control system. The a task s executng the crtcal secton,.e. t s nsde the shared resource s represented as a percentage of the total executon of the task. We vary ths from % to % of the worst case executon of the task to have a wde evaluaton of performance. The results of all the experments are represented n terms of the normalzed average energy consumpton. The lght gray column represents the results of the LPFPSR and R4 PLANT R2 T6 R6 T8 R 8-4
the dark gray column represents the results of the PLMDPR. The smulaton covers one hyper-perod (that s, the mnmum common multple of the tasks perods). In Fgures 4 to 6, we show the behavor of both algorthms when the the tasks execute nsde the shared resources vares from % to %. In fgure 4, the tasks exhaust the % of the, 6% n fgure 5 and 2 % n fgure 6. The average factor of mprovement of our algorthm n front of LPFPSR s 5 % f all tasks use the %, 48% f all tasks use the 6% of the and 75% f all tasks use the 2% of the. Normalzed energy consumpton,8,6,4,2 % of shared resources L PFPS PL MDP Fgure 4: Normalzed energy consumpton varyng the nsde the resource when the % of s exhausted Normalzed energy consumpton,8,6,4,2 % of shared resources L PFPS PL MDP Fgure 5: Normalzed energy consumpton varyng the nsde the resource when the 6% of s exhausted. Normalzed energy consumpton,8,6,4,2 % of shared resources L PFPS PL MDP Fgure 6: Normalzed energy consumpton varyng the nsde the resource when the 2% of s exhausted. In all these fgures, we observe a sgnfcant decreasng of the energy consumpton n both algorthms when the % of the executon of all tasks s exhausted nsde the shared resources. Here we present the analyss of ths partcular stuaton. See Fgures 7 and 8. Let us assume that we have three tasks: T, T2 and T3. The prorty of the tasks are T=3, T2=2 and T3= (the smaller the numbers the hgher the prortes). T and T2 both access to the same resource R, so the celng of R wll be the prorty of T2. The promoton of T s smaller than the promoton of T2 and ths s smaller than the promoton of T3, then, n the LRQ, the order was T, T2 and T3. URQ T T T2 2 LRQ T T2,T3 T TIME TP T A T3 T2 TP T2 R Fgure 7: Tasks do not consume all ts nsde shared resources. URQ T T T 2 3 LRQ T T2,T3 T TIME TP T A T3 T2 TP T2 Fgure 8: Tasks consume all ts nsde shared resources. In Fgure 7, ntally, the task T s executng n the LRQ, at promoton TP T, task T promotes to the URQ and contnues t executon. At promoton TP T2, task T2 promotes to the URQ. As T has allocated the resource ts prorty s the celng prorty of the resource (that s the same as T2). T2 could not pre-empt, and t must wat untl T releases the resource and returns to ts prorty base. Now T2 can pre-empt the CPU and t executes. As there are two tasks n the URQ the processor could not be reduced. After T2 fnshes there s only one task n the URQ and the can be reduced, but the remanng executon s small. In Fgure 8, as soon as T release the resource, t fnshes, so T2 can execute at low durng all ts executon. Ths latter stuaton s energetcally favorable,.e. the rato / s larger. Fnally, n Fgure 9, we represent the total energy savng n the three possble confguratons when the task consumes dfferent ranges of ts from % to %. Each pont n the graph represents the rato of the accumulated energy savng varyng the percentage of the exhausted n the shared resources from % to %. We observe that n the cs-ncs-cs case, where the B caused by the resource s the half value of the B of the cs-ncs and the ncs-cs, and t occurs twce, the PLMDPR algorthm mproves LPFPSR between a 23% and a 62%. On the case cs-ncs the mprovement of the PLMDPR vares between 6% and 98%, and fnally n the case ncs-cs the mprovement vares from 2% to 9%. The reason of the dfference behavor between cs-ncs-cs and cs-ncs or ncs-cs, s that n the former the pre-empton can occur when a task has stll not fnshed and another task, that pre-empts the executng task, comes to the URQ forcng the scheduler to ncrease the of the processor to the maxmum value. A R T2 2 T2 3 R,F,A T2 T2 2 F T 3 T2 3 TP T3 TP T3 F R,F 8-5
However, when there s a unque crtcal secton, the algorthms perform equvalently n both confguratons (csncs) and (ncs-cs). PLMDPR / LPFPSR,,9,8,7,6,5,4,3,2,, % 2% 3% 4% 5% 6% 7% 8% 9% % % of exhausted cs-ncs-cs cs-ncs ncs-cs Fgure 9: Energy consumpton rato PLMDPR/LPFPSR n functon of the nsde the resource for three dfferent confguratons of the access to the shared resources. 5. Conclusons We have presented an extenson of the Power Low Modfed Dual Prorty schedulng algorthm that allows hard real system to use shared resources wthout compromsng the tmng constrants of the applcatons whle keepng a low energy consumpton. Ths approach has been shown to over-perform the LPFPSR power savng by an average factor, n the case of a Computerzed Numercal Control task set, that range from 6% up to 98% dependng on the use of sharng resources and the consumpton of the worst case executon that does the applcaton. The algorthm does not ncrease the complexty of the LPFPSR and can be mplemented n most of the kernels. 6. References [] A.P. Chandrakasan, S. Sheng and R. W. Brodersen, Lowpower CMOS dgtal desgn, IEEE Journal of Sold-State crcuts, vol. 27, pp. 473-484, Aprl 992. [2] J. Rabaey and M Pedram (Edtors). "Low Power Desgn Methodologes". Kluwer Academc Publshers, Norwell, May, 996. [3] S.T. Cheng, S.M. Chen and J.W. Hwang, "Low-Power Desgn for Real-Tme Systems", Real-Tme Systems,5, pp 3-48, 998. [4] D. Mosse, H. Aydn, B. Chlders and R. Melhem, Complerasssted power-aware schedulng for real- applcatons Workshop on Complers and Operatng systems for Low Power COLP 2, Chateau Lake Louse, Banff, Canada, October 2. [5] P. Plla and K.G. Shn, Real- dynamc voltage scalng for low-power embedded operatng systems 8th ACM Symposum on Operatng Systems Prncples, Phladelpha, Pennsylvana, October 2. [6] Transmeta Corporaton, Crusoe Processor Specfcaton, http://www.transmeta.com [7] H. Aydn, R. Melhem, D. Mosse and P. Meja-Alvarez, Determnng optmal processor s for perodc real- tasks wth dfferent power characterstcs 3th Euromcro Conference on Real-Tme Systems, Delft, Netherlands, June 2. [8] Y. Shn and K. Cho, Power conscous Fxed Prorty schedulng n hard real- systems DAC 99, New Orleans, Lousana, ACM -583-7/99/6, 999. [9] M.A. Moncusí, A. Arenas and J. Labarta, "Improvng Energy Savng n Hard Real Tme Systems va a Modfed Dual Prorty Schedulng", ACM SgArch Computer Archtecture Newsletter, Vol 29, No.5, pp 9-24, December. [] L. Sha, R. Rajkumar and J.P. Lehoczky. "Prorty Inhertance Protocols: An approach to Real-Tme Synchronzaton", IEEE Transactons on Computers, Vol 39, No 9, pp 75-85, September 9 [] M.Joseph and P.Pandya. "Fndng response s n a real system, The Computer Journal, vol 29, no 5 pp 39-395, October 86. [2] N.Audsley, A. Burns, M.Rchardson, K. Tndell and A.J. Wellngs. "Applyng new schedulng theory to statc prorty preemptve schedulng", Software Engneerng Journal, pp 284-292, September 93. [3] R. Davs and A.J. Wellngs, "Dual Prorty schedulng", Proceedng IEEE Real Tme Systems Symposum, pp. -9, December 995. [4] N. Km, M. Ryu, S. Hong, M. Saksena, C. Cho and H. Shn, "Vsual assessment of a real- system desgn: a case study on a CNC controller", Proceedngs IEEE Real-Tme Systems symposum, December 996. Appendx We present a toy model example to enlghten the functonng of the algorthms n the two man aspects.e. the reducton and allocaton and release of shared resources. The proposed task model s presented n Table 2. Name Perod Deadlne Share resource T 5 5 T2 8 8 2 T3 4 Table 2 Parameters of a toy model example. T T 2 T 3 T T 2 T 3 T T 2 T T 3 T T 2 T T 3.75.5.25 5 5 2 T 2 T T T 3 T 2 T T T 2 T 3.75.5.25 2 25 3 35 4 The task s nsde the resource Fgure : LPFPSR when tasks consume the % of the 8-6
Consder Fgure that represents the behavor of the LPFPSR when the tasks consume the % of the. The reducton can not be performed untl t=6, when there s only task T 2 at the system. We reduce the untl the arrval of T and T 3 to the system agan at t=2. Essentally the same occurs at t=26 and t=36. The resource allocaton works as follows: at t=5 T tres to allocate the resource but T 3 s nsde and must wat untl t releases the resource. At t=24 T 2 arrves wth a hgher prorty than T 3, but usng the prorty celng protocol (the celng s the prorty of T ) T 3 nherts the prorty of the celng so T 2 can not preempt T 3. The energy consumpton depends on the granng of the reducton as follows: consderng fractons the energy consumpton s 287.5 unts, consderng fractons the energy consumpton s the same 287.5 unts..75.5.25 T T 2 T 3 T T 2 T 3 T T 2 T T 3 T T 2 T T 3 5 5 2 T 2 T T T 3 T 2 T T T 2 T 3.75.5.25 2 25 3 35 4 Fgure : PLMDPR when tasks consume the % of the The task s nsde the resource In Fgure we represent the behavor of the PLMDPR when the tasks consume the % of the. Let us see the reductons. Ths, T and T 2 promote to the URQ as they arrve to the system. T 3 promotes 2 tm e unts after ther arrval. At t=, we can reduce because the only task at the URQ s T and T 3 s at the LRQ. After promoton of T 3 at t=2 somethng nterestng happens. In prncple, the could be reduced but, due to that fact that at t=5 T wll promote agan, the dle s shorter than the T 3 needs to fnsh ts executon and then the s not reduced. The same scenaro occurs at t=2 and t=3. On the other hand, the resource allocaton works dentcally to the LPFPSR case. The energy consumpton depends on the granng of the reducton as follows: consderng fractons the energy consumpton s 278.72 unts, consderng fractons the energy consumpton s 277.3 unts. Fgure 2 represents the behavor of the LPFPSR when the tasks consume the 5% of the. At t=5, T 3 s the only task n the system, however we can not reduce the because t needs 4 unts, n the worst case, to execute and T wll arrve at t=5. At practce t executes only durng 2 unts and the rest 5 unts the system s free. The rest of reductons are straghtforward..75.5.25 T T 2 T 3 T T 2 T 3 T T 2 T T 3 T T 2 T T 3 5 5 2 T 2 T T T 3 T 2 T T T 2 T 3.75.5.25 2 25 3 35 4 The task s nsde the resource Fgure 2: LPFPSR when tasks consume the 5% of the The prorty celng n ths example mples that T 2 must wat due to the prorty celng protocol at t=32. The energy consumpton depends on the granng of the reducton as follows: consderng fractons the energy consumpton s 36.35 unts, consderng fractons the energy consumpton s 35.74 unts. T T 2 T 3 T T 2 T 3 T T 2 T T 3 T T 2 T T 3.75.5.25 5 5 2 T 2 T T T 3 T 2 T T T 2 T 3.75.5.25 2 25 3 35 4 Fgure 3: PLMDPR when tasks consume the 5% of the The task s nsde the resource In Fgure 3 we represent the behavor of the PLMDPR when the tasks consume the 5% of the. In ths case the reducton take advantage of the dle The reducton occurs before the promoton of T 3 at t=2. At t=5 T s the only task at the system and the can be reduced agan. At t= T can reduce the untl T 3 promotes at t=2, that can reduce the agan untl t=5. The energy consumpton depends on the granng of the reducton as follows: consderng fractons the energy consumpton s 4.2 unts, consderng fractons the energy consumpton s 99.57 unts. 8-7