dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
To: Nayan Deshmukh <nayan26deshmukh@gmail.com>,
	dri-devel@lists.freedesktop.org
Cc: christian.koenig@amd.com, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/scheduler: add new function to get least loaded sched v2
Date: Wed, 1 Aug 2018 11:35:07 -0400	[thread overview]
Message-ID: <dde1b549-df1b-e156-1e96-ddfe4beca446@amd.com> (raw)
In-Reply-To: <20180801082002.20696-3-nayan26deshmukh@gmail.com>

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@gmail.com>
> ---
>   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)
>   {

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-08-01 15:35 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 [this message]
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
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=dde1b549-df1b-e156-1e96-ddfe4beca446@amd.com \
    --to=andrey.grodzovsky@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nayan26deshmukh@gmail.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