All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v2 00/18] Deadline scheduler and other ideas
@ 2025-01-08 18:35 Tvrtko Ursulin
  2025-01-08 18:35 ` [RFC 01/18] drm/amdgpu: Use DRM scheduler API in amdgpu_xcp_release_sched Tvrtko Ursulin
                   ` (17 more replies)
  0 siblings, 18 replies; 40+ messages in thread
From: Tvrtko Ursulin @ 2025-01-08 18:35 UTC (permalink / raw)
  To: dri-devel
  Cc: kernel-dev, Tvrtko Ursulin, Christian König,
	Danilo Krummrich, Matthew Brost, Philipp Stanner

<tldr>
Replacing FIFO with a flavour of deadline driven scheduling and removing round-
robin. Connecting the scheduler with dma-fence deadlines. Second draft and
testing by different drivers and feedback would be nice. I was only able to test
it with amdgpu. Other drivers may not even compile.
</tldr>

If I remember correctly Christian mentioned recently (give or take) that maybe
round-robin could be removed. That got me thinking how and what could be
improved and simplified. So I played a bit in the scheduler code and came up
with something which appears to not crash at least. Whether or not there are
significant advantages apart from maybe code consolidation and reduction is the
main thing to be determined.

One big question is whether round-robin can really be removed. Does anyone use
it, rely on it, or what are even use cases where it is much better than FIFO.

See "drm/sched: Add deadline policy" commit message for a short description on
what flavour of deadline scheduling it is. But in essence it should a more fair
FIFO where higher priority can not forever starve lower priorities.

"drm/sched: Connect with dma-fence deadlines" wires up dma-fence deadlines to
the scheduler because it is easy and makes logical sense with this. And I
noticed userspace already uses it so why not wire it up fully.

Otherwise the series is a bit of progression from trivial cleanups to
consolidating RR into FIFO code paths and going from there to deadline and then
some code simplification to 1:1 run queue to scheduler relationship, because
deadline does not need per priority run queues.

There is quite a bit of code to go throught here so I think it could be even
better if other drivers could give it a spin as is and see if some improvements
can be detected. Or at least no regressions.

v2:
 * Fixed many rebase errors.
 * Added some new patches.
 * Dropped single shot dependecy handling.

Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <pstanner@redhat.com>

Tvrtko Ursulin (18):
  drm/amdgpu: Use DRM scheduler API in amdgpu_xcp_release_sched
  drm/sched: Delete unused update_job_credits
  drm/sched: Remove one local variable
  drm/sched: Remove weak paused submission checks
  drm/sched: Avoid double re-lock on the job free path
  drm/sched: Add helper to check job dependencies
  drm/imagination: Use the drm_sched_job_has_dependency helper
  drm/sched: Clarify locked section in drm_sched_rq_select_entity_fifo
  drm/sched: Remove idle entity from tree
  drm/sched: Implement RR via FIFO
  drm/sched: Consolidate entity run queue management
  drm/sched: Move run queue related code into a separate file
  drm/sched: Add deadline policy
  drm/sched: Remove FIFO and RR and simplify to a single run queue
  drm/sched: Queue all free credits in one worker invocation
  drm/sched: Connect with dma-fence deadlines
  drm/sched: Embed run queue singleton into the scheduler
  drm/sched: Scale deadlines depending on queue depth

 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c      |   6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c     |  27 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.h     |   5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h   |   8 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c |   8 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c     |  10 +-
 drivers/gpu/drm/imagination/pvr_job.c       |  12 +-
 drivers/gpu/drm/scheduler/Makefile          |   2 +-
 drivers/gpu/drm/scheduler/sched_entity.c    | 147 +++---
 drivers/gpu/drm/scheduler/sched_fence.c     |   2 +-
 drivers/gpu/drm/scheduler/sched_main.c      | 541 ++++----------------
 drivers/gpu/drm/scheduler/sched_rq.c        | 177 +++++++
 include/drm/gpu_scheduler.h                 |  55 +-
 13 files changed, 424 insertions(+), 576 deletions(-)
 create mode 100644 drivers/gpu/drm/scheduler/sched_rq.c

-- 
2.47.1


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2025-01-13 10:32 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 18:35 [RFC v2 00/18] Deadline scheduler and other ideas Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 01/18] drm/amdgpu: Use DRM scheduler API in amdgpu_xcp_release_sched Tvrtko Ursulin
2025-01-09 12:30   ` Christian König
2025-01-10 10:51     ` Tvrtko Ursulin
2025-01-10 14:48       ` Alex Deucher
2025-01-08 18:35 ` [RFC 02/18] drm/sched: Delete unused update_job_credits Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 03/18] drm/sched: Remove one local variable Tvrtko Ursulin
2025-01-09 12:49   ` Christian König
2025-01-09 13:20     ` Tvrtko Ursulin
2025-01-09 14:17       ` Christian König
2025-01-09 16:13         ` Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 04/18] drm/sched: Remove weak paused submission checks Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 05/18] drm/sched: Avoid double re-lock on the job free path Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 06/18] drm/sched: Add helper to check job dependencies Tvrtko Ursulin
2025-01-10 16:38   ` Matt Coster
2025-01-08 18:35 ` [RFC 07/18] drm/imagination: Use the drm_sched_job_has_dependency helper Tvrtko Ursulin
2025-01-10 16:39   ` Matt Coster
2025-01-13 10:32     ` Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 08/18] drm/sched: Clarify locked section in drm_sched_rq_select_entity_fifo Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 09/18] drm/sched: Remove idle entity from tree Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 10/18] drm/sched: Implement RR via FIFO Tvrtko Ursulin
2025-01-09 12:59   ` Christian König
2025-01-09 13:27     ` Tvrtko Ursulin
2025-01-09 14:12       ` Christian König
2025-01-10 11:00         ` Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 11/18] drm/sched: Consolidate entity run queue management Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 12/18] drm/sched: Move run queue related code into a separate file Tvrtko Ursulin
2025-01-09 13:02   ` Christian König
2025-01-09 13:35     ` Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 13/18] drm/sched: Add deadline policy Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 14/18] drm/sched: Remove FIFO and RR and simplify to a single run queue Tvrtko Ursulin
2025-01-09 13:04   ` Christian König
2025-01-08 18:35 ` [RFC 15/18] drm/sched: Queue all free credits in one worker invocation Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 16/18] drm/sched: Connect with dma-fence deadlines Tvrtko Ursulin
2025-01-09 13:07   ` Christian König
2025-01-09 13:41     ` Tvrtko Ursulin
2025-01-09 13:51       ` Christian König
2025-01-09 16:03         ` Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 17/18] drm/sched: Embed run queue singleton into the scheduler Tvrtko Ursulin
2025-01-08 18:35 ` [RFC 18/18] drm/sched: Scale deadlines depending on queue depth Tvrtko Ursulin

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.