From b36779b22acad9aa341d020be0227507c9be6da9 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 2 Feb 2012 17:05:55 +0000 Subject: [PATCH] - client: fix job scheduler problem: old: RR simulation marks some jobs as missing their deadline, and the job scheduler runs those jobs as "high priority". problem: those generally aren't the ones we should run. E.g. if the client has a lot of jobs from a project, typically the ones with later deadlines are the ones whose deadlines are missed in the simulation. But in this case the EDF policy says we should run the ones with earliest deadlines. new: if a project has N deadline misses, run its N earliest-deadline jobs, regardless of whether they missed their deadline in the sim. Note: this is how it used to be (as designed by John McLeod). I attempted to improve it, and got it wrong. svn path=/trunk/boinc/; revision=25188 --- checkin_notes | 19 +++++++++++++++++++ client/cpu_sched.cpp | 10 +--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index 58f9548966..60a1387c2b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1256,3 +1256,22 @@ Charlie 2 Feb 2012 / configure.ac version.h + +David 2 Feb 2012 + - client: fix job scheduler problem: + old: RR simulation marks some jobs as missing their deadline, + and the job scheduler runs those jobs as "high priority". + problem: those generally aren't the ones we should run. + E.g. if the client has a lot of jobs from a project, + typically the ones with later deadlines are the ones + whose deadlines are missed in the simulation. + But in this case the EDF policy says we should run + the ones with earliest deadlines. + new: if a project has N deadline misses, + run its N earliest-deadline jobs, + regardless of whether they missed their deadline in the sim. + Note: this is how it used to be (as designed by John McLeod). + I attempted to improve it, and got it wrong. + + client/ + cpu_sched.cpp diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index 7e8f8fad81..d47f37a66a 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -471,22 +471,14 @@ static RESULT* earliest_deadline_result(int rsc_type) { if (rp->non_cpu_intensive()) continue; PROJECT* p = rp->project; - bool only_deadline_misses = true; - // treat projects with DCF>90 as if they had deadline misses // if (p->duration_correction_factor < 90.0) { - int d = p->rsc_pwf[rsc_type].deadlines_missed_copy; - if (!d) { + if (p->rsc_pwf[rsc_type].deadlines_missed_copy <= 0) { continue; } - } else { - only_deadline_misses = false; } - if (only_deadline_misses && !rp->rr_sim_misses_deadline) { - continue; - } bool new_best = false; if (best_result) { if (rp->report_deadline < best_result->report_deadline) {