Comments on "Gang EDF Schedulability Analysis"
CComments on “Gang EDF SchedulabilityAnalysis”
Pascal Richard ∗ Jo¨el Goossens † Shinpei Kato ‡ Abstract
This short report raises a correctness issue in the schedulability test pre-sented in [6]: “Gang EDF Scheduling of Parallel Task Systems”, 30th IEEEReal-Time Systems Symposium, 2009, pp. 459-468.
We raise a correctness issue in the schedulability test in the paper: “Gang EDFScheduling of Parallel Task Systems”, Shinpei Kato and Yutaka Ishikawa, pre-sented at RTSS’09. This paper presents a Gang scheduling algorithm (GangEDF) and its schedulability test, named [KAT] hereafter. [KAT] considers n preemptive sporadic gang tasks (also known as rigidparallel tasks [5]), to be executed upon m identical processors. Each task τ i = ( v i , C i , D i , T i ) , ≤ i ≤ n , is characterized by the number v i of used proces-sors, a worst-case execution time C i when executed in parallel on v i processors,a minimum inter-arrival time T i and a constrained relative deadline D i (i.e., D i ≤ T i ). The utilization of τ i is U i = C i /T i . Each task generates an infinite se-quence of jobs. The execution of a job of τ i is represented as a C i × v i rectanglein time × processor space. Every job must be completed by its deadline.Gang EDF applies the well-known EDF policy to the gang scheduling prob-lem: jobs with earlier deadlines are assigned higher priorities. Since tasks useseveral processors, the earliest deadline rule is extended in Gang EDF to takeinto account the spacial limitation on the number of available processors byusing a first fit based strategy. The reader can refer to [6] for a complete de-scription of the scheduling algorithm. Next, we only focus on the schedulabilitytest for analyzing gang tasks scheduled by Gang EDF. ∗ LIAS-University of Poitiers, [email protected] † Universit´e Libre de Bruxelles, Belgium, [email protected] ‡ Nagoya University, Japan, [email protected] a r X i v : . [ c s . O S ] M a y [KAT] Schedulability Test Principles Basically, the test follows the principles of [BAR] test defined in [1] for tasksusing at most one processor. It is based on a necessary schedulability condition fora task to miss a deadline. Then, the contrapositive condition yields a sufficientschedulability condition for the considered scheduling algorithm. [KAT] test considers any legal sequence of job requests on which a deadlineis missed by Gang EDF. Assume that τ k is generating the problem job at time t a that must be completed by its deadline at time t d = t a + D k . Let t be thelatest time instant before or at t a at which at least v k processors are idled and ∆ k = t d − t . A necessary condition for the problem job to miss its deadline is:higher priority tasks are blocking τ k for strictly more that D k − C k in the interval [ t a , t d ) . Since τ k requires v k processors, it is blocked while m − v k + 1 processorsare busy. This minimum interference necessary for the deadline miss is definedby the interference rectangle whose width w k and height h k are respectively givenby: w k = ∆ k − C k and h k = m − v k + 1 .Let I ( τ i , ∆ k ) be the worst-case interference against the problem job over [ t , t d ) , meaning that it blocks the problem job over [ t a , t d ) and is executed over [ t , t a ) . In [6], it is claimed that: If the problem job misses its deadline, thenthe total amount of work that interferes over [ t , t d ) necessarily exceeds theinterference rectangle: (cid:88) τ i ∈ τ I ( τ i , ∆ k ) > w k × h k (1)It is important to understand exactly what Equation (1) means: if a taskmisses a deadline, then the condition defined in (1) is satisfied . Thus,it represents necessary conditions for task τ k to miss a deadline A k = ∆ k − D k units after an instant at which at least v k processors are idled. It is alsoimportant to notice that the necessary condition only exploits the area of theinterference rectangle (i.e., w k × h k ) for defining a bound on the processordemand for task τ k . Finally, it is also worth noticing that this necessary conditionis not formally proved in [6].As in [BAR] , the contrapositive of the previous necessary condition allowsto define the following sufficient schedulability condition in [KAT] : if the con-trapositive of Equation (1) is satisfied, then deadlines are met.The interference must take into account carry-in jobs in the interferencerectangle who arrive before t and have not completed execution by t . The [KAT] test distinguishes the interference coming from tasks without or witha carry-in job for bounding the overall interference I ( τ i , ∆ k ) , respectively de-noted I ( τ i , ∆ k ) and I carry-in . The schedulability test [KAT] checks every taskusing the contrapositive of the necessary condition (1) that yields a sufficientschedulability condition in Theorem 1. Theorem 1 [6] It is guaranteed that a task system τ is successfully scheduled byGang EDF upon m processors, if the following condition is satisfied for all tasks k ∈ τ and all ∆ k ≥ D k : (cid:88) τ i ∈ τ I ( τ i , ∆ k ) + I carry-in ≤ w k × h k (2)Several bounds have been proposed in [6] to evaluate the accumulated in-terference (cid:80) τ i ∈ τ I ( τ i , ∆ k ) . We limit ourselves to use the first proposed bound: I ( τ i ) = min( hbf ( τ i , ∆ k ) , w k ) × min( v i , h k ) if i (cid:54) = kI ( τ i ) = min( hbf ( τ i , ∆ k ) − C k , A k ) × min( v i , h k ) if i = k where A k = ∆ k − D k defines the maximum contribution of τ k in the feasibilityinterval [ t , t d ) and hbf ( τ i , L ) = max (cid:16) , (cid:106) L − D i T i (cid:107) + 1 (cid:17) × C i is the horizontal-demand bound function .Similarly, the contribution of task τ i with a carry-in job to the interferencerectangle can be bounded by [6]: I ( τ i ) = min( hbf (cid:48) ( τ i , ∆ k ) , w k ) × min( v i , h k ) if i (cid:54) = kI ( τ i ) = min( hbf (cid:48) ( τ i , ∆ k ) − C k , A k ) × min( v i , h k ) if i = k where hbf (cid:48) ( τ i , L ) = (cid:106) LT i (cid:107) × C i + min ( C i , L mod T i ) . I diff = I ( τ i ) − I ( τ i ) isthe contribution of τ i by its carry-in job to the interference rectangle (definedin [6]). I diff is used to compute the total amount of work contributed by thecarry-in parts, that is at most I carry-in in Equation (2). We do not detail it heresince it will not be used in the remainder .Notice that h k is fixed while w k is not (since ∆ k is not determined). Thus,the previous condition must be checked for all values of ∆ k . As a consequence,in order to use the test (Theorem 1), ∆ k must be bounded to define a finite timeinterval to test possible values for ∆ k (Theorem 2). Theorem 2 [6] If Condition (2) is to be violated for any ∆ k , then it is violated forsome ∆ k ≥ D k satisfying Condition (2), where C carry-in denotes (cid:80) τ i ∈ τ carry-in C i . ∆ k ≤ h k C k − (cid:80) τ i ∈ τ ( D i − T i ) U i × min( v i , h k ) + C carry-in h k − (cid:80) τ i ∈ τ U i × min( v i , h k ) (3) where τ carry-in is the set of tasks with a carry-in job. In this section, we show through a counterexample that problems arise when theschedulibility test presented in the previous section is applied to a counterex-ample task set. Then, we show that the necessary condition for a job to miss The horizon-demand bound function computes the upper bound of the time length demand of τ i over any time interval of length L [6]: hbf ( τ i , L ) = dbf ( τ i , L ) × v i . Interested readers can refer to Section (4.3) in [6]. I carry-in is bounded by solving a knapsackproblem in a greedy manner to fulfill as much as possible the interference rectangle by carry-in jobs. v i C i D i T i τ τ π τ , τ τ D , D τ π τ τ π Figure 1: Counter-Example: infeasible task set for 3-processor platforms.a deadline is not valid (i.e., Equation (1)). This will allow us to conclude thatTheorems 1 and 2 that both exploit the contrapositive of Equation (1) cannotdefine a valid sufficient schedulability test. We first present the counterexampletask set.
Counter-example definition.
Let us consider the feasible task set defined inFigure 1 and a platform with m = 3 processors. Both tasks require simultane-ously two processors and have a deadline of 2 units of time. According to GangEDF, tasks τ and τ have equal priority since (i) the have the same relativedeadline and (ii) they both require two processors . With no loss of generality,we assume that Gang EDF tie breaker gives the higher priority to τ . There-fore, task τ will miss its deadline. Clearly, this task set is infeasible upon a3-processor platform. Applying the test on the counterexample.
We analyze the task τ . τ releasesthe problem job that misses its deadline at time 2 as depicted in Figure 1. Thefeasibility interval is delimited by: t = t a = 0 and t d = D = 2 ; ∆ = t d − t = 2 and A = ∆ − D = 0 . The scenario ∆ = D is the first scheduling point con-sidered in the feasibility interval when applying Theorem 1. The interferencerectangle is: w = ∆ − C = 2 − and h = m − v + 1 = 3 − .The first step in order to apply [KAT] test is to define the feasibility intervaldefined in Theorem 2. Next, we will only use the fact that C carry-in ≥ . InTheorem 2, the numerator has always a positive value since D i ≤ T i , ≤ i ≤ n ,and all used values are positive or zero. We will see that the denominator is not positive in the counterexample. As a consequence, the schedulability test has tobe applied over a time interval which has surprisingly a negative length.The task under analysis is τ , thus we set k = 2 in the remainder. Weneed to bound ∆ using Theorem 2. We prove hereafter that such a bound is See Section 3 in [6] for a complete presentation of Gang EDF. The inexistence of carry-in jobs for the considered task set will be proved in the remainder ofthis report. h k − (cid:80) τ i ∈ τ U i × min( v i , h k ) . As shown previously, we have h = 2 ; this impliesthat min( v i , h ) = 2 , ≤ i ≤ n and thus h − (cid:80) τ i ∈ τ U i × − ( + ) × − . As a consequence the denominator is negative. Thus, the upper boundcomputed by Theorem 2 of the time interval while checking the schedulabilityof a task has a negative length.Since, ∆ k < implies that there is no ∆ k such that ∆ k ≥ D k , then thesufficient schedulability test defined by Theorem 1 cannot be applied. Accordingto our interpretation, such a situation cannot be interpreted as Theorem 1 isrespected by default but raises instead a correctness issue. Insight.
In [6], the last mathematical derivations performed to prove Theo-rem 2 is incorrect. Precisely, if ( h k − (cid:80) τ i ∈ τ U i timesmin ( v i , h k )) ≥ then: ∆ k ≤ h k C k − (cid:80) τ i ∈ τ { ( D i − T i ) × min( v i , h k ) } + C carry − in h k − (cid:80) τ i ∈ τ U i × min ( v i , h k ) (4)- Otherwise: ∆ k > h k C k − (cid:80) τ i ∈ τ { ( D i − T i ) × min( v i , h k ) } + C carry − in h k − (cid:80) τ i ∈ τ U i × min ( v i , h k ) (5)Unfortunately most of the time we are in the second case and [KAT] cannot beapplied. To clearly illustrate that purpose, Figure 2 depicts the number of tasksets for which [KAT] cannot be used . Applying the test on the counterexample.
In order to show that the neces-sary condition defined in Equation (1) for a task to miss its deadline is incorrect,we consider once again the task τ in the counterexample. First, we computethe interference bounds for the tasks without carry-in jobs: I ( τ , ∆ ) = min (cid:18)(cid:18)(cid:22) ∆ − D T (cid:23) + 1 (cid:19) × C , w (cid:19) × min( v , h )= min (cid:18)(cid:18)(cid:22) − (cid:23) + 1 (cid:19) × , (cid:19) × min(2 ,
2) = 1 × I ( τ , ∆ ) = min (cid:18)(cid:18)(cid:22) ∆ − D T (cid:23) + 1 (cid:19) × C − C , A (cid:19) × min( v , h )= min (cid:18)(cid:18)(cid:22) − (cid:23) + 1 (cid:19) × − , (cid:19) × min(2 ,
2) = 0 × Synthetic task sets with 10 tasks and 6 processors have been generated using the Stafford’salgorithm. τ and τ are released and have deadlines within the interval [ t , t d ) ). To prove this, let us show that I diff ( τ i ) = 0 , ≤ i ≤ . Let us compute I ( τ i ) : I ( τ , ∆ ) = min (cid:18)(cid:22) ∆ T (cid:23) × C + min( C , ∆ mod T ) , w (cid:19) × min( v , h )= min (cid:18)(cid:22) (cid:23) × , , (cid:19) × min(2 ,
2) = 1 × I ( τ , ∆ ) = min (cid:18)(cid:22) ∆ T (cid:23) × C + min( C , ∆ mod T ) − C , A (cid:19) × min( v , h )= min (cid:18)(cid:22) (cid:23) × , − , (cid:19) × min(2 ,
2) = 0 × Hence there is no carry-in job since I diff ( τ i ) = I ( τ i ) − I ( τ i ) = 0 , ≤ i ≤ .Since there is no carry-in job (i.e., I carry-in = 0 ), the total cumulative in-terference is (cid:80) τ i ∈ τ I ( τ i ) = 2 and thus consequently the necessary conditiondefined in Equation (1) is not satisfied since: (cid:88) τ i ∈ τ I ( τ i ) = 2 = w × h To summarize, there is a deadline miss but the necessary condition defined inEquation (1) is not satisfied. As a consequence, we conclude that Equation61) is not a valid necessary condition for a task to miss its deadline. Hence,Theorems 1 and 2 are not valid since they both use the necessary schedulabilitycondition defined in Equation 1 as an initial claim.
Insight.
This problem is in fact inherited from the [BAR] test. In a footnotein [3, 4], a technical problem has been exhibited and a simple solution is pro-posed to fix it. The detection of the error in [BAR] ([1]) was concurrent to thepublication of [KAT] .The bound of the interference is not correct but can be easily fixed by: • adding an (cid:15) in the interference bounds in I and I (resp. Equations (3)and (5) in [1]), • or changing the inequality (8) in [1] into a strict inequality.Hence, using a strict inequality in Equation (2) (in Theorem 1) will fixthe problem that has been exhibited the previous counter-example while using[KAT] . This short note raises a major correctness issue in the schedulability test pre-sented in [6]. The first problem comes from the feasibility interval that mayhave negative length, even for infeasible task sets. Through numerical experi-ments, we shown that [KAT] cannot be applied. The second problem is inher-ited from the [BAR] that uses incorrect interference bounds. This latter problemcan be corrected in [KAT] following the same principles used for correcting thesimilar problem in [BAR] .It is worth noticing that the detected problem in the necessary conditiondoes not exist if the interference rectangle reaches its maximum height (i.e it isequal to m ). This case only arises if every gang tasks uses exactly one processorat a time. In this precise case, [KAT] schedulability test is valid and equivalentto [BAR] [1] as explained in [6]. References [1] B
ARUAH , S. Techniques for multiprocessor global schedulability analysis.In (December2007), pp. 119–128.[2] B
ARUAH , S. K., B
ERTOGNA , M.,
AND B UTTAZZO , G. C.
MultiprocessorScheduling for Real-Time Systems . Embedded Systems. Springer, 2015. Notice that in [2] the erroneous version of [BAR] is presented.
73] B
ERTOGNA , M. Evaluation of existing schedulability tests for global EDF.In
ICPP Workshops (2009), IEEE Computer Society, pp. 11–18.[4] B
ERTOGNA , M.,
AND B ARUAH , S. K. Tests for global EDF schedulabilityanalysis.
Journal of Systems Architecture - Embedded Systems Design 57 , 5(2011), 487–497.[5] D
UTOT , P.-F., M
OUNI ´ E , G., AND T RYSTRAM , D. Scheduling parallel tasks:Approximation algorithms.
Handbook of scheduling: Algorithms, models,and performance analysis (2004), 26.1–26.24.[6] K
ATO , S.,
AND I SHIKAWA , Y. Gang EDF scheduling of parallel task sys-tems. In30th IEEE Real-Time Systems Symposium, 2009