All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/14] Deadline scheduler and other ideas
@ 2024-12-30 16:52 Tvrtko Ursulin
  2024-12-30 16:52 ` [RFC 01/14] drm/sched: Delete unused update_job_credits Tvrtko Ursulin
                   ` (17 more replies)
  0 siblings, 18 replies; 61+ messages in thread
From: Tvrtko Ursulin @ 2024-12-30 16:52 UTC (permalink / raw)
  To: dri-devel
  Cc: kernel-dev, Tvrtko Ursulin, Christian König,
	Danilo Krummrich, Matthew Brost, Philipp Stanner

From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>

<tldr>
Replacing FIFO with a flavour of deadline driven scheduling and removing round-
robin. Connecting the scheduler with dma-fence deadlines. First 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 consolidating RR into FIFO
code paths and going from there to deadline and then to a change in how
dependencies are handled. And 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.

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 (14):
  drm/sched: Delete unused update_job_credits
  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: Ignore own fence earlier
  drm/sched: Resolve same scheduler dependencies earlier
  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
  dma-fence: Add helper for custom fence context when merging fences
  drm/sched: Resolve all job dependencies in one go

 drivers/dma-buf/dma-fence-unwrap.c          |   8 +-
 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     |   8 +-
 drivers/gpu/drm/scheduler/Makefile          |   2 +-
 drivers/gpu/drm/scheduler/sched_entity.c    | 316 ++++++-----
 drivers/gpu/drm/scheduler/sched_fence.c     |   5 +-
 drivers/gpu/drm/scheduler/sched_main.c      | 587 +++++---------------
 drivers/gpu/drm/scheduler/sched_rq.c        | 199 +++++++
 include/drm/gpu_scheduler.h                 |  74 ++-
 include/linux/dma-fence-unwrap.h            |  31 +-
 14 files changed, 606 insertions(+), 678 deletions(-)
 create mode 100644 drivers/gpu/drm/scheduler/sched_rq.c

-- 
2.47.1


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

end of thread, other threads:[~2025-01-19 11:46 UTC | newest]

Thread overview: 61+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-30 16:52 [RFC 00/14] Deadline scheduler and other ideas Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 01/14] drm/sched: Delete unused update_job_credits Tvrtko Ursulin
2025-01-08  8:34   ` Danilo Krummrich
2025-01-08 12:27     ` Boris Brezillon
2025-01-08 14:08       ` Matt Coster
2024-12-30 16:52 ` [RFC 02/14] drm/sched: Remove idle entity from tree Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 03/14] drm/sched: Implement RR via FIFO Tvrtko Ursulin
2025-01-08  9:42   ` Danilo Krummrich
2025-01-08 15:04     ` Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 04/14] drm/sched: Consolidate entity run queue management Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 05/14] drm/sched: Move run queue related code into a separate file Tvrtko Ursulin
2024-12-31  0:35   ` kernel test robot
2024-12-30 16:52 ` [RFC 06/14] drm/sched: Ignore own fence earlier Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 07/14] drm/sched: Resolve same scheduler dependencies earlier Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 08/14] drm/sched: Add deadline policy Tvrtko Ursulin
2025-01-02 13:11   ` Philipp Stanner
2025-01-03 12:40     ` Tvrtko Ursulin
2025-01-03 12:59       ` Philipp Stanner
2025-01-03 15:11         ` Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 09/14] drm/sched: Remove FIFO and RR and simplify to a single run queue Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 10/14] drm/sched: Queue all free credits in one worker invocation Tvrtko Ursulin
2025-01-07 11:08   ` Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 11/14] drm/sched: Connect with dma-fence deadlines Tvrtko Ursulin
2025-01-07 11:10   ` Tvrtko Ursulin
2025-01-09 11:38   ` Michel Dänzer
2025-01-09 13:31     ` Tvrtko Ursulin
2025-01-09 14:44       ` Michel Dänzer
2025-01-09 16:44         ` Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 12/14] drm/sched: Embed run queue singleton into the scheduler Tvrtko Ursulin
2024-12-31  2:39   ` kernel test robot
2024-12-30 16:52 ` [RFC 13/14] dma-fence: Add helper for custom fence context when merging fences Tvrtko Ursulin
2024-12-30 16:52 ` [RFC 14/14] drm/sched: Resolve all job dependencies in one go Tvrtko Ursulin
2024-12-31  6:01   ` kernel test robot
2025-01-02 13:09 ` [RFC 00/14] Deadline scheduler and other ideas Philipp Stanner
2025-01-03 12:02   ` Tvrtko Ursulin
2025-01-03 12:31     ` Christian König
2025-01-03 13:45       ` Philipp Stanner
2025-01-03 15:17       ` Tvrtko Ursulin
2025-01-09 15:08       ` Michel Dänzer
2025-01-09 16:55         ` Tvrtko Ursulin
2025-01-10  9:14           ` Michel Dänzer
2025-01-13 11:40             ` Tvrtko Ursulin
2025-01-13 15:29               ` Michel Dänzer
2025-01-15 13:38                 ` Tvrtko Ursulin
2025-01-15 14:46                   ` Michel Dänzer
2025-01-03 15:16 ` AW: " Koenig, Christian
2025-01-03 15:32   ` Tvrtko Ursulin
2025-01-06 13:47   ` Simona Vetter
2025-01-08  8:07     ` Philipp Stanner
2025-01-08 17:59       ` Simona Vetter
2025-01-08 18:06         ` Tvrtko Ursulin
2025-01-08  8:31 ` Danilo Krummrich
2025-01-08 15:13   ` Tvrtko Ursulin
2025-01-08 16:57     ` Danilo Krummrich
2025-01-08 18:55       ` Tvrtko Ursulin
2025-01-09 19:59         ` Matthew Brost
2025-01-10  9:16           ` Tvrtko Ursulin
2025-01-10 17:28             ` Matthew Brost
2025-01-13 12:59               ` Tvrtko Ursulin
2025-01-09 19:50       ` Matthew Brost
2025-01-17 12:12 ` Philipp Stanner

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.