dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "James Zhu" <jamesz@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"James Zhu" <James.Zhu@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Subject: Re: [PATCH 3/4] drm/sched: always keep selecetd ring sched list in ctx entity
Date: Fri, 9 Sep 2022 13:18:22 +0200	[thread overview]
Message-ID: <09634d14-a257-e1fb-5304-ec6d0e2b8eb8@gmail.com> (raw)
In-Reply-To: <3a30e256-7966-6f53-8ada-db4c27087259@amd.com>

Hi James,

please use to_amdgpu_ring(entity->rq->sched) for this.

That's the scheduler which was actually picked for this entity.

Regards,
Christian.

Am 08.09.22 um 15:19 schrieb James Zhu:
> Hi Christian
>
> I need use entity->sched_list to track ring (ring = 
> container_of(sched, struct amdgpu_ring, sched))
>
> during amdgpu_ctx_fini_entity.
>
> I think change here to keep selected ring sched list in 
> entity->sched_list won't change the original logic too much.
>
> Best Regards!
>
> James
>
>
> On 2022-09-08 2:15 a.m., Christian König wrote:
>> Am 07.09.22 um 22:57 schrieb James Zhu:
>>> Always keep selecetd ring sched list in ctx entity.
>>
>> I have no idea what you are doing here, but this certainly doesn't 
>> make sense.
>>
>> Please explain a bit more.
>>
>> Thanks,
>> Christian.
>>
>>>
>>> Signed-off-by: James Zhu <James.Zhu@amd.com>
>>> ---
>>>   drivers/gpu/drm/scheduler/sched_entity.c | 7 ++-----
>>>   1 file changed, 2 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/scheduler/sched_entity.c 
>>> b/drivers/gpu/drm/scheduler/sched_entity.c
>>> index f5595607995b..39dca9cb8e0d 100644
>>> --- a/drivers/gpu/drm/scheduler/sched_entity.c
>>> +++ b/drivers/gpu/drm/scheduler/sched_entity.c
>>> @@ -71,7 +71,7 @@ int drm_sched_entity_init(struct drm_sched_entity 
>>> *entity,
>>>       entity->guilty = guilty;
>>>       entity->num_sched_list = num_sched_list;
>>>       entity->priority = priority;
>>> -    entity->sched_list = num_sched_list > 1 ? sched_list : NULL;
>>> +    entity->sched_list = sched_list;
>>>       entity->last_scheduled = NULL;
>>>         if(num_sched_list)
>>> @@ -453,7 +453,7 @@ void drm_sched_entity_select_rq(struct 
>>> drm_sched_entity *entity)
>>>       struct drm_sched_rq *rq;
>>>         /* single possible engine and already selected */
>>> -    if (!entity->sched_list)
>>> +    if (entity->num_sched_list <= 1)
>>>           return;
>>>         /* queue non-empty, stay on the same engine */
>>> @@ -482,9 +482,6 @@ void drm_sched_entity_select_rq(struct 
>>> drm_sched_entity *entity)
>>>           entity->rq = rq;
>>>       }
>>>       spin_unlock(&entity->rq_lock);
>>> -
>>> -    if (entity->num_sched_list == 1)
>>> -        entity->sched_list = NULL;
>>>   }
>>>     /**
>>


  reply	other threads:[~2022-09-09 11:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 20:57 [PATCH 1/4] drm/sched: returns struct drm_gpu_scheduler ** for drm_sched_pick_best James Zhu
2022-09-07 20:57 ` [PATCH 2/4] drm/sched: implement new drm_sched_pick_best James Zhu
2022-09-07 20:57 ` [PATCH 3/4] drm/sched: always keep selecetd ring sched list in ctx entity James Zhu
2022-09-07 21:12   ` [PATCH v2 3/4] drm/sched: always keep selected " James Zhu
2022-09-08  6:15   ` [PATCH 3/4] drm/sched: always keep selecetd " Christian König
2022-09-08 13:19     ` James Zhu
2022-09-09 11:18       ` Christian König [this message]
2022-09-08 15:29   ` [PATCH v3 3/4] drm/sched: always keep selected " James Zhu
2022-09-07 20:57 ` [PATCH 4/4] drm/amdgpu: update amdgpu_ctx_init_entity James Zhu
2022-09-08  6:12 ` [PATCH 1/4] drm/sched: returns struct drm_gpu_scheduler ** for drm_sched_pick_best Christian König
2022-09-08 14:08 ` Andrey Grodzovsky
2022-09-08 14:17   ` James Zhu
2022-09-08 14:38     ` Andrey Grodzovsky
2022-09-08 14:45       ` James Zhu
2022-09-08 15:05         ` Andrey Grodzovsky
2022-09-08 15:09           ` James Zhu
2022-09-08 18:30             ` Andrey Grodzovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09634d14-a257-e1fb-5304-ec6d0e2b8eb8@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=James.Zhu@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jamesz@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).