• No se han encontrado resultados

¿DE LA SITUACIÓN IRREGULAR A LA PROTECCIÓN INTEGRAL?

2) MODELO DE SITUACIÓN IRREGULAR

In the previous section, we showed how to bound Ik(Ji), the workload of an individual job. However, we only characterized the workload as the maximum between a computation phase and a memory sequence as in Theorem 1. It is clear that Ik(Ji) depends on the computation phase of Ji and a possible hole induced by a memory sequence from other jobs. Therefore, Ik(Ji) should be considered globally to determine a safe bound on Ik(Γ).

For a given set of computation phases and memory sequences, we can derive a bound on Ik(Γ) as in the following lemma.

Lemma 6. After sorting computation phases X = {θ1, . . . , θ|X|} such that θi ≤ θi+1 and memory sequences such that ρi ≥ ρi+1, the following is a valid bound on Ik(Γ):

|X| X

i=1

max(θi, ρi).

Proof. Based on Theorem 1, the length of each scheduling interval is upper bounded by the length of the corresponding computation phase or a memory sequence; hence, we take max(θi, ρi).

By contradiction, assume that there exists a hypothetical configuration of pairs different than the one in the hypothesis that leads to a strictly higher bound. Since computation and memory sequence lengths are ordered in opposite directions in the hypothesis, it follows that in the hypothetical configuration there must instead exist two pairs (θs, ρs) and (θl, ρl), such that θs < θl and ρs < ρl (i.e., ordered in the same direction). We now show that “swapping” θs with θl leads to a new configuration with a Ik(Γ) bound no less than the previous one. Since we can always obtain the configuration in the hypothesis with a finite number of such “swaps” (for example, using bubble sort), this creates a contradiction.

We let a = max(θs, ρs) and b = max(θl, ρl), and the bound is a + b. We have four cases after swapping θs with θl based on the two terms a and b and given that θs< θl: (1) both remain the same. (2) a increases and b remains the same. (3) a remains the same and b decreases. (4) a increases and b decreases. Clearly, (1) and (2) will not decrease the bound. Thus, we only need to consider (3) and (4).

Case(3): To satisfy this case, we should have ρs > θl (a remains the same) and ρl< θl (b decreases), but we obtain ρs > ρl which is a contradiction.

Case(4): This case is more elaborate than the previous one. In order to satisfy this case, we should have θl > ρs (a increases) and θl> ρl (b decreases). Now, we consider two

sub-cases. (i) θs≥ ρs: based on these assumptions, the bound before the exchange is θs+θl and after the exchange is θl+ max(θs, ρl) which is larger or equal. (ii) θs< ρs: the bound before the exchange is ρs+ θl and after the exchange is θl+ max(θs, ρl) = θl+ ρl, which is larger. After we examine all possible cases, we can conclude that our initial argument is true.

Lemma 6 assumes a given set of memory sequences. However, we only have from interfering jobs a set of load LD and unload U D phases. As per Definition 4, a memory sequence contains m memory phases. Thus, we first discuss how to construct memory phases out of LD and U D. Then, we show how to construct memory sequences out of these memory phases.

Since the scheduler dynamically combines unload and load phases into one non-preemptive memory phase, the merged unload phase is generally unknown. We could safely assume for each job that its load phase is merged with the longest unload phase in the system, but this is highly pessimistic. Therefore, we instead propose to construct memory phases as in the following lemma.

Lemma 7. The set of memory phases Ψ = {µ1, . . . , µ|Ψ|} can be constructed by combining the longest load phases from LD with longest unload phases from U D to increase holes as much as possible.

Proof. Based on the ordering used in Lemma6, there must exist a worst case configuration for some value 1 ≤ j ≤ |X|, where in the first j pairs the length of memory sequences is larger or equal, and in the remaining |X| − j pairs the length of the computation phases is larger or equal. Hence, the bound on Ik(Γ) can be obtained by summing the largest j memory sequences and the largest |X| − j computation phases. By adding largest unload phases to largest load phases, we maximize the first j memory sequences. As a consequence, Ik(Γ) is also maximized.

The longest memory sequence is clearly ρmax = top(Ψ, m) as each memory sequence contains m memory phases. We could again safely assume that all computation phases overlap with the longest memory sequence. However, the following lemma adds a constraint that improves the bound on Ik(Γ).

Lemma 8. Let Ja → Jb and they both run on cl. In addition, assume Ik(Ja) and Ik(Jb) are two scheduling intervals with holes. Then, any memory phase executing in the problem window can contribute to either Ik(Ja) or Ik(Jb).

Proof. Since the scheduling interval [ts(Ja), ts(Jb)) of Ja contains holes, i.e., it equals to a memory sequence, a memory phase targeting core cl must finish exactly at ts(Jb). Hence, such memory phase and all previous memory phases can contribute only to Ik(Ja). On the other hand, all following memory phases can contribute only to Ik(Jb).

Based on Lemma8, each memory phase can contribute to at most one memory sequence on each core, i.e., m memory sequences in total. Therefore, we propose to construct memory sequences ρi out of memory phases µi as follows: ρi = m × µi. This guarantees that each memory phase appears at most m times in Ik(Γ). Furthermore, following the proof of Lemma7, by combining the largest memory sequences together, we maximize the the sum of the first j memory sequences as computed in Lemma 6; hence, the bound on Ik(Γ) is also maximized.