19/1/18 Preemptve cedulng Mot o wor on cedulng a been ocued on ully preemptve ytem, becaue tey allow ger reponvene: Preemptve Non Preemptve Dadvantage o preempton However, eac preempton a a cot: ontext wtc cot: tme taen by te ceduler to upend te runnng ta, wtc te context, and dpatc te new ncomng ta. RPD: 1 ace related preempton delay delay ntroduced by g prorty ta tat evct cace lne contanng data ued n te uture: wrte B ace AB wrte A read A cace t read A cace m Extra tme needed or readng A, tu ncreang te WE o. WE a executng alone (or non preemptvely) on a ngle PU: a experencng preempton by ger prorty ta: Preempton ndrect cot Ppelne cot: tme to lu te ppelne wen a ta nterrupted and to rell t wen ta reumed. Bu cot: tme pent watng or te bu due to addtonal conlct wt I/O devce, caued by extra accee to te RAM or te extra cace me. WE NP NP = + RPD RPD context Bu wtc Ppelne 1
19/1/18 Preempton ndrect cot Preempton cot Addtonal preempton: te extra executon tme alo ncreae te number o preempton: WE may ncreae up to 5% n te preence o preempton (le ecency): Non Preemptve +5% Preemptve WE WE WE become alo more varable (le predctablty): A a conequence, WE etmaton or preemptve ta are ger le predctable (gly varable) WE dtrbuton Inluence on WE non-preemptve preemptve Advantage o NP cedulng It reduce context-wtc overead: mang WE maller and more predctable. It mple te acce to ared reource: No emapore are needed or crtcal ecton It reduce tac ze: a can are te ame tac, nce no more tan one ta can be n executon mn It allow acevng zero I/O Jtter: nng_tme tart_tme = (contant) Advantage o NP cedulng Dadvantage o NP cedulng In xed prorty ytem can mprove cedulablty: 4 U.97 5 7 RM 1 5 1 15 5 5 In general, NP cedulng reduce cedulablty ntroducng blocng delay n g prorty ta: NP-RM 1 7 14 5 1 15 5 1 deadlne m 8 5 5 deadlne m deadlne m 7 14 1 8 5
19/1/18 Dadvantage o NP cedulng Non preemptve anomale e utlzaton bound under non preemptve cedulng drop to zero: 1 1 1 1 = double peed deadlne m = 1 1 U = + 1 Non-preemptve analy Analy o non-preemptve ytem more complex, becaue te larget repone tme may not occur n te rt ob ater te crtcal ntant. Non-preemptve analy Hence, te analy o mut be carred out or multple ob, untl all ta wt prorty P are completed. 1 6 1 18 4 1 6 1 18 4 1 1 Sel-pung penomenon Hg prorty ob actvated durng non-preemptve executon o lower prorty ta are pued aead and ntroduce ger delay n ubequent ob o te ame ta. NOE Analy can reduce to te rt ob o eac ta and only 1. te ta et eable under preemptve cedulng;. All deadlne are le tan or equal to perod. Repone tme analy (or preemptvely eable ta et wt D ) B I r = max{ r } B max{ } P P p() et o ta wt prorty ger tan P lp() et o ta wt prorty lower tan P Wort-cae Occuped tme: due to blocng B rom lp() ta and ntererence I rom p() ta. B I NOE: (or preemptvely eable ta et wt D ) r Hence x + 1 mut be ued ntead o x Repone tme analy = max{ r } R te end o I cannot concde wt te actvaton o a ger prorty ta, becaue t would ncreae I. B 1 1 = + 1
19/1/18 Repone tme analy rade-o oluton (or preemptvely eable ta et wt D ) () ( ) B B 1 1 1 1 ( 1) 1 e ollowng oluton can be adopted to balance between te two extreme approace: Preempton reold Allow preempton only to ta wt g mportance Deerred Preempton Allow preempton only ater a gven tme nterval Stop wen ( ) ( 1) Fxed Preempton Pont Allow preempton only at gven pont n te ta code R = + 19 Preempton reold (P) Eac ta a two prorte: P nomnal prorty: ued to enqueue te ta n te ready queue and to preempt treold prorty: ued or ta executon ( P ) Fully preemptve 1 Uneable ta et 5 deadlne m 4 6 8 1 1 14 16 18 treold nomnal A ta can be preempted by only P > Fully non preemptve 1 deadlne m 5 4 6 8 1 1 14 16 18 But eable wt P Repone tme analy (P) P 1 1 5 1 can preempt cannot preempt 1 cannot preempt NOE: e ame eable cedule obtaned by plttng n two non preemptve cunc: q 1 =,q = P can only be preempted by ta : P > P B ( 1) : P P : P can only be preempted by ta : P > 1 1 4
19/1/18 Deerred Preempton Interetng problem Eac ta can deer preempton up to q Gven a preemptvely eable ta et, nd te longet non-preemptve nterval Q or eac ta tat tll preerve cedulablty. Under EDF Barua - ERS 5 q Under Fx. Pr. Gang-Buttazzo, RSA 9 q B max{ q } P P Oten, g prorty ta ave Q =, meanng tat tey can execute ully non preemptvely. Blocng tolerance o compute Q, we need to nd te maxmum blocng tme tat can be tolerated by a ta, called blocng tolerance ( ): 1 B U lub ( ) U 1 lub( ) U A mple bound or Q e longet non preemptve nterval Q related wt te maxmum blocng tme tat can be tolerated by ger prorty ta. It mut be were Hence: B B max{ q } P P P P max{ q } A mple bound or Q A mple bound or Q = 1 = max{ q } P P max {q, q, q 4 } 1 max {q, q 4 } = 1 Q 1 = Q = mn{q -1, -1 } = q 4 = 1 q 1 = = q mn{ 1, } q 4 mn{ 1,, } 5
19/1/18 Ung Q Expermental Reult Once Q computed, t can be ued a ollow: Partton eac ta nto a et o NP regon no larger tan Q nertng utable preempton pont. Incapulate crtcal ecton nto NP regon, avodng complex concurrency control protocol. Avg. # o preempton x 1 4 1 1 8 6 n = 16 Fully preemptve 7% preempton pont crtcal ecton 4 Ung Q Q Q.1...4.5.6.7.8.9 U Fxed Preempton Pont (FPP) Eac ta dvded n m cun: q,1... q,m It can only be preempted between cun Example Let: 1 be ully non preemptve: q 11 = 1 = contng o NP cun: q 1 =1,q =, =4 be ully non preemptve: q 1 = = 1 6 1 18 4 9 18 7 B max{ q P P max } Note tat: e wort cae repone tme o doe not occur n te rt ntance. e ntererence on larger tan B + 1. Repone me Analy (FPP) Repone me Analy (FPP) Mut be carry out up to te buy perod o eac ta. 1 6 1 18 4 1 6 1 18 4 9 18 7 9 18 7 Buy perod o Level- buy perod It te nterval n wc te proceor buy executng ta wt prorty ger tan or equal to P, ncludng blocng tme. Buy perod o Level- buy perod It can be computed a te ortet nterval tat ate: L Intal value can be: B L : P P () L B : P P up to ob N : N L 6
19/1/18 Repone me Analy (FPP) B ( 1) q R ( 1) [1, N ] R max R (-1) q q 1 NOE: : P P N () L ( 1) q Repone me Analy (FPP) or (=1 to n) { N L / () = 1 do { B ( 1) ( 1) q q R ( 1) ++ } wle ( N ) } return(feasible) (R > R ) ten R = R q 1 : P P (R >D ) ten return(unfeasible) Specal cae Fully non preemptve cedulng q B max{ } Deerred Preempton q P P B max{ Q } P P Fnal remar Preempton reold are eay to pecy, but t dcult to predct te number o preempton and were tey occur large preempton overead Deerred Preempton allow boundng te number o preempton but t dcult to predct were tey occur. Note tat te analy aume Fxed Preempton Pont allow more control on preempton and can be elected on purpoe (e.g., to mnmze overead, tac ze, and reduce WE). A large nal cun n reduce te ntererence rom pta (ence R ), but create more blocng to p-ta. q 7