An analysis and scheduling method for typed DAG tasks on heterogeneous multi-core platforms
By conducting WCRT analysis of typed DAG tasks and remaining load allocation strategies on heterogeneous multi-core platforms, optimizing the allocation of subtasks on different cores solves the problem of prolonged response time of typed DAG task scheduling on heterogeneous multi-core platforms and improves improve resource utilization and schedulability.
Patent Information
- Application Number
- CN202311097095.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-29
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2043-08-29
AI Technical Summary
On heterogeneous multi-core platforms, existing technologies are difficult to effectively analyze and schedule typed DAG tasks, resulting in prolonged response times, and existing scheduling methods fail to fully utilize processor resources.
This paper proposes a typed DAG task analysis and scheduling method based on heterogeneous multi-core platforms. Through WCRT analysis and earliest start time iteration algorithm, combined with the residual load allocation strategy of greedy strategy, it optimizes the allocation of subtasks on different cores and reduces the worst-case scenario. case response time.
It improves core resource utilization and shortens the worst-case response time of typed DAG tasks. Experimental results show that compared with the latest method, the schedulability and response time performance are improved by 34.9% and 26.4% respectively.
Smart Images

Figure CN117130748B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of DAG task scheduling, and in particular to an analysis and scheduling method for typed DAG tasks on a heterogeneous multi-core platform. Background Art
[0002] Heterogeneous multi-core architectures are widely used in real-time systems to meet the growing computing power and energy-saving requirements of complex parallel tasks in fields such as autonomous driving[1] and industrial automation[2]. Heterogeneous multi-core architectures package cores with different computing capabilities and different power consumption on a single chip to meet the computing power and energy-saving requirements of tasks. For example, ARM proposed the big.LITTLE architecture, which packages two different types of cores on the same chip[3]. Among them, the big core (performance core) has higher computing performance, and the small core (energy-efficiency core) has lower energy consumption.
[0003] Scholars usually model parallel tasks that have both performance and power requirements as typed directed acyclic graph (typed DAG) tasks. Each node (subtask) in the directed acyclic graph represents a continuous workload. The directed edge between subtasks represents the priority constraint relationship between them, that is, a directed edge from subtask 1 to subtask 2 means that subtask 2 can only start executing after subtask 1 is completed. Since the performance and power requirements of each subtask are different, the subtask can only be executed on a specific type of core. The core type is determined by user requirements when the typed DAG task is generated, and the subtask cannot be executed on other types of cores during execution. Although the heterogeneous multi-core architecture takes into account both computing performance and energy consumption, there are many challenges in analyzing typed DAG tasks and corresponding resource allocation on this architecture due to the complex system structure and the interaction between multiple types of subtasks and multiple cores.
[0004] Currently, the scheduling of typed DAG tasks mainly adopts the work-conserving scheduling method [3]-[6]. Based on this method, the scheduler always selects a subtask that satisfies all priority constraints to execute when the core of its type is idle (subtasks cannot be preempted). However, the work-conserving scheduling method does not consider the impact of the internal topological structure of the typed DAG task during execution, which may lead to a longer worst-case response time (WCRT) of the same typed DAG task. Figure 1The worst-case scenario of the same typed DAG task under two scheduling methods on a platform with two types of cores (each type has two cores) is shown. By analyzing the topology of the typed DAG tasks in the example, it can be seen that both v1 and v3 will block v2 and thus extend the WCRT.
[0005] In summary, partition scheduling can better utilize the computing resources of heterogeneous multi-core processors in some cases compared to continuous work scheduling. Therefore, it is of great significance to study the analysis of typed DAG tasks and processor resource allocation based on partition scheduling on heterogeneous multi-core platforms. Platforms based on heterogeneous multi-core processors combine the advantages of different architecture cores and can take into account both high performance and high energy efficiency. Therefore, heterogeneous multi-core platforms have received widespread attention from scholars. However, no one has proposed scheduling analysis technology based on typed DAG tasks on heterogeneous multi-core platforms. Summary of the invention
[0006] The technical problems to be solved by the present invention are:
[0007] The purpose of the present invention is to provide an analysis and scheduling method for typed DAG tasks on a heterogeneous multi-core platform, so as to realize the analysis and processor resource allocation of typed DAG tasks based on partition scheduling on a heterogeneous multi-core platform, and improve the core resource utilization.
[0008] The technical solution adopted by the present invention to solve the above technical problems is:
[0009] An analysis and scheduling method for typed DAG tasks on a heterogeneous multi-core platform, wherein the implementation process of the analysis and scheduling method includes a WCRT analysis process of the typed DAG tasks and a process of a distribution strategy based on the remaining load, specifically:
[0010] WCRT analysis of typed DAG tasks
[0011] 1) WCRT analysis based on life cycle
[0012] First, the definitions and lemmas are given:
[0013] Definition 1: Use EBT(v i ) and EFT(v i ) to represent the subtask v i The earliest start time and the earliest end time; EBT (v i ) and EFT(v i ) can be calculated by formula (4) and formula (5);
[0014]
[0015] EFT(vi )=EBT(v i )+c i (5)
[0016] Definition 2: Use LBT(v i ) and LFT(v i ) to represent the subtask v i The latest start time and the latest end time of LBT(v i ) and LFT(v i ) can be calculated by formula (4) and formula (5), where B(v i ) indicates v i The total amount of obstruction;
[0017]
[0018] LFT(v i )=LBT(v i )+c i (7)
[0019] Lemma 1: For any member of the set Δ(v i )'s subtask v j , only when the following two conditions are met at the same time v j Will block v i Implementation of
[0020] (1) EBT(v j )≤LFT(v i )-c i
[0021] (2) LFT(v j )>EBT(v i )
[0022] Proof (Correctness of Lemma 1): Assume that EBT(v j )>LFT(v i )-c i According to formula (6), LFT(v i )-c i v i The latest start time; if LFT(v j )>LBT(v i ), then v j Will not block v i execution, because v i Once execution begins, it will not be blocked; similarly, if v j In v i The execution is completed before the earliest start, then v j Will not block vi ; That is to say, if LFT(v i )≤EBT(v i ), then v j Will not block v i ;
[0023] For any one of the sets Δ(v i )'s subtask v j , define three variables:
[0024] 1)x1:v j Cannot block v i
[0025] 2)x2: EBT(v j )≤LFT(v i )-c i ,
[0026] 3)x3: LFT(v j )≤EBT(v i );
[0027] Then we get the following true proposition: Therefore, the converse of this true proposition is:
[0028]
[0029] V means or, Indicates not, ^ indicates and;
[0030] is true, so Lemma 1 is proved;
[0031] According to Lemma 1, if v j Blocking i Only when in
[0032]
[0033] According to LFT(v j ) and EBT(v i )Will Divided into two independent subsets;
[0034] Definition 3: Define two subsets as:
[0035] 1)
[0036] 2)
[0037] Lemma 2: v i Received The total blocking of neutron tasks will not exceed
[0038] Proof (correctness of Lemma 1): First, use proof by contradiction to prove Only one subtask will actually block v i ; Assume that any two Different subtasks in v j and v k Blocking v i Without loss of generality, assume that v j Block v first i ; Use F(v j ) to represent v j The completion time, then F(v j )>F(v k )>EBT(v i ); According to the assumption,
[0039]
[0040] In the worst case, and The assumptions of At most one of the subtasks in v will block i ;
[0041] for Any subtask v k , he can block v i At most LFT(v j )-EBT(v i ); therefore, v i Received The total blocking of neutron tasks is at most
[0042] Theorem 1: v i The upper bound of the total blocking value is B(v i ), where B(v i ) can be calculated by formula (8);
[0043]
[0044] Theorem 1 can be proved by Lemma 1 and Lemma 2;
[0045] Corollary 1: The upper bound of the WCRT of the typed DAG task based on partition scheduling can be calculated by formula (9):
[0046]
[0047] in It can be calculated by formula (10), and
[0048]
[0049] Proof (used to prove Corollary 1): For any subtask v i , LFT(v i ) consists of three parts
[0050] 1)PCB(v i ):v i a start time that satisfies all precedence constraints,
[0051] 2) B(v i ):v i The total amount of obstruction,
[0052] 3)c i :v i WCET,
[0053] Among them, PCB (v i )equal B(v i ) can be obtained by formula (8); therefore,
[0054]
[0055] Use R′(v i ) represents the right side of formula (11), then LFT(v i )≤R′(v i );use Replace R′(v i ) in LFT(v i );So, therefore, in It can be calculated by formula (10);
[0056] According to formula (10), Depends on where v j Yes i The predecessor task of v sink The upper bound of the ancestor's WCRT can be obtained However, for a subtask v i , since we do not know LFT(v i ), so it is impossible to directly find Therefore, the method of Algorithm 1 is proposed, through iterative calculation
[0057] 2) Iteration (EOI) algorithm calculation based on the earliest start time The process is:
[0058] EBT-order iteration is referred to as EOI, and earliest beginning time is referred to as EBT;
[0059] Input: Typed DAG task G
[0060] Output:
[0061] Step 1: Calculate the earliest start time and earliest end time of each subtask according to formula (4) and formula (5);
[0062] Step 2: Initialize each subtask
[0063] Step 3: Initialize Δ={Δ(v source ), ..., Δ(v sink )};
[0064] Step 4: Create a temporary variable Temp_V to store the subtask set V;
[0065] Step 5: If Temp_V is not empty, select subtask v from Temp_V i ,in Otherwise, proceed to step 6;
[0066] Step 5.1: Initialize variable I′(v i )=0;
[0067] Step 5.2: For Each subtask v in j ,renew Then v j From Δ(v i ) are removed;
[0068] Step 5.3: Update
[0069] Step 5.4: Initialization
[0070] Step 5.5: If and If they are not equal, then Otherwise, proceed to step 5.6;
[0071] Step 5.5.1: For Δ(v i ) satisfies each Subtask v j Follow steps 5.5.1.1 and 5.5.1.2;
[0072] Step 5.5.1.1: Update And put v j From Δ(v i ) are removed;
[0073] Step 5.5.1.2: For each des(v i ) in the subtask v k ,make
[0074] Step 5.5.1.3: If v j In Δ(v i ), then put v j From Δ(v i ) are removed;
[0075] Step 5.5.2: Repeat step 5.5;
[0076] Step 5.6: Set v i Eliminate from Temp_V and repeat step 5;
[0077] Step 6: Output
[0078] Allocation strategy based on residual load
[0079] According to the above analysis algorithm formula (10) and formula (11), we can know that the set pre(v i ) and collection The smaller the latest end time of the neutron task, The smaller the value of A heuristic allocation strategy based on the greedy strategy of minimizing remaining workload (MRW) is proposed to reduce the worst-case response time of typed DAG tasks. The main idea of the algorithm is to calculate the current remaining workload of all cores of the type to which it belongs when allocating each subtask, and allocate the subtask to the core with the smallest remaining workload, thereby reducing its latest end time and thus reducing Make output Smaller.
[0080] Furthermore, the heuristic allocation strategy of minimizing the residual load is used to reduce The process is:
[0081] Input: typed DAG task G, system core type set Θ = {Θ1, ..., Θ S};
[0082] Output: The core set T to which subtasks are assigned;
[0083] Step 1: Initialize the earliest start time of each subtask according to formula (4) and formula (5);
[0084] Step 2: Initialize the remaining load on each core in represents the residual load of the jth core of the i-th type core;
[0085] Step 3: Initialize the current time CT = 0;
[0086] Step 4: Create a temporary variable Temp_V to store the subtask set V;
[0087] Step 5: If Temp_V is not empty, select subtask v from Temp_V i ,in Otherwise, proceed to step 6;
[0088] Step 5.1: For each core of each type, update its remaining load
[0089] Step 5.2: CT = EBT (v i );
[0090] Step 5.3: Assign v i The core, in
[0091] Step 5.4: Update
[0092] Step 5.5: Set v i Eliminate from Temp_V and repeat step 5;
[0093] Step 6: Output T.
[0094] Furthermore, the earliest start time based iteration (EOI) algorithm includes 4 loops, and each loop has no more than |V| times, and its time complexity is O(|V| 4 ); The space occupied by the finite variables in the algorithm does not exceed |V| 2 ; Therefore, the space complexity of Algorithm 1 is O(|V| 2 ).
[0095] Furthermore, the minimizing remaining load heuristic allocation strategy is a minimizing remaining load (Minimizing Remaining Workload MRW) heuristic allocation strategy algorithm with a greedy strategy as the core, which is used to reduce the worst-case response time of typed DAG tasks. The algorithm calculates the current remaining load of all cores of the type to which it belongs when allocating each subtask, and allocates the subtask to the core with the smallest remaining load, thereby reducing its latest end time and thus reducing
[0096] A system for analyzing and scheduling typed DAG tasks on a heterogeneous multi-core platform, characterized in that the system has a program module corresponding to the above steps, and executes the steps in the above-mentioned method for analyzing and scheduling typed DAG tasks on a heterogeneous multi-core platform during runtime.
[0097] A computer-readable storage medium stores a computer program, wherein the computer program is configured to implement the steps of the above-mentioned method for analyzing and scheduling typed DAG tasks on a heterogeneous multi-core platform when called by a processor.
[0098] The present invention has the following beneficial technical effects:
[0099] The platform based on heterogeneous multi-core processors combines the advantages of different architecture cores and can take into account both high performance and high energy efficiency. Therefore, the scheduling analysis of typed DAG tasks on heterogeneous multi-core platforms is very critical. The present invention studies the worst-case response time (WCRT) and allocation strategy of typed DAG tasks based on partition scheduling on heterogeneous multi-core platforms. The present invention proposes a new WCRT upper bound by deeply analyzing the characteristics of the topological structure of typed DAG tasks, and provides an analysis algorithm based on an iterative method. The algorithm can calculate the latest WCRT upper bound proposed by the present invention in polynomial time. In addition, the present invention also proposes a heuristic allocation strategy, which allocates subtasks in DAG tasks to different cores to improve the utilization of system processor resources. Experimental results show that the WCRT analysis method and allocation strategy proposed by the present invention are improved by 34.9% and 26.4% respectively in schedulability testing compared with the latest methods.
[0100] The DAG-based task allocation problem has been proven to be an NP-complete problem [8]. Therefore, this paper proposes a heuristic allocation strategy called Minimizing Remaining Workload (MRW) to reduce the worst-case response time of typed DAG tasks. The main idea of the algorithm is to calculate the residual load of all cores of the type to which each subtask belongs, and allocate the subtask to the core with the smallest residual load.
[0101] Currently, the scheduling of typed DAG tasks mainly adopts the work-conserving scheduling method [3]-[6]. Based on this method, the scheduler always selects a subtask that satisfies all priority constraints to execute when the core of its type is idle (subtasks cannot be preempted). However, the work-conserving scheduling method does not consider the impact of the internal topological structure of the typed DAG task during execution, which may lead to a longer worst-case response time (WCRT) of the same typed DAG task. Figure 1 The worst execution of the same typed DAG task under two scheduling methods on a platform with two types of cores (each type has two cores) is shown. By analyzing the topological structure of the typed DAG task in the example, it can be seen that both v1 and v3 will block v2 and thus extend the WCRT. Therefore, the present invention assigns v1 and v3 to cores different from v2 (the allocation strategy of other subtasks Figure 1 ) can reduce the WCRT of the retyped DAG task by 5.
[0102] In summary, partition scheduling can better utilize the computing resources of heterogeneous multi-core processors in some cases compared to continuous work scheduling. Therefore, it is of great significance to study the analysis of typed DAG tasks and processor resource allocation based on partition scheduling on heterogeneous multi-core platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] Figure 1 Schematic diagram of the worst-case execution results of the same type of DAG tasks based on two scheduling strategies; Figure 2 This is a schematic diagram of a typed DAG task; Figure 3 for Figure 2 Schematic diagram of the worst execution of a medium-typed DAG task; Figure 4 The experimental results of the schedulability rate based on the PA core allocation method are shown; Figure 5 The WCRT experimental results based on the PA core allocation method. DETAILED DESCRIPTION
[0104] Combined with Figure 1-5 The implementation of the present invention is described as follows:
[0105] The main contributions of the present invention are: 1) improving the recognition accuracy of potential blocking subtasks for a certain subtask; 2) proposing a more tightly typed DAG task WCRT upper bound and a method for calculating the upper bound with polynomial time complexity; 3) proposing a heuristic allocation method to allocate subtasks to cores to improve core resource utilization.
[0106] 2 Partition scheduling can better utilize the computing resources of heterogeneous multi-core processors in some cases compared to continuous work scheduling. Therefore, it is of great significance to study the analysis of typed DAG tasks and processor resource allocation based on partition scheduling on heterogeneous multi-core platforms.
[0107] 3. Implementation of the technical solution of the present invention (system and task model)
[0108] 3.1 System Model
[0109] The heterogeneous multi-core platform studied in the present invention is composed of S (S ≥ 2) cores of different types, denoted by θ = {θ1, ..., θ S} represents the S different types of cores, where θ i represents the core of the i-th type. We use m i Indicates the number of cores of the i-th type.
[0110] 3.2 Task Model
[0111] Parallel tasks based on partition scheduling are usually modeled as typed DAG tasks G=<V,E,C,T,Ω> . Where V represents a set of subtasks. Each subtask represents a continuous workload that can only be executed on a specific type of core, where v i represents the i-th subtask. E represents a set of directed edges, where each element e(v i , v j ) indicates a line from v i Point to v j In addition, e(v i , v j ) also implies v i and v j The priority constraint relationship, that is, v i Before completing execution j Cannot start execution. We call v i Yes j The predecessor task, v j v i The successor subtask. C represents the worst-case execution time set of subtasks, where any element ci Indicates v i The worst-case execution time. T represents the set of cores to which subtasks are assigned, where any element Represents subtask v i is assigned to the kth core of the jth type core. Ω represents a set of subtask types, where any element ω i = j represents subtask v i Can only be executed on cores of type j.
[0112] Use pre(v i ) indicates v i The set of all predecessor subtasks, suc(v i ) indicates v i The set of all subsequent subtasks. Therefore, v i Only when pre(v i ) is completed before it can start executing. If a subtask does not have any predecessor subtasks, then the subtask is called the source subtask and is used by v source Similarly, if a subtask does not have any successor subtasks, then the subtask is called a terminal subtask and is represented by v sink Without loss of generality, we assume that the typed DAG task has only one source subtask and one termination subtask (for typed DAG tasks with multiple source / termination subtasks, just add a subtask with the worst-case execution time of 0 as their source / termination subtask to convert them into typed DAG tasks with only one source subtask and one termination subtask).
[0113] use represents the αth complete path in G, where and denote the source subtask and the termination subtask of G respectively. Similarly, λ={λ1,...,λ |λ|} represents the set of all complete paths. We use len(λ α ) represents the complete path λ α The length of is calculated by formula (1).
[0114]
[0115] If there is a complete path through v i and v j (Prioritize through v i ), then v i Yes j Ancestor, v j Yes i We use ans(v i ) means all vi The set of ancestors, des(v i ) means all v i The set of descendants.
[0116] Figure 2 A typed DAG task based on partition scheduling is shown. The 12 subtasks of the typed DAG task belong to two types (red represents type 1 and blue represents type 2). The system contains two types of cores, and the number of cores of each type is 2, that is, Θ = {θ1, θ2} and m1 = m2 = 2. Each subtask contains two parameters, which represent the worst-case execution time of the subtask and the core to which it is assigned. For example, v2 below It means c2=2 and v2 is assigned to the second core of the first type of core, and v2 can only be executed on this core.
[0117] 4. WCRT Analysis of Typed DAG Tasks
[0118] 4.1 The latest WCRT analysis method and existing problems
[0119] The latest WCRT analysis algorithm applicable to typed DAG tasks based on partition scheduling is shown in formula (2) [7], where Indicates potential blocking λ α The set of Δ(v i ) can be calculated by formula (3).
[0120]
[0121]
[0122] At present, the main way to calculate the WCRT of DAG tasks based on partition scheduling is to convert it into the worst-case response time of all complete paths (as shown in formula (2) and formula (3)). Since this method does not deeply analyze the impact of the topological structure of the typed DAG task on the WCRT analysis, this type of analysis method has a high analysis error. For example, Figure 3 Shown Figure 2 The worst-case execution of the typed DAG tasks shown in . We assume λ1 = {v0, v2, v6, v9, v 10 , v 11}, according to the above α ) we know that v5 belongs to Δ(λ1). However, Figure 3 We know that v5 does not interfere with Δ(λ1). In addition, according to the analytical theory of formula (2), v8 will interfere with v6 for 2 units of time. However, according to Figure 3As shown, v8 only interferes with v6 for 1 unit of time.
[0123] In summary, although typed DAG tasks based on partition scheduling have advantages over continuous work scheduling in some cases, the existing WCRT analysis methods have large errors. Therefore, it is necessary to propose a more accurate WCRT analysis method for typed DAG tasks based on partition scheduling.
[0124] 4.2 WCRT analysis based on life cycle
[0125] Before introducing the life cycle-based WCRT analysis method, we first introduce several necessary definitions and lemmas.
[0126] Definition 1: We use EBT(v i ) and EFT(v i ) to represent the subtask v i The earliest start time and the earliest end time of EBT(v i ) and EFT(v i ) can be calculated by formula (4) and formula (5).
[0127]
[0128] EFT(v i )=EBT(v i )+c i (5)
[0129] Definition 2: We use LBT(v i ) and LFT(v i ) to represent the subtask v i The latest start time and the latest end time of LBT(v i ) and LFT(v i ) can be calculated by formula (4) and formula (5), where B(v i ) indicates v i The total amount of obstruction.
[0130]
[0131] LFT(v i )=LBT(v i )+c i (7)
[0132] Lemma 1: For any member of the set Δ(v i )'s subtask v j , only when the following two conditions are met at the same time v j Will block v iexecution.
[0133] (1) EBT(v j )≤LFT(v i )-c i
[0134] (2) LFT(v j )>EBT(v i )
[0135] Proof: Assume that EBT(v j )>LFT(v i )-c i According to formula (6), LFT(v i )-c i v i The latest start time. If LFT(v j )>LBT(v i ), then v j Will not block v i execution, because v i Once execution begins, it will not be blocked. Similarly, if v j In v i The execution is completed before the earliest start, then v j Will not block v i That is to say, if LFT(v i )≤EBT(v i ), then v j Will not block v i .
[0136] For any one of the sets Δ(v i )'s subtask v j , we define 3 variables:
[0137] 1)x1:v j Cannot block v i
[0138] 2)x2: EBT(v j )≤LFT(v i )-c i ,
[0139] 3)x3: LFT(v j )≤EBT(v i ).
[0140] Then we will get the following true proposition: Therefore, the converse of this true proposition is
[0141]
[0142] is true. Therefore, the lemma is proved.
[0143] According to Lemma 1, if v j Blocking i Only when in
[0144]
[0145] Next, we use LFT(v j ) and EBT(v i )Will Divided into two independent subsets.
[0146] Definition 3: We define two subsets.
[0147] 1)
[0148] 2)
[0149] Lemma 2: v i Received The total blocking of neutron tasks will not exceed
[0150] Proof: We first use proof by contradiction to prove Only one subtask will actually block v i . Assume that any two Different subtasks in v j and v k Blocking v i Without loss of generality, assume that v j Block v first i We use F(v j ) to represent v j The completion time, then F(v j )>F(v k )>EBT(v i ). According to the assumption, we know
[0151]
[0152] In the worst case, and Therefore, at most At most one of the subtasks in v will block i .
[0153] for Any subtask v k , he can block v i At most LFT(vj )-EBT(v i ). Therefore, v i Received The total blocking of neutron tasks is at most
[0154] Theorem 1: v i The upper bound of the total blocking value is B(v i ), where B(v i ) can be calculated by formula (8).
[0155]
[0156] Theorem 1 can be easily proved by Lemma 1 and Lemma 2.
[0157] Reasoning 1: The upper bound of the WCRT of the typed DAG task based on partition scheduling can be calculated by formula (9):
[0158]
[0159] in It can be calculated by formula (10), and
[0160]
[0161] Proof: For any subtask v i , LFT(v i ) consists of three parts
[0162] 1)PCB(v i ):v i a start time that satisfies all precedence constraints,
[0163] 2) B(v i ):v i The total amount of blocking
[0164] 3)c i :v i WCET
[0165] Among them, PCB (v i )equal B(v i ) can be obtained by formula (8). Therefore,
[0166]
[0167] Use R′(v i ) represents the right side of formula (11), then LFT(v i )≤R′(v i). We use Replace R′(v i ) in LFT(v i ).So, therefore, in It can be calculated by formula 10.
[0168] 4.3 Earliest Start Time Iteration (EOI) Algorithm
[0169]
[0170] Algorithm 1 shows the pseudo code of the EOI algorithm to calculate The key part of Algorithm 1 is mainly step 5 and its sub-steps, which contain 4 loops in total, and each loop does not exceed |V| times at most. Therefore, the time complexity of Algorithm 1 is O(|V| 4 ). The space occupied by the finite variables in Algorithm 1 does not exceed |V| 2 Therefore, the space complexity of Algorithm 1 is O(|V| 2 ).
[0171] 5. Allocation strategy based on residual load
[0172] According to the analysis algorithm proposed in Chapter 4 (Formula (10) and Formula (11)), we know that the set pre(v i ) and collection The smaller the latest end time of the neutron task, The smaller the value of . In order to minimize This paper proposes a heuristic allocation strategy of minimizing remaining workload (MRW) with a greedy strategy as the core to reduce the worst-case response time of typed DAG tasks. The main idea of the algorithm is to calculate the current remaining workload of all cores of the type to which it belongs when allocating each subtask, and allocate the subtask to the core with the smallest remaining workload, thereby reducing its latest end time and thus reducing
[0173]
[0174] Algorithm 2 mainly consists of two loops, namely step 5 and its sub-steps. In the worst case, any sub-task v in the typed DAG task i There is a directed edge pointing to other subtasks that are not its ancestors. Therefore, the initialization of step 1 and step 2 is executed at most |V|*(|V|-1) / 2 times. Step 5 is executed at most |V| times, and each cycle will update times the remaining load of all cores. Therefore, the time complexity of Algorithm 2 is The space occupied by the finite number of variables in Algorithm 2 does not exceed |V|. Therefore, the space complexity of Algorithm 2 is O(|V|).
[0175] 6 Experiments
[0176] 6.1 Typed DAG task generation
[0177] We assume that the relative deadline of each task is D = 1000. Therefore, we can not only compare the WCRT obtained by using different allocation and analysis algorithms for the same typed DAG task, but also compare the schedulability of the task. If a typed DAG task can be completed within its deadline, we call it schedulable. Otherwise, it is called unschedulable. We use U i =c i / D to represent v i The generation of typed DAG tasks is based on the four parameters in Table 1, where
[0178] Table 1 Typed DAG task generation parameter table
[0179]
[0180] We use the Randfixedsum method mentioned in [7] and [9] to generate the utilization of each subtask. Then, we use formula c i =U i *1000 to calculate the worst-case execution time of each subtask. The topology of the typed DAG task is generated by the GenerateG(|V|, pr) method mentioned in [3] and [7].
[0181] We use the proportion assignment PA method proposed in [3] to initialize the type of each subtask. In addition, we use the Worst-Fit (WF) algorithm and the MRW algorithm proposed in this paper as two strategies for assigning subtasks to cores to compare the performance of the EOI analysis algorithm proposed in this paper and the latest analysis algorithm proposed in [7]. This paper compares a total of four analysis scenarios (two core allocation strategies, two analysis algorithms). For example, PA-WF-Wu means using the analysis algorithm in [7] to analyze the typed DAG tasks based on the PA type allocation method and the WF allocation strategy. For each comparison sample of different scheduling scenarios (four combinations of different type allocation methods and core allocation strategies) in the experiment, we generate 5,000 typed DAG tasks.
[0182] 6.2 Experimental results and analysis
[0183] Figure 4 The schedulability comparison chart based on PA core allocation method is shown, where Figure 4 (a) shows the different U f Experimental results. The experimental results show that the MRW allocation strategy and EOI analysis algorithm proposed in this paper have a higher schedulability rate than the WF allocation strategy and Wu analysis method. For the same typed DAG task, the schedulability rate obtained based on the EOI analysis algorithm is 35.84% higher than that obtained based on the Wu analysis algorithm on average. Specifically, the schedulability rate of the analysis scenario PA-WF-EOI is 35.06% higher than that of PA-WF-Wu on average. Similarly, the schedulability rate of the analysis scenario PA-MRW-EOI is 36.61% higher than that of PA-MRW-Wu on average. Figure 4 (b)-(d) show the experimental results of varying S, |V| and pr respectively. The results of the three sub-graphs show that the schedulability of the EOI analysis algorithm is 19.36%, 43.26% and 27.77% higher than that of the Wu analysis algorithm on average. In the four sub-graphs, the schedulability of the MRW allocation strategy is 4.13%, 2.57%, 4.18% and 3.02% higher than that of the WF allocation algorithm on average.
[0184] Figure 5 A comparison of the worst-case response time based on the PA core allocation method is shown. Figure 5 (a)-(d) show Figure 4 (a)-(d) The worst-case response time corresponding to the experimental results. The four sub-figures show that the worst-case response time based on the EOI analysis algorithm is 28.22%, 31.27%, 40.87% and 44.27% lower than that of the Wu analysis algorithm on average. Similarly, the worst-case response time based on the MRW allocation strategy is 26.34%, 16.27%, 12.11% and 10.06% lower than that of the WF allocation algorithm on average.
[0185] comprehensive Figure 4 and Figure 5 The experimental results show that the schedulability rate and worst-case response time performance of PA-MRW-EOI are improved by 34.96% and 26.46% respectively compared with PA-WF-Wu.
[0186] The references cited in this invention are as follows:
[0187] [1]Chishiro,Hiroyuki,et al.″Towards heterogeneous computing platformsfor autonomous driving.″2019IEEE International Conference on EmbeddedSoftware and Systems(ICESS).IEEE,2019.
[0188] [2]Andrade,Hugo,et al.″Software challenges in heterogeneouscomputing:A multiple case study in industry.″201945th Euromicro Conference onSoftware Engineering and Advanced Applications(SEAA).IEEE,2019.
[0189] [3]Han,Meiling,et al.″Response time bounds for typed DAG paralleltasks on heterogeneous muIti-cores.″IEEE Transactions on Parallel andDistributed Systems 30.11(2019):2567-2581.
[0190] [4]Jaffe,Jeffrey M.″Bounds on the scheduling of typed task systems.″SIAM Journal on Computing 9.3(1980):541-551.
[0191] [5]Serrano,Maria A.,and Eduardo Quinones.″Response-time analysis ofDAG tasks supporting heterogeneous computing.″Proceedings of the 55th AnnualDesign Automation Conference.2018.
[0192] [6]Zhao,Shuai,et al.″DAG scheduling and analysis on multiprocessorsystems:Exploitation of parallelism and dependency.″2020IEEE Real-TimeSystems Symposium(RTSS).IEEE,2020.
[0193] [7]Wu,Yulong,et al.″Improving interference analysis for real-time dagtasks under partitioned scheduling.″IEEE Transactions on Computers 71.7(2021):1495-1506.
[0194] [8]López,José María,José Luis Díaz,and Daniel F.García.″Utilizationbounds for EDF scheduling on real-time multiprocessor systems.″Real-TimeSystems 28(2004):39-68.
[0195] [9]Emberson,Paul,Roger Stafford,and Robert I.Davis.″Techniques forthe synthesis of muItiprocessor tasksets.″proceedings 1st InternationalWorkshop on Analysis Tools and Methodologies for Embedded and Real-timeSystems(WATERS 2010).2010。
Claims
1. An analysis and scheduling method based on typed DAG tasks on heterogeneous multi-core platforms, Features: The implementation process of the analysis and scheduling method is as follows: WCRT analysis of typed DAG tasks 1) WCRT analysis based on life cycle First, the definitions and lemmas are given: Definition 1: Use EBT(v i ) and EFT(v i ) to represent the subtask v i The earliest start time and the earliest end time; EBT (v i ) and EFT(v i ) can be calculated by formula (4) and formula (5); EFT(v i )=EBT(v i )+c i (5) Definition 2: Use LBT(v i ) and LFT(v i ) to represent the subtask v i The latest start time and the latest end time of LBT(v i ) and LFT(v i ) can be calculated by formula (6) and formula (7), where B(v i ) indicates v i The total amount of time blocked; LFT(v i )=LBT(v i )+c i (7) Lemma 1: For any member of the set Δ(v i )'s subtask v j , only when the following two conditions are met at the same time v j Will block v i Implementation of (1)EBT(v j )≤LFT(v i )-c i (2)LFT(v j )>EBT(v i ) Proof of the correctness of Lemma 1: Assume that EBT(v j )>LFT(v i )-c i According to formula (7), LFT(v i )-c i v i The latest start time of v j Will not block v i execution, because v i Once execution starts, it will not be blocked; Similarly, if v j In v i The execution is completed before the earliest start, then v j Will not block v i ; That is to say, if LFT(v i )≤EBT(v i ), then v j Will not block v i ; For any one belonging to the set Δ(v i )'s subtask v j , define three variables: 1)x 1 :v j Cannot block v i 2)x 2 :EBT(v j )>LFT(v i )-c i , 3)x 3 :LFT(v j )≤EBT(v i ); Then we get the following true proposition: Therefore, the converse of this true proposition is: ∨ means or, represents negation, ∧ represents and; is true, so Lemma 1 is proved; According to Lemma 1, if v j Blocking i Only when in According to LFT(v j ) and EBT(v i )Will Divided into two independent subsets; Definition 3: Define two subsets as: 1) 2) Lemma 2: v i Received The total blocking of neutron tasks will not exceed Prove the correctness of Lemma 2: First, use proof by contradiction to prove Only one subtask will actually block v i ; Assume that any two Different subtasks in v j and v k Blocking v i ; Assume v j Block v first i ; Use F(v j ) to represent v j The completion time, then F(v k )>F(v j )>EBT(v i ); According to the assumption, In the worst case, and The assumptions of At most one of the subtasks in v will block i ; for Any subtask v j , he can block v i At most LFT(v j )-EBT(v i ); therefore, v i Received The total blocking of neutron tasks is at most Theorem 1: v i The upper bound of the total blocking value is B(v i ), where B(v i ) can be calculated by formula (8); Theorem 1 can be proved by Lemma 1 and Lemma 2; Corollary 1: The upper bound of the WCRT of the typed DAG task based on partition scheduling can be calculated by formula (9): in It can be calculated by formula (10), and Proof Corollary 1: For any subtask v i , LFT(v i ) consists of three parts 1)PCB(v i ):v i a start time that satisfies all precedence constraints, 2) B(v i ):v i The total amount of obstruction, 3)c i :v i WCET, Among them, PCB (v i )equal B(v i ) can be obtained by formula (8); therefore, Use R′(v i ) represents the right side of formula (11), then LFT(v i )≤R′(v i );use Replace R′(v i ),So, therefore, in It can be calculated by formula (10); According to formula (10), Depends on where v j Yes i The previous subtask of v sink The upper bound of the ancestor's WCRT can be obtained However, for a subtask v i , since we do not know LFT(v i ), so it is impossible to directly find Therefore, the EOI algorithm is proposed, through iterative calculation 2) Iteration (EOI) algorithm calculation based on the earliest start time The process is: EBT-orderiteration is referred to as EOI, and earliest beginning time is referred to as EBT; Input: Typed DAG task G Output: Step 1: Calculate the earliest start time and earliest end time of each subtask according to formula (4) and formula (5); Step 2: Initialize each subtask Step 3: Initialize Δ={Δ(v source ),…,Δ(v sink )}; Represents subtask v i Assigned to the kth core of the jth type core; Step 4: Create a temporary variable Temp_V to store the subtask set V; Step 5: If Temp_V is not empty, select subtask v from Temp_V i ,in Otherwise, proceed to step 6; Step 5.1: Initialize variable I′(v i )=0; Step 5.2: For Each subtask v in j ,renew Then v j From Δ(v i ) are removed; Step 5.3: Update Step 5.4: Initialization Step 5.5: If and If they are not equal, then Otherwise, proceed to step 5.6; Step 5.5.1: For Δ(v i ) satisfies each Subtask v j Follow steps 5.5.1.1 and 5.5.1.2; Step 5.5.1.1: Update And put v j From Δ(v i ) are removed; Step 5.5.1.2: For each des(v i ) in the subtask v k ,make Step 5.5.1.3: If v j In Δ(v i ), then put v j From Δ(v i ) are removed; Step 5.5.2: Repeat step 5.5; Step 5.6: Set v i Eliminate from Temp_V and repeat step 5; Step 6: Output Allocation strategy based on residual load According to the above formula (10) and formula (11), we can know that the set pre(v i ) and collection The smaller the latest end time of the neutron task, The smaller the value of A heuristic allocation strategy based on the greedy strategy of minimizing remaining workload (MRW) is proposed to reduce the worst-case response time of typed DAG tasks. When allocating each subtask, the current remaining workload of all cores of the type to which it belongs is calculated, and the subtask is allocated to the core with the smallest remaining workload, thereby reducing its latest end time and thus reducing Make output Smaller.
2. According to claim 1, a method for analyzing and scheduling typed DAG tasks on a heterogeneous multi-core platform, Features: Using the heuristic allocation strategy of minimizing the remaining load to reduce The process is: Input: typed DAG task G, system core type set Θ = {Θ 1 ,…,Θ S }; Output: The core set T to which subtasks are assigned; Step 1: Initialize the earliest start time and earliest end time of each subtask according to formula (4) and formula (5); Step 2: Initialize the remaining load on each core in represents the residual load of the jth core of the i-th type core; Step 3: Initialize the current time CT = 0; Step 4: Create a temporary variable Temp_V to store the subtask set V; Step 5: If Temp_V is not empty, select subtask v from Temp_V i ,in Otherwise, proceed to step 6; Step 5.1: For each core of each type, update its remaining load Step 5.2: CT = EBT (v i ); Step 5.3: Assign v i The core, in Step 5.4: Update Step 5.5: Set v i Eliminate from Temp_V and repeat step 5; Step 6: Output T.
3. According to claim 2, a method for analyzing and scheduling typed DAG tasks on a heterogeneous multi-core platform, Features: The earliest start time iteration (EOI) algorithm contains 4 loops, and each loop has no more than |V| times, and its time complexity is O(|V| 4 ); The space occupied by the finite variables in the algorithm does not exceed |V| 2 , the space complexity of the EOI algorithm is O(|V| 2 ).
4. An analysis and scheduling system based on typed DAG tasks on heterogeneous multi-core platforms, Features: The system has a program module corresponding to the steps of any one of claims 1 to 3 above, and executes the steps in the analysis and scheduling method of typed DAG tasks based on a heterogeneous multi-core platform during runtime.
5. A computer-readable storage medium, Features: The computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of a method for analyzing and scheduling typed DAG tasks on a heterogeneous multi-core platform according to any one of claims 1 to 3 when called by a processor.
Citation Information
Patent Citations
Methods for the preparation of organotin compounds
EP0002019A1
Interference analysis method among DAG real-time tasks based on division scheduling on multi-core processor
CN111176817A
Division scheduling-based heuristic processor division method and system for DAG task and storage medium
CN112463346A
DAG task WCRT calculation method based on SMT method
CN113961439A
Processor resource allocation method based on DAG task topological structure and storage medium
CN114880111A
