dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Andrey Grodzovsky <andrey.grodzovsky@amd.com>,
	dri-devel@lists.freedesktop.org
Cc: Li Yunxiang <Yunxiang.Li@amd.com>,
	luben.tuikov@amd.com, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/sced: Add FIFO sched policy to rq
Date: Mon, 5 Sep 2022 07:57:41 +0200	[thread overview]
Message-ID: <9cc09bec-650d-cfbb-f8be-89fa81343004@amd.com> (raw)
In-Reply-To: <20220903024817.528107-1-andrey.grodzovsky@amd.com>



Am 03.09.22 um 04:48 schrieb Andrey Grodzovsky:
> Poblem: Given many entities competing for same rq on
> same scheduler an uncceptabliy long wait time for some
> jobs waiting stuck in rq before being picked up are
> observed (seen using  GPUVis).
> The issue is due to Round Robin policy used by scheduler
> to pick up the next entity for execution. Under stress
> of many entities and long job queus within entity some
> jobs could be stack for very long time in it's entity's
> queue before being popped from the queue and executed
> while for other entites with samller job queues a job
> might execute ealier even though that job arrived later
> then the job in the long queue.
>
> Fix:
> Add FIFO selection policy to entites in RQ, chose next enitity
> on rq in such order that if job on one entity arrived
> ealrier then job on another entity the first job will start
> executing ealier regardless of the length of the entity's job
> queue.
>
> v2:
> Switch to rb tree structure for entites based on TS of
> oldest job waiting in job queue of enitity. Improves next
> enitity extraction to O(1). Enitity TS update
> O(log(number of entites in rq))
>
> Drop default option in module control parameter.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> Tested-by: Li Yunxiang (Teddy) <Yunxiang.Li@amd.com>
[SNIP]
>   /**
> @@ -313,6 +330,14 @@ struct drm_sched_job {
>   
>   	/** @last_dependency: tracks @dependencies as they signal */
>   	unsigned long			last_dependency;
> +
> +
> +	/**
> +	* @submit_ts:
> +	*
> +	* Marks job submit time

Maybe write something like "When the job was pushed into the entity queue."

Apart from that I leave it to Luben and you to get this stuff upstream.

Thanks,
Christian.

> +	*/
> +	ktime_t                         submit_ts;
>   };
>   
>   static inline bool drm_sched_invalidate_job(struct drm_sched_job *s_job,
> @@ -501,6 +526,10 @@ void drm_sched_rq_add_entity(struct drm_sched_rq *rq,
>   void drm_sched_rq_remove_entity(struct drm_sched_rq *rq,
>   				struct drm_sched_entity *entity);
>   
> +void drm_sched_rq_update_fifo(struct drm_sched_entity *entity, ktime_t ts,
> +			      bool remove_only);
> +
> +
>   int drm_sched_entity_init(struct drm_sched_entity *entity,
>   			  enum drm_sched_priority priority,
>   			  struct drm_gpu_scheduler **sched_list,


  reply	other threads:[~2022-09-05  5:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-03  2:48 [PATCH v2] drm/sced: Add FIFO sched policy to rq Andrey Grodzovsky
2022-09-05  5:57 ` Christian König [this message]
2022-09-07 15:58   ` Andrey Grodzovsky
2022-09-13 13:50 ` 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=9cc09bec-650d-cfbb-f8be-89fa81343004@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Yunxiang.Li@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrey.grodzovsky@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=luben.tuikov@amd.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