From: Luben Tuikov <luben.tuikov@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>, brolerliew <brolerliew@gmail.com>
Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/scheduler: set current_entity to next when remove from rq
Date: Tue, 25 Oct 2022 13:50:03 -0400 [thread overview]
Message-ID: <a70dcda0-6723-38f6-efeb-e8edb16dab55@amd.com> (raw)
In-Reply-To: <CADnq5_NweAo-7snRLkidNkOizu7Ft+7GgXCS2Rnv1oxmRFb_RQ@mail.gmail.com>
Looking...
Regards,
Luben
On 2022-10-25 09:35, Alex Deucher wrote:
> + Luben
>
> On Tue, Oct 25, 2022 at 2:55 AM brolerliew <brolerliew@gmail.com> wrote:
>>
>> When entity move from one rq to another, current_entity will be set to NULL
>> if it is the moving entity. This make entities close to rq head got
>> selected more frequently, especially when doing load balance between
>> multiple drm_gpu_scheduler.
>>
>> Make current_entity to next when removing from rq.
>>
>> Signed-off-by: brolerliew <brolerliew@gmail.com>
>> ---
>> drivers/gpu/drm/scheduler/sched_main.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
>> index 2fab218d7082..00b22cc50f08 100644
>> --- a/drivers/gpu/drm/scheduler/sched_main.c
>> +++ b/drivers/gpu/drm/scheduler/sched_main.c
>> @@ -168,10 +168,11 @@ void drm_sched_rq_remove_entity(struct drm_sched_rq *rq,
>> spin_lock(&rq->lock);
>>
>> atomic_dec(rq->sched->score);
>> - list_del_init(&entity->list);
>>
>> if (rq->current_entity == entity)
>> - rq->current_entity = NULL;
>> + rq->current_entity = list_next_entry(entity, list);
>> +
>> + list_del_init(&entity->list);
>>
>> if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)
>> drm_sched_rq_remove_fifo_locked(entity);
>> --
>> 2.34.1
>>
next prev parent reply other threads:[~2022-10-25 17:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 6:18 [PATCH] drm/scheduler: set current_entity to next when remove from rq brolerliew
2022-10-25 13:35 ` Alex Deucher
2022-10-25 17:50 ` Luben Tuikov [this message]
2022-10-27 7:01 ` Luben Tuikov
2022-10-27 8:07 ` Luben Tuikov
2022-10-27 8:19 ` Christian König
2022-10-27 8:24 ` Luben Tuikov
[not found] ` <CAODyvyypneTxCDUgUNB0UCm+eZtKn_yLJRxZ8nh-kg2PUkaTjw@mail.gmail.com>
[not found] ` <37c0c9f3-be29-aa0e-94b3-c1ae75e70763@amd.com>
2022-10-27 15:46 ` Luben Tuikov
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=a70dcda0-6723-38f6-efeb-e8edb16dab55@amd.com \
--to=luben.tuikov@amd.com \
--cc=alexdeucher@gmail.com \
--cc=andrey.grodzovsky@amd.com \
--cc=brolerliew@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/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