Library prosa.analysis.facts.priority.inversion
Require Export prosa.analysis.definitions.priority_inversion.
Require Export prosa.analysis.facts.model.uniprocessor.
Require Export prosa.analysis.facts.model.uniprocessor.
Lemmas about Priority Inversion
Consider any type of tasks ...
... and any type of jobs associated with these tasks.
Context {Job : JobType}.
Context `{JobTask Job Task}.
Context `{JobArrival Job}.
Context `{JobCost Job}.
Context `{JobTask Job Task}.
Context `{JobArrival Job}.
Context `{JobCost Job}.
Next, consider any kind of processor state model, ...
... any 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.
... and any valid schedule.
Variable sched : schedule PState.
Hypothesis H_jobs_come_from_arrival_sequence :
jobs_come_from_arrival_sequence sched arr_seq.
Hypothesis H_jobs_must_arrive_to_execute : jobs_must_arrive_to_execute sched.
Hypothesis H_jobs_come_from_arrival_sequence :
jobs_come_from_arrival_sequence sched arr_seq.
Hypothesis H_jobs_must_arrive_to_execute : jobs_must_arrive_to_execute sched.
Assume a given reflexive JLFP policy...
Context {JLFP : JLFP_policy Job}.
Hypothesis H_priority_is_reflexive : reflexive_job_priorities JLFP.
Hypothesis H_priority_is_reflexive : reflexive_job_priorities JLFP.
... and consider an arbitrary job.
Occurrence of Priority Inversion
Lemma sched_itself_implies_no_priority_inversion :
∀ t,
scheduled_at sched j t →
~~ priority_inversion arr_seq sched j t.
∀ t,
scheduled_at sched j t →
~~ priority_inversion arr_seq sched j t.
Conversely, if job j experiences a priority inversion at time t, then
some (other) job is scheduled at the time, ...
Lemma priority_inversion_scheduled_at :
∀ t,
priority_inversion arr_seq sched j t →
∃ j', scheduled_at sched j' t.
∀ t,
priority_inversion arr_seq sched j t →
∃ j', scheduled_at sched j' t.
... and thus there is no priority inversion at idle instants.
Lemma no_priority_inversion_when_idle :
∀ t,
is_idle arr_seq sched t →
~~ priority_inversion arr_seq sched j t.
Section Uniprocessors.
∀ t,
is_idle arr_seq sched t →
~~ priority_inversion arr_seq sched j t.
Section Uniprocessors.
Occurrence of Priority Inversion on Uniprocessors
On a uniprocessor, the job scheduled when j incurs priority inversion
necessarily has lower priority than j.
Lemma priority_inversion_hep_job :
∀ t j',
scheduled_at sched j' t →
priority_inversion arr_seq sched j t = ~~ hep_job j' j.
∀ t j',
scheduled_at sched j' t →
priority_inversion arr_seq sched j t = ~~ hep_job j' j.
Conversely, if a higher-priority job is scheduled on a uniprocessor, then
j does not incur priority inversion.
Corollary no_priority_inversion_when_hep_job_scheduled :
∀ t j',
scheduled_at sched j' t →
hep_job j' j →
~~ priority_inversion arr_seq sched j t.
∀ t j',
scheduled_at sched j' t →
hep_job j' j →
~~ priority_inversion arr_seq sched j t.
From the above lemmas, we obtain a simplified definition of
priority_inversion that holds on uniprocessors.
Lemma uni_priority_inversion_P :
∀ t,
reflect (exists2 j', scheduled_at sched j' t & ~~ hep_job j' j)
(priority_inversion arr_seq sched j t).
End Uniprocessors.
∀ t,
reflect (exists2 j', scheduled_at sched j' t & ~~ hep_job j' j)
(priority_inversion arr_seq sched j t).
End Uniprocessors.
Cumulative Priority Inversion
[t1, t2)
can be split arbitrarily: is equal
to the sum of CPI in an interval [t1, t_mid)
and CPI in an interval
[t_mid, t2)
.