Commit d5cf8f9d authored by Felipe Cerqueira's avatar Felipe Cerqueira
Browse files

Keep only the definition of parallel interference

parent 7ac7144a
This diff is collapsed.
This diff is collapsed.
......@@ -193,8 +193,8 @@ Module InterferenceBoundEDF.
(* Let's call x the task interference incurred by job j due to tsk_k. *)
Let x :=
task_interference_sequential job_cost job_task sched j_i
tsk_k (job_arrival j_i) (job_arrival j_i + delta).
task_interference job_cost job_task sched j_i tsk_k
(job_arrival j_i) (job_arrival j_i + delta).
(* Also, recall the EDF-specific interference bound for EDF. *)
Let interference_bound :=
......@@ -210,7 +210,7 @@ Module InterferenceBoundEDF.
Let n_k := div_floor D_i p_k.
(* Let's give a simpler name to job interference. *)
Let interference_caused_by := job_interference_sequential job_cost sched j_i.
Let interference_caused_by := job_interference job_cost sched j_i.
(* Identify the subset of jobs that actually cause interference *)
Let interfering_jobs :=
......@@ -299,7 +299,7 @@ Module InterferenceBoundEDF.
intros j; rewrite mem_filter; move => /andP [/andP [/eqP JOBj _] _].
specialize (PARAMS j); des.
apply leq_trans with (n := service_during sched j t1 t2);
first by apply job_interference_seq_le_service.
first by apply job_interference_le_service.
by apply cumulative_service_le_task_cost with (job_task0 := job_task)
(task_deadline0 := task_deadline) (job_cost0 := job_cost)
(job_deadline0 := job_deadline).
......@@ -393,7 +393,7 @@ Module InterferenceBoundEDF.
destruct FST as [_ [ FSTserv _]].
move: FSTserv => /negP FSTserv; apply FSTserv.
rewrite -leqn0; apply leq_trans with (n := service_during sched j_fst t1 t2);
first by apply job_interference_seq_le_service.
first by apply job_interference_le_service.
rewrite leqn0; apply/eqP.
by apply cumulative_service_after_job_rt_zero with (job_cost0 := job_cost) (R := R_k);
try (by done); apply ltnW.
......@@ -435,20 +435,20 @@ Module InterferenceBoundEDF.
completed job_cost sched j_fst (a_fst + R_k).
Lemma interference_bound_edf_holds_for_single_job_that_completes_on_time :
job_interference_sequential job_cost sched j_i j_fst t1 t2 <= D_i - (D_k - R_k).
job_interference job_cost sched j_i j_fst t1 t2 <= D_i - (D_k - R_k).
Proof.
rename H_j_fst_completed_by_rt_bound into RBOUND.
have AFTERt1 :=
interference_bound_edf_j_fst_completion_implies_rt_bound_inside_interval RBOUND.
have FST := interference_bound_edf_j_fst_is_job_of_tsk_k.
destruct FST as [_ [ LEdl _]].
apply interference_seq_under_edf_implies_shorter_deadlines with
apply interference_under_edf_implies_shorter_deadlines with
(job_deadline0 := job_deadline) in LEdl; try (by done).
destruct (D_k - R_k <= D_i) eqn:LEdk; last first.
{
apply negbT in LEdk; rewrite -ltnNge in LEdk.
apply leq_trans with (n := 0); last by done.
apply leq_trans with (n := job_interference_sequential job_cost sched j_i j_fst
apply leq_trans with (n := job_interference job_cost sched j_i j_fst
(a_fst + R_k) t2).
{
apply extend_sum; last by apply leqnn.
......@@ -460,7 +460,7 @@ Module InterferenceBoundEDF.
by apply ltnW; rewrite -ltn_subRL.
}
apply leq_trans with (n := service_during sched j_fst (a_fst + R_k) t2);
first by apply job_interference_seq_le_service.
first by apply job_interference_le_service.
unfold service_during; rewrite leqn0; apply/eqP.
by apply cumulative_service_after_job_rt_zero with (job_cost0 := job_cost) (R := R_k);
try (by done); apply leqnn.
......@@ -473,7 +473,7 @@ Module InterferenceBoundEDF.
rewrite addnC -subnBA; last by apply leq_addr.
by rewrite addnC -addnBA // subnn addn0.
}
apply leq_trans with (n := job_interference_sequential job_cost sched j_i j_fst t1
apply leq_trans with (n := job_interference job_cost sched j_i j_fst t1
(a_fst + D_k) + (D_k - R_k)).
{
rewrite leq_add2r.
......@@ -484,15 +484,15 @@ Module InterferenceBoundEDF.
by rewrite leq_add2l; apply H_R_k_le_deadline.
}
{
unfold job_interference_sequential.
unfold job_interference.
apply negbT in LEt2; rewrite -ltnNge in LEt2.
rewrite -> big_cat_nat with (n := a_fst + R_k);
[simpl | by apply AFTERt1 | by apply ltnW].
apply leq_trans with (n := job_interference_sequential job_cost sched j_i j_fst t1
apply leq_trans with (n := job_interference job_cost sched j_i j_fst t1
(a_fst + R_k) + service_during sched j_fst (a_fst + R_k) t2).
{
rewrite leq_add2l.
by apply job_interference_seq_le_service.
by apply job_interference_le_service.
}
unfold service_during.
rewrite -> cumulative_service_after_job_rt_zero with
......@@ -502,14 +502,14 @@ Module InterferenceBoundEDF.
}
}
unfold job_interference_sequential.
unfold job_interference.
rewrite -> big_cat_nat with (n := a_fst + R_k);
[simpl| by apply AFTERt1 | by rewrite leq_add2l; apply H_R_k_le_deadline].
apply leq_trans with (n := job_interference_sequential job_cost sched j_i j_fst t1
apply leq_trans with (n := job_interference job_cost sched j_i j_fst t1
(a_fst+R_k) + service_during sched j_fst (a_fst+R_k) (a_fst+D_k) + (D_k-R_k)).
{
rewrite leq_add2r leq_add2l.
by apply job_interference_seq_le_service.
by apply job_interference_le_service.
}
unfold service_during.
rewrite -> cumulative_service_after_job_rt_zero with
......@@ -519,7 +519,9 @@ Module InterferenceBoundEDF.
\sum_(a_fst + R_k <= t < a_fst + D_k) 1).
{
apply leq_add; last by rewrite SUBST.
by unfold job_interference_sequential; apply leq_sum; ins; apply leq_b1.
rewrite big_const_nat iter_addn mul1n addn0.
rewrite -{1}[a_fst + R_k](addKn t1) -addnBA //.
by apply job_interference_le_delta.
}
rewrite -big_cat_nat;
[simpl | by apply AFTERt1 | by rewrite leq_add2l; apply H_R_k_le_deadline ].
......@@ -565,7 +567,7 @@ Module InterferenceBoundEDF.
by apply interference_bound_edf_response_time_bound_of_j_fst_after_interval.
}
apply/eqP; rewrite -[_ _ _ _ == 0]negbK; apply/negP; red; intro BUG.
apply interference_seq_under_edf_implies_shorter_deadlines with
apply interference_under_edf_implies_shorter_deadlines with
(job_deadline0 := job_deadline) in BUG; try (by done).
rewrite interference_bound_edf_j_fst_deadline
interference_bound_edf_j_i_deadline in BUG.
......@@ -583,14 +585,19 @@ Module InterferenceBoundEDF.
destruct FST as [FSTtask [LEdl _]].
have LTr := interference_bound_edf_response_time_bound_of_j_fst_after_interval.
apply subh3; last by apply LEdk.
apply leq_trans with (n := job_interference_sequential job_cost sched j_i j_fst t1
apply leq_trans with (n := job_interference job_cost sched j_i j_fst t1
(job_arrival j_fst + R_k) + (D_k - R_k));
first by rewrite leq_add2r; apply extend_sum; [by apply leqnn|].
apply leq_trans with (n := \sum_(t1 <= t < a_fst + R_k) 1 +
\sum_(a_fst + R_k <= t < a_fst + D_k)1).
{
apply leq_add; unfold job_interference;
first by apply leq_sum; ins; apply leq_b1.
apply leq_add.
{
rewrite big_const_nat iter_addn mul1n addn0.
rewrite -{1}[job_arrival j_fst + R_k](addKn t1) -addnBA;
first by apply job_interference_le_delta.
by apply leq_trans with (n := t1 + delta); first by apply leq_addr.
}
rewrite big_const_nat iter_addn mul1n addn0 addnC.
rewrite -subnBA; last by apply leq_addr.
by rewrite addnC -addnBA // subnn addn0.
......@@ -604,7 +611,7 @@ Module InterferenceBoundEDF.
rewrite big_const_nat iter_addn mul1n addn0 leq_subLR.
unfold D_i, D_k, t1, a_fst; rewrite -interference_bound_edf_j_fst_deadline
-interference_bound_edf_j_i_deadline.
by apply interference_seq_under_edf_implies_shorter_deadlines with
by apply interference_under_edf_implies_shorter_deadlines with
(job_deadline0 := job_deadline) in LEdl.
Qed.
......@@ -703,7 +710,7 @@ Module InterferenceBoundEDF.
instantiate (1 := elem); move => [LSTtsk [/eqP LSTserv LSTin]].
apply LSTserv; apply/eqP; rewrite -leqn0.
apply leq_trans with (n := service_during sched j_lst t1 t2);
first by apply job_interference_seq_le_service.
first by apply job_interference_le_service.
rewrite leqn0; apply/eqP; unfold service_during.
by apply cumulative_service_before_job_arrival_zero.
Qed.
......@@ -727,7 +734,7 @@ Module InterferenceBoundEDF.
rewrite ltnNge; apply/negP; red; intro BUG; apply SNDserv.
apply/eqP; rewrite -leqn0; apply leq_trans with (n := service_during
sched j_snd t1 t2);
first by apply job_interference_seq_le_service.
first by apply job_interference_le_service.
rewrite leqn0; apply/eqP.
by apply cumulative_service_before_job_arrival_zero.
}
......@@ -826,7 +833,7 @@ Module InterferenceBoundEDF.
}
have LST := interference_bound_edf_j_lst_is_job_of_tsk_k.
destruct LST as [_ [ LEdl _]].
apply interference_seq_under_edf_implies_shorter_deadlines with
apply interference_under_edf_implies_shorter_deadlines with
(job_deadline0 := job_deadline) in LEdl; try (by done).
unfold D_i, D_k in DIST; rewrite interference_bound_edf_j_lst_deadline
interference_bound_edf_j_i_deadline in LEdl.
......@@ -911,7 +918,7 @@ Module InterferenceBoundEDF.
destruct LST as [_ [ LSTserv _]].
unfold D_i, D_k, a_lst, t1; rewrite -interference_bound_edf_j_lst_deadline
-interference_bound_edf_j_i_deadline.
by apply interference_seq_under_edf_implies_shorter_deadlines with
by apply interference_under_edf_implies_shorter_deadlines with
(job_deadline0 := job_deadline) in LSTserv.
Qed.
......@@ -938,19 +945,23 @@ Module InterferenceBoundEDF.
}
destruct (leqP t2 (a_fst + R_k)) as [LEt2 | GTt2].
{
apply leq_trans with (n := job_interference_sequential job_cost sched j_i j_fst t1
apply leq_trans with (n := job_interference job_cost sched j_i j_fst t1
(a_fst + R_k));
first by apply extend_sum; rewrite ?leqnn.
by apply leq_sum; ins; rewrite leq_b1.
simpl_sum_const; rewrite -{1}[_ + R_k](addKn t1) -addnBA //.
by apply job_interference_le_delta.
}
{
unfold interference_caused_by, job_interference_sequential.
unfold interference_caused_by, job_interference.
rewrite -> big_cat_nat with (n := a_fst + R_k);
[simpl | by apply AFTERt1 | by apply ltnW].
rewrite -[\sum_(_ <= _ < _) 1]addn0; apply leq_add;
first by apply leq_sum; ins; apply leq_b1.
rewrite -[\sum_(_ <= _ < _) 1]addn0; apply leq_add.
{
simpl_sum_const; rewrite -{1}[_ + R_k](addKn t1) -addnBA //.
by apply job_interference_le_delta.
}
apply leq_trans with (n := service_during sched j_fst (a_fst + R_k) t2);
first by apply job_interference_seq_le_service.
first by apply job_interference_le_service.
rewrite leqn0; apply/eqP.
apply cumulative_service_after_job_rt_zero with (job_cost0 := job_cost) (R := R_k);
[ by done | | by apply leqnn].
......@@ -1029,7 +1040,7 @@ Module InterferenceBoundEDF.
destruct LST as [_ [ LSTserv _]].
unfold D_i, D_k, a_lst, t1; rewrite -interference_bound_edf_j_lst_deadline
-interference_bound_edf_j_i_deadline.
by apply interference_seq_under_edf_implies_shorter_deadlines
by apply interference_under_edf_implies_shorter_deadlines
with (job_deadline0 := job_deadline) in LSTserv.
Qed.
......
This diff is collapsed.
This diff is collapsed.
......@@ -556,23 +556,18 @@ Module InterferenceBoundEDFJitter.
\sum_(a_fst + J_k + R_k <= t < a_fst + D_k) 1).
{
apply leq_add; last by rewrite SUBST.
by unfold job_interference; apply leq_sum; ins; apply leq_b1.
simpl_sum_const; rewrite -{1}[_ + R_k](addKn a_i) -addnBA //;
last by apply leq_trans with (n := t1); first by apply leq_addr.
by apply job_interference_le_delta.
}
rewrite -big_cat_nat; simpl; last first.
rewrite -big_cat_nat; simpl; last by rewrite -addnA leq_add2l H_R_k_le_deadline.
{
rewrite -addnA leq_add2l.
by apply H_R_k_le_deadline.
}
{
by apply leq_trans with (n := t1); first by apply leq_addr.
}
{
rewrite big_const_nat iter_addn mul1n addn0 leq_subLR.
unfold D_i, D_k, t1, a_fst.
simpl_sum_const; rewrite leq_subLR; unfold D_i, D_k, t1, a_fst.
by rewrite -interference_bound_edf_j_fst_deadline
-interference_bound_edf_j_i_deadline.
}
by apply leq_trans with (n := t1); first by apply leq_addr.
Qed.
End ResponseTimeOfSingleJobBounded.
......@@ -652,9 +647,16 @@ Module InterferenceBoundEDFJitter.
apply leq_trans with (n := \sum_(t1 <= t < a_fst + J_k + R_k) 1 +
\sum_(a_fst + J_k + R_k <= t < a_fst + D_k)1).
{
apply leq_add; unfold job_interference;
first by apply leq_sum; ins; apply leq_b1.
rewrite big_const_nat iter_addn mul1n addn0 addnC.
apply leq_add; unfold job_interference.
{
simpl_sum_const.
rewrite -{1}[job_arrival j_fst + J_k + R_k](addKn t1) -addnBA;
first by apply job_interference_le_delta.
apply leq_trans with (n := a_i + J_i + delta); last by done.
apply leq_trans with (n := a_i + J_i); last by apply leq_addr.
by rewrite leq_add2l /J_i -H_job_of_tsk_i; apply PARAMS0.
}
simpl_sum_const; rewrite addnC.
rewrite -subnBA; last by rewrite -addnA leq_addr.
rewrite [a_fst + _]addnC -addnA [a_fst + _]addnC addnA.
rewrite -addnBA // subnn addn0.
......@@ -1034,14 +1036,18 @@ Module InterferenceBoundEDFJitter.
apply leq_trans with (n := job_interference job_cost job_jitter sched j_i j_fst t1
(a_fst + J_k + R_k));
first by apply extend_sum; rewrite ?leqnn.
by apply leq_sum; ins; rewrite leq_b1.
simpl_sum_const; rewrite -{1}[_ + _ + R_k](addKn t1) -addnBA //.
by apply job_interference_le_delta.
}
{
unfold interference_caused_by, job_interference.
rewrite -> big_cat_nat with (n := a_fst + J_k + R_k);
[simpl | by apply AFTERt1 | by apply ltnW].
rewrite -[\sum_(_ <= _ < _) 1]addn0; apply leq_add;
first by apply leq_sum; ins; apply leq_b1.
rewrite -[\sum_(_ <= _ < _) 1]addn0; apply leq_add.
{
simpl_sum_const; rewrite -{1}[_ + _ + R_k](addKn t1) -addnBA //.
by apply job_interference_le_delta.
}
apply leq_trans with (n := service_during sched j_fst (a_fst + J_k + R_k) t2);
first by apply job_interference_le_service.
rewrite leqn0; apply/eqP.
......
......@@ -290,9 +290,9 @@ Module ResponseTimeAnalysisEDF.
rewrite (bigD1_seq (job_task j_other)) /=; last by rewrite filter_uniq.
{
rewrite (eq_bigr (fun i => 0));
last by intros i DIFF; rewrite /schedules_job_of_task SCHED;apply/eqP;rewrite eqb0 eq_sym.
last by intros i DIFF; rewrite /task_scheduled_on SCHED;apply/eqP;rewrite eqb0 eq_sym.
rewrite big_const_seq iter_addn mul0n 2!addn0; apply/eqP; rewrite eqb1.
by unfold schedules_job_of_task; rewrite SCHED.
by unfold task_scheduled_on; rewrite SCHED.
}
rewrite mem_filter; apply/andP; split; last by apply FROMTS.
unfold jldp_can_interfere_with.
......@@ -300,7 +300,7 @@ Module ResponseTimeAnalysisEDF.
assert (SCHED': scheduled sched j_other t).
{
unfold scheduled, scheduled_on.
by apply/exists_inP; exists cpu; [by done | rewrite SCHED].
by apply/existsP; exists cpu; rewrite SCHED.
}
clear SCHED; rename SCHED' into SCHED.
move: (SCHED) => PENDING.
......
......@@ -9,7 +9,7 @@ Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop div path.
Module ResponseTimeAnalysisFP.
Export Job SporadicTaskset Schedule Workload Interference InterferenceBoundFP
Export Job SporadicTaskset ScheduleOfSporadicTask Workload Interference InterferenceBoundFP
Platform PlatformFP Schedulability ResponseTime Priority SporadicTaskArrival WorkloadBound.
Section ResponseTimeBound.
......@@ -281,23 +281,23 @@ Module ResponseTimeAnalysisFP.
rewrite (bigD1_seq (job_task j_other)) /=; last by rewrite filter_uniq.
{
rewrite (eq_bigr (fun i => 0));
last by intros i DIFF; rewrite /schedules_job_of_task SCHED;apply/eqP;rewrite eqb0 eq_sym.
last by intros i DIFF; rewrite /task_scheduled_on SCHED;apply/eqP;rewrite eqb0 eq_sym.
rewrite big_const_seq iter_addn mul0n 2!addn0; apply/eqP; rewrite eqb1.
by unfold schedules_job_of_task; rewrite SCHED.
by unfold task_scheduled_on; rewrite SCHED.
}
rewrite mem_filter; apply/andP; split; last by apply FROMTS.
unfold can_interfere_with_tsk, fp_can_interfere_with.
apply/andP; split.
{
rewrite -JOBtsk; apply FP with (t := t); first by done.
by apply/exists_inP; exists cpu; last by apply/eqP.
by apply/existsP; exists cpu; apply/eqP.
}
{
apply/eqP; intro SAMEtsk.
assert (SCHED': scheduled sched j_other t).
{
unfold scheduled, scheduled_on.
by apply/exists_inP; exists cpu; [by done | rewrite SCHED].
by apply/existsP; exists cpu; rewrite SCHED.
} clear SCHED; rename SCHED' into SCHED.
move: (SCHED) => PENDING.
apply scheduled_implies_pending with (job_cost0 := job_cost) in PENDING; try (by done).
......
......@@ -240,9 +240,9 @@ Module InterferenceBoundEDF.
last by rewrite andFb (eq_bigr (fun x => 0));
first by rewrite big_const_seq iter_addn mul0n addn0.
rewrite andTb.
destruct (schedules_job_of_task job_task sched tsk_k cpu t) eqn:SCHED;
destruct (task_scheduled_on job_task sched tsk_k cpu t) eqn:SCHED;
last by done.
unfold schedules_job_of_task in *.
unfold task_scheduled_on in *.
destruct (sched cpu t) eqn:SOME; last by done.
rewrite big_mkcond /= (bigD1_seq j) /=; last by apply undup_uniq.
{
......
......@@ -157,7 +157,7 @@ Module ConcreteScheduler.
nth_or_none (sorted_jobs t) cpu = Some j.
Proof.
intros j t SCHED.
move: SCHED => /exists_inP [cpu INcpu /eqP SCHED]; exists cpu.
move: SCHED => /existsP [cpu /eqP SCHED]; exists cpu.
by apply scheduler_nth_or_none_mapping.
Qed.
......@@ -181,7 +181,7 @@ Module ConcreteScheduler.
exists n; split; first by done.
rewrite leqNgt; apply/negP; red; intro LT.
apply NOTCOMP; clear NOTCOMP PENDING.
apply/exists_inP; exists (Ordinal LT); [by done | apply/eqP].
apply/existsP; exists (Ordinal LT); apply/eqP.
unfold sorted_jobs in *; clear sorted_jobs.
unfold sched, scheduler, schedule_prefix in *; clear sched.
destruct t.
......@@ -220,7 +220,7 @@ Module ConcreteScheduler.
Proof.
unfold jobs_must_arrive_to_execute.
intros j t SCHED.
move: SCHED => /existsP [cpu /andP [INcpu /eqP SCHED]].
move: SCHED => /existsP [cpu /eqP SCHED].
unfold sched, scheduler, schedule_prefix in SCHED.
destruct t.
{
......
......@@ -159,8 +159,7 @@ Module ConcreteScheduler.
exists (cpu: processor num_cpus),
nth_or_none (sorted_jobs t) cpu = Some j.
Proof.
intros j t SCHED.
move: SCHED => /exists_inP [cpu INcpu /eqP SCHED]; exists cpu.
move => j t /existsP [cpu /eqP SCHED]; exists cpu.
by apply scheduler_nth_or_none_mapping.
Qed.
......@@ -186,7 +185,7 @@ Module ConcreteScheduler.
exists n; split; first by done.
rewrite leqNgt; apply/negP; red; intro LT.
apply NOTCOMP; clear NOTCOMP PENDING.
apply/exists_inP; exists (Ordinal LT); [by done | apply/eqP].
apply/existsP; exists (Ordinal LT); apply/eqP.
unfold sorted_jobs in *; clear sorted_jobs.
unfold sched, scheduler, schedule_prefix in *; clear sched.
destruct t.
......@@ -225,7 +224,7 @@ Module ConcreteScheduler.
Proof.
unfold jobs_must_arrive_to_execute.
intros j t SCHED.
move: SCHED => /existsP [cpu /andP [INcpu /eqP SCHED]].
move: SCHED => /existsP [cpu /eqP SCHED].
unfold sched, scheduler, schedule_prefix in SCHED.
destruct t.
{
......
......@@ -73,7 +73,8 @@ Module Interference.
(* Let job_other be a job that interferes with j. *)
Variable job_other: JobIn arr_seq.
(* The interference caused by job_other is defined as follows. *)
(* We define the total interference caused by job_other during [t1, t2) as the
cumulative service received by job_other while j is backlogged. *)
Definition job_interference (t1 t2: time) :=
\sum_(t1 <= t < t2)
\sum_(cpu < num_cpus)
......@@ -81,65 +82,28 @@ Module Interference.
End JobInterference.
Section JobInterferenceSequential.
(* Let job_other be a job that interferes with j. *)
Variable job_other: JobIn arr_seq.
(* If jobs are sequential, the interference caused by job_other
is defined as follows. *)
Definition job_interference_sequential (t1 t2: time) :=
\sum_(t1 <= t < t2)
(job_is_backlogged t && scheduled sched job_other t).
End JobInterferenceSequential.
Section TaskInterference.
(* In order to define task interference, consider any interfering task tsk_other. *)
Variable tsk_other: sporadic_task.
Definition schedules_job_of_task (cpu: processor num_cpus) (t: time) :=
match (sched cpu t) with
| Some j' => job_task j' == tsk_other
| None => false
end.
(* We know that tsk is scheduled at time t if there exists a processor
scheduling a job of tsk. *)
Definition task_is_scheduled (t: time) :=
[exists cpu in processor num_cpus, schedules_job_of_task cpu t].
(* We define the total interference caused by tsk during [t1, t2) as the
cumulative time in which j is backlogged while tsk is scheduled. *)
(* We define the total interference caused by tsk during [t1, t2) as
the cumulative service received by tsk while j is backlogged. *)
Definition task_interference (t1 t2: time) :=
\sum_(t1 <= t < t2)
\sum_(cpu < num_cpus)
(job_is_backlogged t && schedules_job_of_task cpu t).
(job_is_backlogged t &&
task_scheduled_on job_task sched tsk_other cpu t).
End TaskInterference.
Section TaskInterferenceSequential.
(* In order to define task interference, consider any interfering task tsk_other. *)
Variable tsk_other: sporadic_task.
(* If jobs are sequential, we define the total interference caused by
tsk during [t1, t2) as the cumulative time in which j is backlogged
while tsk is scheduled. *)
Definition task_interference_sequential (t1 t2: time) :=
\sum_(t1 <= t < t2)
(job_is_backlogged t && task_is_scheduled tsk_other t).
End TaskInterferenceSequential.
Section TaskInterferenceJobList.
Variable tsk_other: sporadic_task.
Definition task_interference_sequential_joblist (t1 t2: time) :=
Definition task_interference_joblist (t1 t2: time) :=
\sum_(j <- jobs_scheduled_between sched t1 t2 | job_task j == tsk_other)
job_interference_sequential j t1 t2.
job_interference j t1 t2.
End TaskInterferenceJobList.
......@@ -156,29 +120,6 @@ Module Interference.
by rewrite big_const_nat iter_addn mul1n addn0 leqnn.
Qed.
Lemma job_interference_seq_le_delta :
forall j_other t1 delta,
job_interference_sequential j_other t1 (t1 + delta) <= delta.
Proof.
unfold job_interference; intros j_other t1 delta.
apply leq_trans with (n := \sum_(t1 <= t < t1 + delta) 1);
first by apply leq_sum; ins; apply leq_b1.
by rewrite big_const_nat iter_addn mul1n addn0 addKn leqnn.
Qed.
Lemma job_interference_seq_le_service :
forall j_other t1 t2,
job_interference_sequential j_other t1 t2 <= service_during sched j_other t1 t2.
Proof.
intros j_other t1 t2; unfold job_interference_sequential, service_during.
apply leq_trans with (n := \sum_(t1 <= t < t2) scheduled sched j_other t);
first by apply leq_sum; ins; destruct (job_is_backlogged i); rewrite ?andTb ?andFb.
apply leq_sum; intros t _.
destruct (scheduled sched j_other t) eqn:SCHED; last by done.
move: SCHED => /existsP EX; destruct EX as [cpu]; move: H => /andP [IN SCHED].
unfold service_at; rewrite (bigD1 cpu); last by done.
by apply leq_trans with (n := 1).
Qed.
Lemma job_interference_le_service :
forall j_other t1 t2,
......@@ -192,23 +133,6 @@ Module Interference.
by destruct (scheduled_on sched j_other cpu t).
Qed.
Lemma task_interference_seq_le_workload :
forall tsk t1 t2,
task_interference_sequential tsk t1 t2 <= workload job_task sched tsk t1 t2.
Proof.
unfold task_interference, workload; intros tsk t1 t2.
apply leq_sum; intros t _.
rewrite -mulnb -[\sum_(_ < _) _]mul1n.
apply leq_mul; first by apply leq_b1.
destruct (task_is_scheduled tsk t) eqn:SCHED; last by ins.
unfold task_is_scheduled in SCHED.
move: SCHED =>/exists_inP SCHED.
destruct SCHED as [cpu _ HAScpu].
rewrite -> bigD1 with (j := cpu); simpl; last by ins.
apply ltn_addr; unfold service_of_task, schedules_job_of_task in *.