All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhoucm1 <zhoucm1-5C7GfCeVMHo@public.gmane.org>
To: Nayan Deshmukh
	<nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	David1.Zhou-5C7GfCeVMHo@public.gmane.org
Cc: Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org,
	"Maling list - DRI developers"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	"Christian König" <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH 3/4] drm/scheduler: add new function to get least loaded sched v2
Date: Thu, 2 Aug 2018 14:42:58 +0800	[thread overview]
Message-ID: <823db5d9-ec03-7469-0746-a5d9b521d933@amd.com> (raw)
In-Reply-To: <CAFd4ddyf=EhJ7pmzq3sEGa6U1sQ7Ga7fUH+sW+VKeBxJABjnKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 5508 bytes --]



On 2018年08月02日 14:01, Nayan Deshmukh wrote:
> Hi David,
>
> On Thu, Aug 2, 2018 at 8:22 AM Zhou, David(ChunMing) 
> <David1.Zhou-5C7GfCeVMHo@public.gmane.org <mailto:David1.Zhou-5C7GfCeVMHo@public.gmane.org>> wrote:
>
>     Another big question:
>
>     I agree the general idea is good to balance scheduler load for
>     same ring family.
>
>     But, when same entity job run on different scheduler, that means
>     the later job could be completed ahead of front, Right?
>
> Really good question. To avoid this senario we do not move an entity 
> which already has a job in the hardware queue. We only move entities 
> whose last_scheduled fence has been signalled which means that the 
> last submitted job of this entity has finished executing.
Good handling I missed when reviewing them.

Cheers,
David Zhou
>
> Moving an entity which already has a job in the hardware queue will 
> hinder the dependency optimization that we are using and hence will 
> not anyway lead to a better performance. I have talked about the issue 
> in more detail here [1]. Please let me know if you have any more 
> doubts regarding this.
>
> Cheers,
> Nayan
>
> [1] 
> http://ndesh26.github.io/gsoc/2018/06/14/GSoC-Update-A-Curious-Case-of-Dependency-Handling/
>
>     That will break fence design, later fence must be signaled after
>     front fence in same fence context.
>
>     Anything I missed?
>
>     Regards,
>
>     David Zhou
>
>     *From:* dri-devel <dri-devel-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>     <mailto:dri-devel-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>> *On Behalf Of
>     *Nayan Deshmukh
>     *Sent:* Thursday, August 02, 2018 12:07 AM
>     *To:* Grodzovsky, Andrey <Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org
>     <mailto:Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org>>
>     *Cc:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>     <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>; Maling list - DRI
>     developers <dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>     <mailto:dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>>; Koenig, Christian
>     <Christian.Koenig-5C7GfCeVMHo@public.gmane.org <mailto:Christian.Koenig-5C7GfCeVMHo@public.gmane.org>>
>     *Subject:* Re: [PATCH 3/4] drm/scheduler: add new function to get
>     least loaded sched v2
>
>     Yes, that is correct.
>
>     Nayan
>
>     On Wed, Aug 1, 2018, 9:05 PM Andrey Grodzovsky
>     <Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org <mailto:Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org>> wrote:
>
>         Clarification question -  if the run queues belong to different
>         schedulers they effectively point to different rings,
>
>         it means we allow to move (reschedule) a drm_sched_entity from
>         one ring
>         to another - i assume that the idea int the first place, that
>
>         you have a set of HW rings and you can utilize any of them for
>         your jobs
>         (like compute rings). Correct ?
>
>         Andrey
>
>
>         On 08/01/2018 04:20 AM, Nayan Deshmukh wrote:
>         > The function selects the run queue from the rq_list with the
>         > least load. The load is decided by the number of jobs in a
>         > scheduler.
>         >
>         > v2: avoid using atomic read twice consecutively, instead store
>         >      it locally
>         >
>         > Signed-off-by: Nayan Deshmukh <nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>         <mailto:nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>>
>         > ---
>         >   drivers/gpu/drm/scheduler/gpu_scheduler.c | 25
>         +++++++++++++++++++++++++
>         >   1 file changed, 25 insertions(+)
>         >
>         > diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c
>         b/drivers/gpu/drm/scheduler/gpu_scheduler.c
>         > index 375f6f7f6a93..fb4e542660b0 100644
>         > --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
>         > +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
>         > @@ -255,6 +255,31 @@ static bool
>         drm_sched_entity_is_ready(struct drm_sched_entity *entity)
>         >       return true;
>         >   }
>         >
>         > +/**
>         > + * drm_sched_entity_get_free_sched - Get the rq from
>         rq_list with least load
>         > + *
>         > + * @entity: scheduler entity
>         > + *
>         > + * Return the pointer to the rq with least load.
>         > + */
>         > +static struct drm_sched_rq *
>         > +drm_sched_entity_get_free_sched(struct drm_sched_entity
>         *entity)
>         > +{
>         > +     struct drm_sched_rq *rq = NULL;
>         > +     unsigned int min_jobs = UINT_MAX, num_jobs;
>         > +     int i;
>         > +
>         > +     for (i = 0; i < entity->num_rq_list; ++i) {
>         > +             num_jobs =
>         atomic_read(&entity->rq_list[i]->sched->num_jobs);
>         > +             if (num_jobs < min_jobs) {
>         > +                     min_jobs = num_jobs;
>         > +                     rq = entity->rq_list[i];
>         > +             }
>         > +     }
>         > +
>         > +     return rq;
>         > +}
>         > +
>         >   static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
>         >                                   struct dma_fence_cb *cb)
>         >   {
>


[-- Attachment #1.2: Type: text/html, Size: 11918 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-08-02  6:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01  8:19 [PATCH 1/4] drm/scheduler: add a list of run queues to the entity Nayan Deshmukh
2018-08-01  8:20 ` [PATCH 4/4] drm/scheduler: move idle entities to scheduler with less load v2 Nayan Deshmukh
     [not found] ` <20180801082002.20696-1-nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-01  8:20   ` [PATCH 2/4] drm/scheduler: add counter for total jobs in scheduler Nayan Deshmukh
     [not found]     ` <20180801082002.20696-2-nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-01 13:15       ` Huang Rui
2018-08-01 13:06         ` Christian König
2018-08-02  2:57           ` Huang Rui
2018-08-02  6:11             ` Nayan Deshmukh
2018-08-01  8:20   ` [PATCH 3/4] drm/scheduler: add new function to get least loaded sched v2 Nayan Deshmukh
2018-08-01 15:35     ` Andrey Grodzovsky
2018-08-01 16:06       ` Nayan Deshmukh
     [not found]         ` <CAFd4ddx8D2iKquRu4YVh1gnRMpLFgWf3CBPdk5SD-nJ8dNXEPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-01 17:51           ` Andrey Grodzovsky
2018-08-02  2:51           ` Zhou, David(ChunMing)
2018-08-02  6:01             ` Nayan Deshmukh
     [not found]               ` <CAFd4ddyf=EhJ7pmzq3sEGa6U1sQ7Ga7fUH+sW+VKeBxJABjnKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-02  6:42                 ` zhoucm1 [this message]
2018-08-01  9:35   ` [PATCH 1/4] drm/scheduler: add a list of run queues to the entity Christian König

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=823db5d9-ec03-7469-0746-a5d9b521d933@amd.com \
    --to=zhoucm1-5c7gfcevmho@public.gmane.org \
    --cc=Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org \
    --cc=Christian.Koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=David1.Zhou-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.