drm/scheduler: avoid redundant shifting of the entity v2

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>
This commit is contained in:
Nayan Deshmukh 2018-08-21 18:59:08 +05:30 коммит произвёл Alex Deucher
Родитель 43fbbe89f1
Коммит c89677afb3
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -476,6 +476,9 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
return; return;
rq = drm_sched_entity_get_free_sched(entity); rq = drm_sched_entity_get_free_sched(entity);
if (rq == entity->rq)
return;
spin_lock(&entity->rq_lock); spin_lock(&entity->rq_lock);
drm_sched_rq_remove_entity(entity->rq, entity); drm_sched_rq_remove_entity(entity->rq, entity);
entity->rq = rq; entity->rq = rq;