[PATCH v2] drm/scheduler: rework entity creation

Nirmoy nirmodas at amd.com
Thu Dec 5 16:08:11 UTC 2019


On 12/5/19 4:43 PM, Christian König wrote:
> Am 05.12.19 um 15:48 schrieb Nirmoy Das:
>>
>>   EXPORT_SYMBOL(drm_sched_entity_set_priority);
>> @@ -490,18 +474,20 @@ void drm_sched_entity_select_rq(struct 
>> drm_sched_entity *entity)
>>       struct dma_fence *fence;
>>       struct drm_sched_rq *rq;
>>   -    if (spsc_queue_count(&entity->job_queue) || 
>> entity->num_rq_list <= 1)
>> +    if (spsc_queue_count(&entity->job_queue) || 
>> entity->num_sched_list <= 1)
>>           return;
>>         fence = READ_ONCE(entity->last_scheduled);
>>       if (fence && !dma_fence_is_signaled(fence))
>>           return;
>>   +    spin_lock(&entity->rq_lock);
>>       rq = drm_sched_entity_get_free_sched(entity);
>> -    if (rq == entity->rq)
>> +    if (rq == entity->rq) {
>> +        spin_unlock(&entity->rq_lock);
>>           return;
>> +    }
>
> Should we redesign that into:
>
> if (rq != entity->rq) {
>> -    spin_lock(&entity->rq_lock);
>>       drm_sched_rq_remove_entity(entity->rq, entity);
>>       entity->rq = rq;
> }
>
> Would probably be easier to understand.
>
Yes, looks much cleaner with that. Sent a v3 with that change.
> Apart from that the patch is Reviewed-by: Christian König 
> <christian.koenig at amd.com>.
>
> Do you want to work on a follow up patch first or should I push this 
> to drm-misc-next?
Please push this to drm-misc-next for now. I am thinking of doing rest 
of cleanup and on-demad entity creation for each HW IP together.
>
> Regards,
> Christian.
>
>


More information about the amd-gfx mailing list