From: Eric Anholt <eric@anholt.net>
To: dri-devel@lists.freedesktop.org
Cc: Nayan Deshmukh <nayan26deshmukh@gmail.com>,
christian.koenig@amd.com, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/scheduler: modify args of drm_sched_entity_init
Date: Thu, 12 Jul 2018 10:51:12 -0700 [thread overview]
Message-ID: <87pnzs9wbz.fsf@anholt.net> (raw)
In-Reply-To: <20180712063643.8030-4-nayan26deshmukh@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2211 bytes --]
Nayan Deshmukh <nayan26deshmukh@gmail.com> writes:
> diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c
> index 3dc1a4f07e3f..b2dbd1c1ba69 100644
> --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
> +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
> @@ -162,26 +162,32 @@ drm_sched_rq_select_entity(struct drm_sched_rq *rq)
> * drm_sched_entity_init - Init a context entity used by scheduler when
> * submit to HW ring.
> *
> - * @sched: scheduler instance
> * @entity: scheduler entity to init
> - * @rq: the run queue this entity belongs
> + * @rq_list: the list of run queue on which jobs from this
> + * entity can be submitted
> + * @num_rq_list: number of run queue in rq_list
> * @guilty: atomic_t set to 1 when a job on this queue
> * is found to be guilty causing a timeout
> *
> + * Note: the rq_list should have atleast one element to schedule
> + * the entity
> + *
> * Returns 0 on success or a negative error code on failure.
> */
> -int drm_sched_entity_init(struct drm_gpu_scheduler *sched,
> - struct drm_sched_entity *entity,
> - struct drm_sched_rq *rq,
> +int drm_sched_entity_init(struct drm_sched_entity *entity,
> + struct drm_sched_rq **rq_list,
> + unsigned int num_rq_list,
> atomic_t *guilty)
> {
> - if (!(sched && entity && rq))
> + if (!(entity && rq_list && num_rq_list > 0 && rq_list[0]))
> return -EINVAL;
>
> memset(entity, 0, sizeof(struct drm_sched_entity));
> INIT_LIST_HEAD(&entity->list);
> - entity->rq = rq;
> - entity->sched = sched;
> + entity->rq_list = NULL;
> + entity->rq = rq_list[0];
> + entity->sched = rq_list[0]->sched;
> + entity->num_rq_list = num_rq_list;
The API change makes sense as prep work, but I don't really like adding
the field to the struct (and changing the struct's docs for the existing
rq field) if it's going to always be NULL until a future change.
Similarly, I'd rather see patch 2 as part of a series that uses the
value.
That said, while I don't currently have a usecase for load-balancing
between entities, I may in the future, so thanks for working on this!
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-07-12 17:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-12 6:36 [PATCH 0/3] drm/scheduler: preparation for load balancing Nayan Deshmukh
[not found] ` <20180712063643.8030-1-nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-07-12 6:36 ` [PATCH 1/3] drm/scheduler: add a pointer to scheduler in the rq Nayan Deshmukh
[not found] ` <20180712063643.8030-2-nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-07-12 17:50 ` Eric Anholt
2018-07-12 6:36 ` [PATCH 2/3] drm/scheduler: add counter for total jobs in scheduler Nayan Deshmukh
2018-08-02 5:01 ` Zhang, Jerry (Junwei)
2018-08-02 5:50 ` Nayan Deshmukh
[not found] ` <CAFd4ddzHsjg=D0=Zo-iKLv-uQ_MFWq2bzZGLwXQtoRnZAixzGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-02 5:59 ` Zhang, Jerry (Junwei)
[not found] ` <5B629DC1.2040100-5C7GfCeVMHo@public.gmane.org>
2018-08-02 6:08 ` Nayan Deshmukh
2018-08-02 6:16 ` Zhang, Jerry (Junwei)
2018-07-12 6:36 ` [PATCH 3/3] drm/scheduler: modify args of drm_sched_entity_init Nayan Deshmukh
2018-07-12 6:42 ` Nayan Deshmukh
2018-07-12 17:51 ` Eric Anholt [this message]
[not found] ` <87pnzs9wbz.fsf-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
2018-07-13 7:20 ` Nayan Deshmukh
[not found] ` <CAFd4ddwi5gF7FM5jEW01DwXhfBMQ+77JLVKcth3hzeobc5Hc4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-07-13 7:22 ` Christian König
2018-07-13 7:10 ` Christian König
2018-07-12 7:30 ` [PATCH 0/3] drm/scheduler: preparation for load balancing 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=87pnzs9wbz.fsf@anholt.net \
--to=eric@anholt.net \
--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