Merge pull request #3703 from BOINC/dpa_gpu_susp

client: avoid CPU starvation when GPU computing is suspended
This commit is contained in:
David Anderson 2020-05-22 02:01:05 -07:00 committed by GitHub
commit 3ab211a922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -97,10 +97,17 @@ struct RR_SIM {
inline void activate(RESULT* rp) {
PROJECT* p = rp->project;
active.push_back(rp);
rsc_work_fetch[0].sim_nused += rp->avp->avg_ncpus;
p->rsc_pwf[0].sim_nused += rp->avp->avg_ncpus;
int rt = rp->avp->gpu_usage.rsc_type;
// if this is a GPU app and GPU computing is suspended,
// don't count its CPU usage.
// That way we'll fetch more CPU work if needed.
//
if (!rt || !gpu_suspend_reason) {
rsc_work_fetch[0].sim_nused += rp->avp->avg_ncpus;
p->rsc_pwf[0].sim_nused += rp->avp->avg_ncpus;
}
if (rt) {
rsc_work_fetch[rt].sim_nused += rp->avp->gpu_usage.usage;
p->rsc_pwf[rt].sim_nused += rp->avp->gpu_usage.usage;