Blocking Time Under Basic Priority Inheritance: Polynomial Bound and Exact Computation

Blocking Time Under Basic Priority Inheritance: Polynomial Bound and Exact Computation

1 Blocking time under basic priority inheritance: Polynomial bound and exact computation Paolo Torroni, Zeynep Kiziltan, Eugenio Faldella Abstract The Priority Inheritance Protocol (PIP) is arguably the best-known protocol for resource sharing under real-time constraints. Its importance in modern applications is undisputed. Nevertheless, because jobs may be blocked under PIP for a variety of reasons, determining a job’s maximum blocking time could be difficult, and thus far no exact method has been proposed that does it. Existing analysis methods are inefficient, inaccurate, and of limited applicability. This article proposes a new characterization of the problem, thus allowing a polynomial method for bounding the blocking time, and an exact, optimally efficient method for blocking time computation under priority inheritance that have a general applicability. Index Terms Real-time systems, periodic tasks, resource access protocols, priority inheritance, feasiblity analysis. I. INTRODUCTION When you have eliminated the impossible, whatever remains, however improbable, must arXiv:1806.01589v2 [cs.OS] 11 Jun 2018 be the truth A.C. Doyle, 1890 Priority Inheritance [1] is a widely used protocol for real-time applications involving shared resources with a huge practical and theoretical impact. Its adoption is pervasive in the control and automation industry and in all other domains that rely on real-time systems [2]. Department of Computer Science and Engineering, University of Bologna, Italy e-mail: [email protected]. June 12, 2018 DRAFT 2 The purpose of priority inheritance is to prevent unbounded priority inversion. With respect to other, more efficient protocols proposed in the last years to address the same problem, priority inheritance has a great advantage in its transparency, in the sense that its implementation does not require any information on the tasks involved. It offers, however, a significant drawback, in that there are no known exact methods for computing the blocking time, and the only known method for bounding the blocking time is of exponential complexity [3]. Blocking time is an essential element in feasibility analysis, which is one key theoretical and practical aspect of real-time systems. While blocking time computation can be done exactly, efficiently and straightforwardly under many other resource access protocols [3], under priority inheritance even bounding the blocking time is nontrivial, because there are many possible causes of blocking, and jobs can be blocked multiple times, a phenomenon called chained blocking. The problem becomes particularly intricate when jobs are allowed to hold multiple resources at a time. In this article we propose a polynomial method for bounding the blocking time, and an exact, optimally efficient method for blocking time computation under priority inheritance that applies without restrictions on the number of resources each job can hold. We draw from results in operations research and artificial intelligence. In particular, we show how the bounding problem can be mapped onto an assignment problem, which is a well-studied problem in operations research. Then we define blocking time computation as a search problem in the space of possible assignments of resources, where the objective is to find the path that induces the worst-case scenario associated with the maximum blocking time. Search can also be seen as a process aimed to eliminate impossible resource assignments, corresponding to inadmissible paths. To that end, we provide a full characterization of the conditions that must be met in order for a resource assignment to be admissible. Moreover, we show that the polynomial bound can be used as an admissible heuristics in the search process. As a consequence, the search method we propose is both exact and maximally efficient, in the sense that it does not explore branches unnecessarily. II. BACKGROUND We build on work by Sha, Rajkumar and Lehoczky [1], who proposed and studied two priority inheritance protocols: the “basic” Priority Inheritance Protocol (PIP), and the Priority Ceiling Protocol (PCP) as a solution to unbounded priority inversion [3]. Blocking time is an essential June 12, 2018 DRAFT ⌧j ⌧j ⌧k ⌧k ⌧j ⌧j ⌧j ⌧j ⌧j ↵ = ⌧ , ⌧ ↵ = ⌧ , ⌧ ⌧ h k ji h k ji k ⌧kj ⌧jk ⌧k ⌧j ⌧j ⌧kj o = R, S o = R, S ↵ = ⌧ , ⌧ h i h i h k ji ↵ = ⌧⌧kk↵, ⌧=j ⌧↵⌧kk=, ⌧j⌧k, ⌧j ⌧ ⌧k ⌧ ⌧⌧ ↵ = ⌧⌧kk, ⌧j h j ih h i i j j kj h j i R R o = R, S h i ↵o == ⌧⌧R,kk↵,o S⌧==j o⌧R,k=, ⌧ SjR, S ⌧ ⌧↵k= ⌧k, ⌧j ↵⌧k= ⌧⌧k↵ko,=⌧=j ⌧⌧R,kk, S⌧j hh iihh hii i j h i h ihh ii S S R ⌧j ⌧j ↵o == R⌧R,ko, S⌧=j RR, SR ↵⌧ = o⌧k=, ⌧jR, S ↵ = ↵o⌧k=, ⌧j⌧R,↵ko, S=⌧=j R⌧R,k, S⌧j hh iih i k h hi i h h i iihh ii zj,q zj,q S ⌧j ⌧k ⌧k o = RSR, S RS S ↵ = o⌧ =, ⌧ R, SR o = oR,= SRR,o S= RSR, S h i h k hji i h hi ih i zk,p ⌧ zk,p ↵ = ⌧ z,j,q⌧ ↵ = ⌧ , ⌧ k h k ji h k ji zRSj,q zSj,q zj,q o = R, SR S R SR zRSj,q h i ⌧i+1 ↵ = ⌧⌧i,+1⌧ o = R,zk,p S o = R, S h k ji h i h i zk,pSj,q zj,qk,p zk,p R S zj,q S zSj,q zk,pSj,q ⌧j 1 o = R,⌧j S1 R⌧i+1 R 3 − h − i ⌧zik,pj,q+1 ⌧zik,p+1 ⌧i+1 S zj,q zk,p zj,q zzk,pj,q ⌧zik,pj,q+1 ⌧j ⌧j ⌧j 1 element in feasibility analysis under resourceR constraints. WhileS − PCP’s blockingS time is perfectly ⌧zjik,p+11 ⌧ij+11 ⌧j 1 z zk,p ⌧i+1 zk,p ⌧zik,p+1 ⌧zjik,p+11 − − − j,q − understood,⌧i andJ itsi computation straightforward, with PIP instead literature only provides upper ⌧j+1 ⌧j+1 ⌧j S zj,q zj,q ⌧i Ji bounds [3]. One such⌧ji⌧ upper+1j 1 ⌧j bound⌧j1 ⌧j was proposedzk,p ⌧i+1 by⌧j Rajkumar1 ⌧i+1 [4].⌧⌧ji However,+11 ⌧ji⌧+1j 1 using an upper − − − − − ⌧j Jj ⌧n ⌧n ⌧j+1 bound for feasibility analysis may bez unnecessarilyj,q conservativezk,p and resultz ink,p failure to identify ⌧ji Jij ⌧j⌧+1j 1 ⌧⌧j+1j ⌧j+1 ⌧i+1 ⌧j 1 ⌧j ⌧j 1 ⌧j⌧j 1 ⌧j⌧+1j 1 perfectly feasible applications− with an arbitrarily small− processor− utilization.− − ⌧i Ji ⌧k Jk δ δ ⌧n zk,p ⌧i+1 ⌧i+1 ⌧kj Jjk ⌧j⌧+1nj ⌧j⌧+1n ⌧n ⌧j 1 ⌧j ⌧j+1 ⌧j ⌧j⌧+1j ⌧j⌧+1nj − ⌧i+1⌧j JJi+1j ✏ ... ... ✏ δ ⌧i+1 ⌧j 1 ⌧j 1 ⌧ ⌧k Jk − − i+1 i+1 ⌧j⌧δ+1n ⌧δn δ ⌧j ⌧j+1 ⌧n ⌧j+1 ⌧⌧j+1n ⌧j⌧δ+1n ... ⌧j ⌧1k JJjkpreemption1 preemption ✏ − − ⌧j 1 ⌧j ⌧j − ⌧ J ... ... ⌧ji+11⌧i JJij+1i 1 ⌧δ✏n δ✏ ✏ ⌧ ⌧n δ ⌧n ⌧δn ⌧δ✏n − − j+1 ⌧i+1 Ji+1 preemption ⌧j+1 Jj+1 ⌧j ⌧j+1 ⌧j+1 ⌧j ⌧1j JJjjpreemption1 δ✏ preemption... preemption✏ ⌧ δ ✏ δ ✏δpreemption... δ✏ j−+1 j−+1 n ⌧j⌧n1 JJnj 1 ⌧ ⌧ − − ⌧j+1 n n ... ... ⌧j+1⌧⌧nk JJjnk+1preemption✏ preemption δ preemption✏ preemption✏ ✏preemption✏ ⇠ = ⌧k, ⌧j ⌧j+1 ⇠ =Jj...,J+1 ⇠(j),... ⌧n δ δ h i h i ... ⇠ = ⌧ , ⌧ ⌧i⌧+1n ⇠ =JJni...,Jpreemption+1 1 ,... 1 preemption✏ preemptionpreemptionpreemption h k ji h ⇠(j) i ⇢ = R, S ⌧n⇢ = J...,Rn ,... δ ✏ ... ... ✏ h i h ⇢(j) i ⇠⇢ = ⌧R,k, S⌧j ⌧j 1⇢⇠==J...,Rj...,J1 ⇠(j),... preemption 1 h ii − hh − ⇢(j) i ⇠ = ⌧k, ⌧j RS⇠ = ...,J1 ⇠(j),...1 1 ✏ preemption preemption1 hFig. 1. Examplei of resourceh accesses leadingi to an overly conservative bound for the PIP blocking time. ⇢ = R, S ⌧jRS+1⇢ = J...,Rj+1 ⇢(j),... h i h i 1 1 1 1 1 ⇢ = R, S zj,q ⇢ =zk,p...,R⇢(j),... preemption h Thei followingh example introducesi an application where the upper bound results in an overly zj,qRS⌧n zJk,pn conservative✏RS blocking time1 estimation. 1 1 1 1 z z ⇠ = ⌧kExample, ⌧j j,q✏ 1:⇠Consider=k,p...,J a⇠( jobj),...Ji with priority Pi, which uses n i resources R1;R2;:::;Rn−i , h i h i 1 − f g J zj,q i Rzk,p and a set⇠(j)Γ of n ⇢(ji)jobs, Ji+1;Ji+2;:::;Jn , with priority Pi+1;Pi+2;:::;Pn, which also use − f g 1 1 ⇢ = R, SJ⇠(j)✏⇢ =R⇢...,R(j) ⇢(j),... hthe samei resources.h Let the resourcei associated with a critical section zj;p be Rp (all jobs access ✏δ⇢(j) resources in the same order). Finally, let1 the duration of each critical section be: J⇠(j)RSδ⇢(j) R⇢(j) • δJfor zj;n−j+1R+, for all j (i.e., all the sections in the antidiagonal), and ⇣⇠−⇠((jj)) ⇣⇠(⇢j()j) z δ z+ • an⇣⇠−( arbitrarilyj,qj) ⇢(j) ⇣⇠k,p( smallj) in all other cases z⇠(j,q) δ...⇢(j) z⇠(j,p) as illustrated in Figure+ 1. With this set up, the upper bound obtained by applying Rajkumar’s z⇠(j,q)⇣⇠−(j)✏...⇣⇠(j) z⇠(j,p) method on Ji’s blocking+ time Bi would be (n i)δ. However, because of the reasons we will R⇣⇢⇠(−j()j) ⇢ R⇠⇣(⇠j()j,q) − discuss in the next sections, the exact Bi is only (n i)+δ, if (n i) is odd, or an even smaller z⇠(j,qR)J⇠(j) ...RR⇢( zj⇠)(j,p) ⇢(j) ⇢ ⇠(j),q − − (nz⇠(j,qRi) 1)...+ δR, if ( zn⇠(j,pi)) is even.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    32 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us