<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Series is Acked-by: Andrey Grodzovsky
      <a class="moz-txt-link-rfc2396E" href="mailto:andrey.grodzovsky@amd.com"><andrey.grodzovsky@amd.com></a></p>
    <p>Andrey<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 08/01/2018 12:06 PM, Nayan Deshmukh
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFd4ddx8D2iKquRu4YVh1gnRMpLFgWf3CBPdk5SD-nJ8dNXEPQ@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="auto">Yes, that is correct. 
        <div dir="auto"><br>
        </div>
        <div dir="auto">Nayan</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Wed, Aug 1, 2018, 9:05 PM Andrey Grodzovsky
          <<a href="mailto:Andrey.Grodzovsky@amd.com"
            moz-do-not-send="true">Andrey.Grodzovsky@amd.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Clarification
          question -  if the run queues belong to different <br>
          schedulers they effectively point to different rings,<br>
          <br>
          it means we allow to move (reschedule) a drm_sched_entity from
          one ring <br>
          to another - i assume that the idea int the first place, that<br>
          <br>
          you have a set of HW rings and you can utilize any of them for
          your jobs <br>
          (like compute rings). Correct ?<br>
          <br>
          Andrey<br>
          <br>
          <br>
          On 08/01/2018 04:20 AM, Nayan Deshmukh wrote:<br>
          > The function selects the run queue from the rq_list with
          the<br>
          > least load. The load is decided by the number of jobs in
          a<br>
          > scheduler.<br>
          ><br>
          > v2: avoid using atomic read twice consecutively, instead
          store<br>
          >      it locally<br>
          ><br>
          > Signed-off-by: Nayan Deshmukh <<a
            href="mailto:nayan26deshmukh@gmail.com" target="_blank"
            rel="noreferrer" moz-do-not-send="true">nayan26deshmukh@gmail.com</a>><br>
          > ---<br>
          >   drivers/gpu/drm/scheduler/gpu_scheduler.c | 25
          +++++++++++++++++++++++++<br>
          >   1 file changed, 25 insertions(+)<br>
          ><br>
          > diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c
          b/drivers/gpu/drm/scheduler/gpu_scheduler.c<br>
          > index 375f6f7f6a93..fb4e542660b0 100644<br>
          > --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c<br>
          > +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c<br>
          > @@ -255,6 +255,31 @@ static bool
          drm_sched_entity_is_ready(struct drm_sched_entity *entity)<br>
          >       return true;<br>
          >   }<br>
          >   <br>
          > +/**<br>
          > + * drm_sched_entity_get_free_sched - Get the rq from
          rq_list with least load<br>
          > + *<br>
          > + * @entity: scheduler entity<br>
          > + *<br>
          > + * Return the pointer to the rq with least load.<br>
          > + */<br>
          > +static struct drm_sched_rq *<br>
          > +drm_sched_entity_get_free_sched(struct drm_sched_entity
          *entity)<br>
          > +{<br>
          > +     struct drm_sched_rq *rq = NULL;<br>
          > +     unsigned int min_jobs = UINT_MAX, num_jobs;<br>
          > +     int i;<br>
          > +<br>
          > +     for (i = 0; i < entity->num_rq_list; ++i) {<br>
          > +             num_jobs =
          atomic_read(&entity->rq_list[i]->sched->num_jobs);<br>
          > +             if (num_jobs < min_jobs) {<br>
          > +                     min_jobs = num_jobs;<br>
          > +                     rq = entity->rq_list[i];<br>
          > +             }<br>
          > +     }<br>
          > +<br>
          > +     return rq;<br>
          > +}<br>
          > +<br>
          >   static void drm_sched_entity_kill_jobs_cb(struct
          dma_fence *f,<br>
          >                                   struct dma_fence_cb
          *cb)<br>
          >   {<br>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>