Library prosa.analysis.facts.model.work_conserving

Facts About Work Conservation

We relate work conservation to the existence of scheduled jobs. On a uniprocessor, it suffices that some job executes whenever a job is backlogged.
Section WorkConservation.

Consider jobs with arrival times and costs, and any processor and readiness model.
  Context {Job : JobType} `{JobArrival Job} `{JobCost Job}.
  Context {PState : ProcessorState Job} {jr : JobReady Job PState}.

Consider any arrival sequence and schedule.
  Variable arr_seq : arrival_sequence Job.
  Variable sched : schedule PState.

If there is at least one core, work conservation ensures that some job executes whenever an arriving job is backlogged.
  Lemma work_conserving_implies_scheduled_job :
    0 < #|Core| →
    work_conserving arr_seq sched →
    ∀ j t,
      arrives_in arr_seq j →
      backlogged sched j t →
      ∃ j_other,
        scheduled_at sched j_other t.

Assume that the processor has exactly one core.
  Hypothesis H_uni : uniprocessor_model PState.

To establish work conservation on a uniprocessor, it is sufficient to show that some job executes whenever a job from the arrival sequence is backlogged.
  Lemma uniprocessor_work_conserving :
    (∀ j t,
       arrives_in arr_seq j →
       backlogged sched j t →
       ∃ j_other,
         scheduled_at sched j_other t) →
    work_conserving arr_seq sched.

End WorkConservation.