drm/scheduler: avoid redundant shifting of the entity v2
authorNayan Deshmukh <nayan26deshmukh@gmail.com>
Tue, 21 Aug 2018 13:29:08 +0000 (18:59 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:11:14 +0000 (11:11 -0500)
do not remove entity from the rq if the current rq is from
the least loaded scheduler.

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/scheduler/sched_entity.c

index 812e3530ea25de89a5706a20670c0565cfa7f296..4e5e95c0cab544805d03502d09041743bc57089a 100644 (file)
@@ -476,6 +476,9 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
                return;
 
        rq = drm_sched_entity_get_free_sched(entity);
+       if (rq == entity->rq)
+               return;
+
        spin_lock(&entity->rq_lock);
        drm_sched_rq_remove_entity(entity->rq, entity);
        entity->rq = rq;