[PATCH] drm/i915/gvt: remove scheduler_mutex

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


scheduler_mutex is no need any more as gvt->lock and drm.struct_mutex
are enough to protect the race condition in workload_thread.

Signed-off-by: Ping Gao <ping.a.gao at intel.com>
---
 drivers/gpu/drm/i915/gvt/scheduler.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
index bada32b..451c5f6 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.c
+++ b/drivers/gpu/drm/i915/gvt/scheduler.c
@@ -439,8 +439,6 @@ struct workload_thread_param {
 	int ring_id;
 };
 
-static DEFINE_MUTEX(scheduler_mutex);
-
 static int workload_thread(void *priv)
 {
 	struct workload_thread_param *p = (struct workload_thread_param *)priv;
@@ -472,8 +470,6 @@ static int workload_thread(void *priv)
 		if (!workload)
 			break;
 
-		mutex_lock(&scheduler_mutex);
-
 		gvt_dbg_sched("ring id %d next workload %p vgpu %d\n",
 				workload->ring_id, workload,
 				workload->vgpu->id);
@@ -513,8 +509,6 @@ static int workload_thread(void *priv)
 
 		intel_runtime_pm_put(gvt->dev_priv);
 
-		mutex_unlock(&scheduler_mutex);
-
 	}
 	return 0;
 }
-- 
1.9.1



More information about the intel-gvt-dev mailing list