Library prosa.results.generality.elf
Require Export prosa.util.int.
Require Export prosa.model.schedule.priority_driven.
Require Export prosa.analysis.facts.priority.fp.
Require Export prosa.analysis.facts.priority.gel.
Require Export prosa.analysis.facts.priority.elf.
Require Export prosa.analysis.facts.priority.classes.
Require Export prosa.model.schedule.priority_driven.
Require Export prosa.analysis.facts.priority.fp.
Require Export prosa.analysis.facts.priority.gel.
Require Export prosa.analysis.facts.priority.elf.
Require Export prosa.analysis.facts.priority.classes.
Generality of ELF
Consider any type of tasks with relative priority points,...
...jobs of these tasks, and ...
... any processor model.
Suppose the jobs have arrival times and costs, and allow for any preemption
and readiness models.
Context {Arrival : JobArrival Job} {Cost : JobCost Job}
`{JobPreemptable Job} {JR : @JobReady Job PState Cost Arrival}.
`{JobPreemptable Job} {JR : @JobReady Job PState Cost Arrival}.
Suppose FP is the fixed-priority policy that parameterizes the ELF policy.
ELF Generalizes GEL
If the FP fixed-priority policy assigns equal priority to all tasks, ...
... then the ELF policy reduces to GEL.
Remark ELF_generalizes_GEL :
∀ (JLFP : JLFP_policy Job),
policy_is_ELF FP JLFP ↔ policy_is_GEL JLFP.
Proof.
move⇒ JLFP; split ⇒ [ELF|GEL]; (repeat split ⇒ //) ⇒ j j' PRIO.
- by apply: ELF_policy_priority_point_order.
- by apply/ep_hep_task/H_FP_equal_priority.
- by apply: GEL_policy_priority_point_order.
Qed.
End ELFGeneralizesGEL.
∀ (JLFP : JLFP_policy Job),
policy_is_ELF FP JLFP ↔ policy_is_GEL JLFP.
Proof.
move⇒ JLFP; split ⇒ [ELF|GEL]; (repeat split ⇒ //) ⇒ j j' PRIO.
- by apply: ELF_policy_priority_point_order.
- by apply/ep_hep_task/H_FP_equal_priority.
- by apply: GEL_policy_priority_point_order.
Qed.
End ELFGeneralizesGEL.
ELF Generalizes Fixed-Priority Scheduling
Assume that the underlying task-priority relation has the usual order
properties.
Hypothesis H_reflexive_priorities : reflexive_task_priorities FP.
Hypothesis H_transitive_priorities : transitive_task_priorities FP.
Hypothesis H_total_priorities : total_task_priorities FP.
Hypothesis H_transitive_priorities : transitive_task_priorities FP.
Hypothesis H_total_priorities : total_task_priorities FP.
Consider a JLFP policy that behaves as an ELF policy.
Since ELF never inverts fixed task priority, an ELF schedule is always
also valid with respect to the underlying task-level FP policy.
Remark ELF_respects_fixed_priority :
∀ sched arr_seq,
respects_JLFP_policy_at_preemption_point arr_seq sched JLFP
→ respects_FP_policy_at_preemption_point arr_seq sched FP.
Proof.
move⇒ sched arr_seq RESPECTED j j' t ARR PT BL SCHED.
rewrite hep_job_at_fp.
apply: ELF_policy_task_priority_order ⇒ //.
exact: RESPECTED.
Qed.
∀ sched arr_seq,
respects_JLFP_policy_at_preemption_point arr_seq sched JLFP
→ respects_FP_policy_at_preemption_point arr_seq sched FP.
Proof.
move⇒ sched arr_seq RESPECTED j j' t ARR PT BL SCHED.
rewrite hep_job_at_fp.
apply: ELF_policy_task_priority_order ⇒ //.
exact: RESPECTED.
Qed.
Additionally, if each task has a distinct priority, or equivalently, no
two tasks have equal priority according to the FP fixed-priority
policy, then the reverse also holds: the ELF policy reduces to the
underlying FP policy. To show this, we require some additional setup and
assumptions.
First, note that FP-compliance does not constrain jobs of the same task,
whereas a given ELF policy may resolve ties arbitrarily when both
jobs have the same task priority and the same priority point. Hence,
in the only ambiguous case, we explicitly rule out tie-breaking that
disagrees with the required job-level priority order.
Hypothesis H_no_tiebreak :
∀ j j',
ep_task (job_task j) (job_task j') →
job_priority_point j = job_priority_point j' →
hep_job j j'.
∀ j j',
ep_task (job_task j) (job_task j') →
job_priority_point j = job_priority_point j' →
hep_job j j'.
Second, assume that task priorities are indeed distinct.
Third, consider any given valid arrival sequence.
Variable arr_seq : arrival_sequence Job.
Hypothesis H_valid_arrival_sequence : valid_arrival_sequence arr_seq.
Hypothesis H_valid_arrival_sequence : valid_arrival_sequence arr_seq.
Then in any given valid schedule ...
... in which tasks execute sequentially, ...
... the ELF policy and the underlying FP policy are equivalent.
Remark elf_generalizes_fixed_priority :
respects_JLFP_policy_at_preemption_point arr_seq sched JLFP
↔ respects_FP_policy_at_preemption_point arr_seq sched FP.
Proof.
split; first exact: ELF_respects_fixed_priority.
move⇒ RESPECTED j j' t ARR PT BL SCHED.
move: (RESPECTED j j' t ARR PT BL SCHED);
rewrite hep_job_at_fp ⇒ HEP.
rewrite hep_job_at_jlfp.
move: HEP; rewrite hep_hp_ep_task ⇒ /orP [HP|EP];
first by apply: ELF_policy_higher_priority_task.
have SAME: same_task j' j by apply/eqP; move: EP; apply: contraTeq.
have [LEQ|LT] := leqP (job_arrival j') (job_arrival j).
{ move: LEQ; rewrite leq_eqVlt ⇒ /orP [/eqP EQ|LT];
last exact: ELF_policy_earlier_arrival.
apply: H_no_tiebreak ⇒ //.
rewrite /job_priority_point/jpp_from_tpp EQ.
by move: SAME; rewrite /same_task ⇒ /eqP →. }
{ exfalso.
move: BL; rewrite /backlogged ⇒ /andP [INCOMP _].
apply ready_implies_incomplete in INCOMP.
move: INCOMP ⇒ /negP; apply.
by apply: (H_sequential j j') ⇒ //; rewrite same_task_sym. }
Qed.
End ELFGeneralizesFixedPriority.
End GeneralityOfELF.
respects_JLFP_policy_at_preemption_point arr_seq sched JLFP
↔ respects_FP_policy_at_preemption_point arr_seq sched FP.
Proof.
split; first exact: ELF_respects_fixed_priority.
move⇒ RESPECTED j j' t ARR PT BL SCHED.
move: (RESPECTED j j' t ARR PT BL SCHED);
rewrite hep_job_at_fp ⇒ HEP.
rewrite hep_job_at_jlfp.
move: HEP; rewrite hep_hp_ep_task ⇒ /orP [HP|EP];
first by apply: ELF_policy_higher_priority_task.
have SAME: same_task j' j by apply/eqP; move: EP; apply: contraTeq.
have [LEQ|LT] := leqP (job_arrival j') (job_arrival j).
{ move: LEQ; rewrite leq_eqVlt ⇒ /orP [/eqP EQ|LT];
last exact: ELF_policy_earlier_arrival.
apply: H_no_tiebreak ⇒ //.
rewrite /job_priority_point/jpp_from_tpp EQ.
by move: SAME; rewrite /same_task ⇒ /eqP →. }
{ exfalso.
move: BL; rewrite /backlogged ⇒ /andP [INCOMP _].
apply ready_implies_incomplete in INCOMP.
move: INCOMP ⇒ /negP; apply.
by apply: (H_sequential j j') ⇒ //; rewrite same_task_sym. }
Qed.
End ELFGeneralizesFixedPriority.
End GeneralityOfELF.