[PATCH] drm/i915/gvt: avoid unnecessary vgpu switch

Ping Gao ping.a.gao at intel.com
Mon Apr 17 05:43:53 UTC 2017


It's no need to switch vgpu if next vgpu is the same with current
vgpu, otherwise it will make performance drop in some case.

Signed-off-by: Ping Gao <ping.a.gao at intel.com>
---
 drivers/gpu/drm/i915/gvt/sched_policy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c
index 79ba4b3..450a7ca 100644
--- a/drivers/gpu/drm/i915/gvt/sched_policy.c
+++ b/drivers/gpu/drm/i915/gvt/sched_policy.c
@@ -130,8 +130,10 @@ static void try_to_schedule_next_vgpu(struct intel_gvt *gvt)
 	ktime_t cur_time;
 
 	/* no target to schedule */
-	if (!scheduler->next_vgpu)
+	if (scheduler->next_vgpu == scheduler->current_vgpu) {
+		scheduler->next_vgpu = NULL;
 		return;
+	}
 
 	/*
 	 * after the flag is set, workload dispatch thread will
-- 
1.9.1



More information about the intel-gvt-dev mailing list