Skip to content

Commit

Permalink
drm/i915/gvt: control the scheduler by timeslice usage
Browse files Browse the repository at this point in the history
The timeslice usage will determine vGPU whether has chance to
schedule or not at every vGPU switch checkpoint.

Signed-off-by: Ping Gao <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
  • Loading branch information
Ping Gao authored and zhenyw committed Mar 30, 2017
1 parent afe04fb commit b35f34d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/i915/gvt/sched_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,11 @@ static struct intel_vgpu *find_busy_vgpu(struct gvt_sched_data *sched_data)
if (!vgpu_has_pending_workload(vgpu_data->vgpu))
continue;

vgpu = vgpu_data->vgpu;
break;
/* Return the vGPU only if it has time slice left */
if (vgpu_data->left_ts > 0) {
vgpu = vgpu_data->vgpu;
break;
}
}

return vgpu;
Expand Down Expand Up @@ -223,6 +226,8 @@ static void tbs_sched_func(struct gvt_sched_data *sched_data)
&sched_data->lru_runq_head);

gvt_dbg_sched("pick next vgpu %d\n", vgpu->id);
} else {
scheduler->next_vgpu = gvt->idle_vgpu;
}
out:
if (scheduler->next_vgpu) {
Expand Down

0 comments on commit b35f34d

Please sign in to comment.