• No se han encontrado resultados

CAPÍTULO 3: VALORACIÓN DE LA ESTRATEGIA

3.4. Conclusiones

This section shows the correctness and complexity of the ES-AS approach.

The correctness ensures the system schedulability in terms of meeting the task deadlines. The complexity gives the run-time overhead analysis of the approach.

Theorem 6.3.1. The ES-AS approach always guarantees system schedula-bility.

Proof. Since the ES-AS approach is divided into two stages, the system schedulability is proven for ES and AS, respectively. In ES one solution is explored in one hyper period. Since the initial solution obtained by assigning

Algorithm 11 DPM Activity at each scheduling point in AS (RTSC)

1: if There is a task τifinishing or being preempted then

2: for all Rj∈ Dev(τi) and the processor do

3: Retrieve the next activation event according to index and compute the length of the next idle interval. Based on the length it is to be decided, whether the component can be switched off to a proper low power state. If the component is switched off, it will be waked up a little ahead of the next activation time.

4: Advance the variable index in the event list of Rjand the processor.

5: end for

6: end if

7: if There is a task τistarting or being resumed then

8: if Current time is equal to the recorded time then

9: Run the task τi

10: for all Rj∈ Dev(τi) and the processor do

11: Advance the variable index in the event list of Rjand the proces-sor

12: end for

13: else

14: Wait until the recorded time

15: end if

16: end if

all the tasks with the maximal speed is clearly schedulable (otherwise there is no valid solution at all), in the first hyper period there will be no task miss-ing its deadline. Note that in ES all the components are never switched off (even when they are idle), thus no task will be delayed due to state switching overhead. This is also the reason why the traditional schedulability test via utilization can be performed. At the end of the first hyper period the solution for the next hyper period is generated. As a schedulability test is carried out, and only if the test is positive, the generated solution will be used in the next hyper period (otherwise the initial solution is used), thus the schedulability is guaranteed as well. The procedure repeats at the end of each hyper period, therefore the solution used in each hyper period is obviously feasible.

In AS the best solution found in ES is applied and obviously this solution is schedulable. Furthermore, since all the components are switched on as recorded and all the tasks are activated as recorded, no task will be delayed and therefore no task will finish later than its recorded finishing time, which is obtained under worst case condition. Therefore no task will miss its deadline.

In total, the system schedulability is always guaranteed.

Theorem 6.3.2. The ES-AS approach has a complexity of O(m · c) at each scheduling point and O(n) at each hyper period boundary. n is the number

task scheduling

exploration stage application stage

solution generation

events recording power state scheduling

hyper period end evaluation & comparison waiting for task event

schedulability test

power consumption recording Algorithm

Activity

Recording Activity DPM

Activity

Figure 6.6: Overview of the activities taken in ES-AS approach

of tasks, m is the number of devices and c is the maximal number of supported low power states by a component.

Proof. The theorem is proven in two steps. In the first step the complexity at each hyper period boundary is shown and the complexity at each scheduling point is proven in the second step.

Looking at Figure 6.6, the only activity taken at hyper period boundaries is AA. At the end of each hyper period, it starts with the evaluation of the cur-rent solution. The evaluation takes O(1), because through run-time energy recording the energy consumption of a solution is automatically available at the end of a hyper period. Afterward, the current solution is compared with the previous solution to decide whether a movement to the current solution should be made. This clearly takes O(1) time. Depending on the acceptance result, a neighbor solution needs to be generated for the next hyper period.

Though only the speed assignment of one task needs to be changed, gen-erating the random number based on a non-uniform distribution has linear complexity O(n). As shown in Chapter 4, the non-uniform distribution of the task selection probability is caused by the penalty function. After the gener-ation process, the new solution is to be tested whether it can ensure system schedulability. This is usually performed by means of a processor utiliza-tion test. For both EDF and RM scheduling algorithms, the test takes O(1), because only the utilization of the changed task needs to be updated. As a

summary, AA takes O(n) time in total and thus the time complexity of the ES-AS approach at hyper period boundaries is O(n).

There are two activities taken at each scheduling point. The first one is RA, which mainly records events and energy consumption. Obviously, the record-ing process for a srecord-ingle component takes only O(1) . At one schedulrecord-ing point there can be at most m components getting involved, where m is the num-ber of components in the system including all the devices and the processor.

Therefore RA takes O(m) time at each scheduling point. The second activity is DA, which takes care of the job of the power state scheduling. As shown in Algorithm 11, the most time consuming work is described at the line 3.

Hereby DA needs to investigate the break-even time of all the low power states and decide whether the component can be switched off to a particular low power state. If the maximal number of the available low power states for a component is assumed to be c, then the time complexity of DA is O(c) for each component. In summary, the run-time overhead of the ES-AS approach at each scheduling point is O(m · c) in total.

Since m and c are often relatively small and constant, the run-time overhead of ES-AS approach at each scheduling point can be considered as O(1).

Documento similar