Scheduling and analysis of real-time task graph models with nested locks
Introduction
Processes in real-time systems may contain conditional codes, where the branch to be taken is determined by external events at run time, and the timing requirement along each branch is different. These systems are usually modeled by task graph [1], [2], [3], [4], [5], that is a directed graph with vertices and edges which represent code blocks and control flow, respectively. The task graph models can not only precisely capture the non-deterministic branching behavior of the processes but also can be efficiently analyzed.
However, a common limitation of existing efforts on real-time task graph models is that they all assume different tasks in the system are completely independent of each other, which is not usually employed in practice. In real-time systems, different tasks often compete for shared resource, such as shared peripheral devices or global data structures. To guarantee the timing correctness in system design, resource sharing problem must be considered in real-time task graph models. The only known work addressing the resource sharing problem in general task graph models is [6]. It develops a new locking protocol ACP to manage non-nested resource access for the DRT (digraph real-time) task model which is the most general model among all the real-time task graph models that are known to be tractable. Unfortunately, ACP can only handle non-nested resource access. The scheduling and analysis of general task graph models with nested shared resource access is still open.
In this paper, we develop new techniques to handle the nested resource sharing problem in DRT task model. A new protocol is proposed, called N-ACP, by modifying ACP for DRT task model. Also, we apply this protocol to EDF scheduling and obtain a new scheduling strategy EDFN-ACP. Furthermore, we develop the schedulability analysis techniques for EDFN-ACP and prove that if the resource accesses level is at most , then the EDFN-ACP has a speedup factor1 , which satisfies , where is the resource access level. The case of non-nested resource access is a special case of our function with , for which the speedup factor is . This result is exactly consistent with the speedup factor of EDFACP in [6]. Since DRT generalizes other models [1], [3], [4], all the results in this paper are directly applicable to those more restricted models.
Section snippets
Related work
Resource sharing problems have been studied in plentiful literature for periodic and sporadic task systems. The Priority Inheritance Protocol (PIP) [7] designed by Sha, Rajkumar, and Lehoczky is the first proposed real-time locking protocol addressing the problem in fixed priority scheduling. Based on PIP, there are several optimal protocols for uniprocessor real-time task systems including Priority Ceiling Protocol (PCP) [7] and Stack Resource Policy (SRP) [8]. PCP also works with
Model and definition
In this section, we first introduce the DRT task model and its feasibility analysis. Then, we define the elements of our sharing resource model and extend them to DRT task model. Finally, we give the definition of speedup factor which is used to evaluate the “quality” of a scheduling algorithm quantitatively.
EDF+ACP for task system
In this section, we first briefly introduce the Absolute-time Ceiling Protocol (ACP) in [6] which is used to handle the non-nested resource sharing in task graph systems. Then we show that directly applying EDFACP to DRT task model with nested shared resources leads to inaccurate results.
In the following, we present the scheduling rules of EDFACP. The data structures are defined in the form of functions with respect to time . Because we implement EDFACP such that these data structures only
N-ACP: Nested Absolute-time Ceiling Protocol
To handle the problem of general task graph models with nested shared resource, in this section we present a new protocol, the Nested Absolute-time Ceiling Protocol (N-ACP). We redefine the concept of “ceiling” for nested resource access. Later, we present a sufficient schedulability test for EDF scheduling with N-ACP in Section 6.
Based on the discussion in Section 4, the challenge in scheduling tasks with nested resource is before the ceiling stops the blocking caused by a resource , another
Schedulability analysis
We develop the schedulability analysis for EDFN-ACP in this section. Our analysis is presented under a general form: assuming the system runs an -speed machine. Therefore we can directly use the schedulability test conditions to derive the speedup factor of EDFN-ACP in Section 7.
We first introduce the framework we use to derive the sufficient schedulability test. We assume that the task system is unschedulable by EDFN-ACP on an -speed machine and let be the earliest time instant when
Speedup factor
In this section, we first present the speedup factor of EDF N-ACP with nested resource access, then present its proof.
Theorem 2 Any task set with the maximal access level is feasible on a -speed machine, is also deemed to be schedulable by Theorem 1 on a -speed machine if
By Theorem 2, we illustrate the speedup factor of different maximal access level in Fig. 6. We can see that the non-nested shared resource is a case in (8) with , which has a speedup factor of . This result
Conclusions
In this paper we propose a new protocol called N-ACP, by a modification of proposed ACP, to analyze nested resource sharing problem for real-time task graph systems. Due to the branching structures in such graphs and the nested shared resource, this problem is significantly more difficult. We also present EDFN-ACP scheduling strategy with real-time graph model, for which we develop the schedulability analysis and derive the speedup factor as a function of the maximal nesting level of resource
Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Acknowledgment
This work is supported in part by the National Natural Science Foundation of China (NSFC) under Grant 61772123.
He Du is currently a Ph.D. candidate at School of Computer Science and Engineering, Northeastern University. She received the Bachelor degree from Northeastern University, Shenyang, China, in 2015. Her research interests focus on parallelism program analyze and multiprocessor real-time scheduling.
References (18)
- et al.
An optimal resource sharing protocol for generalized multiframe tasks
J. Log. Algebr. Methods Program.
(2015) The non-cyclic recurring real-time task model
- et al.
Generalized multiframe tasks
Real-Time Syst.
(1999) Dynamic-and static-priority scheduling of recurring real-time tasks
Real-Time Syst.
(2003)- et al.
On schedulability analysis of non-cyclic generalized multiframe tasks
- et al.
The digraph real-time task model
- et al.
Resource sharing protocols for real-time task graph systems
- et al.
Priority inheritance protocols: An approach to real-time synchronization
IEEE Trans. Comput.
(1990) Stack-based scheduling of realtime processes
Real-Time Syst.
(1991)
Cited by (0)
He Du is currently a Ph.D. candidate at School of Computer Science and Engineering, Northeastern University. She received the Bachelor degree from Northeastern University, Shenyang, China, in 2015. Her research interests focus on parallelism program analyze and multiprocessor real-time scheduling.
Xu Jiang has received his BS degree in computer science from Northwestern Polytechnical University, China in 2009, received the MS degree in computer architecture from Graduate School of the Second Research Institute of China Aerospace Science and Industry Corporation, China in 2012, and Ph.D. from Beihang University, China in 2018. Currently, he is working in Northeastern University, China. His research interests include real-time systems, parallel and distributed systems and embedded systems.
Mingsong Lv received his Ph.D. degree in computer science from Northeastern University, China. He is currently an associate professor of Northeastern University, China. His current research interests include timing analysis of real-time systems and intermittent computing.
Tao Yang is currently a Ph.D. candidate in Northeastern University, Shenyang, China. He is good at system implementation. His current research interests include multiprocessor real-time scheduling and operating system architecture.
Wang Yi received his Ph.D. degree in Chalmers University of Technology, Gotheborg, Sweden in 1991. He is currently a Chair Professor in Uppsala University, Uppsala, Sweden. He is also the Head of School of Computer Science and Engineering, Northeastern University, Shenyang, China. His research interests include modeling and validation of timed systems, model-checking of real-time systems, timing analysis of embedded software on multicores and multiprocessor real-time scheduling.