dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/5] DRM scheduler changes for Xe
@ 2023-10-31  3:24 Matthew Brost
  2023-10-31  3:24 ` [PATCH v8 1/5] drm/sched: Add drm_sched_wqueue_* helpers Matthew Brost
                   ` (5 more replies)
  0 siblings, 6 replies; 29+ messages in thread
From: Matthew Brost @ 2023-10-31  3:24 UTC (permalink / raw)
  To: dri-devel, intel-xe
  Cc: robdclark, thomas.hellstrom, Matthew Brost, sarah.walker, ltuikov,
	ketil.johnsen, Liviu.Dudau, mcanal, boris.brezillon, dakr,
	donald.robson, lina, christian.koenig, faith.ekstrand

      As a prerequisite to merging the new Intel Xe DRM driver [1] [2], we
have been asked to merge our common DRM scheduler patches first.

This a continuation of a RFC [3] with all comments addressed, ready for
a full review, and hopefully in state which can merged in the near
future. More details of this series can found in the cover letter of the
RFC [3].

These changes have been tested with the Xe driver. Based on drm-tip branch.

A follow up series will be posted to address some of dakr requets for
kernel doc changes.

v2:
 - Break run job, free job, and process message in own work items
 - This might break other drivers as run job and free job now can run in
   parallel, can fix up if needed

v3:
 - Include missing patch 'drm/sched: Add drm_sched_submit_* helpers'
 - Fix issue with setting timestamp to early
 - Don't dequeue jobs for single entity after calling entity fini
 - Flush pending jobs on entity fini
 - Add documentation for entity teardown
 - Add Matthew Brost to maintainers of DRM scheduler

v4:
 - Drop message interface
 - Drop 'Flush pending jobs on entity fini'
 - Drop 'Add documentation for entity teardown'
 - Address all feedback

v5:
 - Address Luben's feedback
 - Drop starting TDR after calling run_job()
 - Drop adding Matthew Brost to maintainers of DRM scheduler

v6:
 - Address Luben's feedback
 - Include base commit

v7:
 - Drop SINGLE_ENTITY mode rather pull in Luben's patch for dynamic run queues
 - Address Luben's feedback for free_job work item patch

v8:
 - Rebase on drm-tip which includes Luben's patch for dynamic run queues
 - Don't adjust comments, change variable names, function names twice in series
 - Don't move existing code to different places in a file to preserve git history

Matt

[1] https://gitlab.freedesktop.org/drm/xe/kernel
[2] https://patchwork.freedesktop.org/series/112188/
[3] https://patchwork.freedesktop.org/series/116055/

Matthew Brost (5):
  drm/sched: Add drm_sched_wqueue_* helpers
  drm/sched: Convert drm scheduler to use a work queue rather than
    kthread
  drm/sched: Split free_job into own work item
  drm/sched: Add drm_sched_start_timeout_unlocked helper
  drm/sched: Add a helper to queue TDR immediately

 .../drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c   |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   |  15 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    |  14 +-
 drivers/gpu/drm/etnaviv/etnaviv_sched.c       |   2 +-
 drivers/gpu/drm/lima/lima_sched.c             |   2 +-
 drivers/gpu/drm/msm/adreno/adreno_device.c    |   6 +-
 drivers/gpu/drm/msm/msm_ringbuffer.c          |   2 +-
 drivers/gpu/drm/nouveau/nouveau_sched.c       |   2 +-
 drivers/gpu/drm/panfrost/panfrost_job.c       |   2 +-
 drivers/gpu/drm/scheduler/sched_main.c        | 301 ++++++++++++------
 drivers/gpu/drm/v3d/v3d_sched.c               |  10 +-
 include/drm/gpu_scheduler.h                   |  20 +-
 12 files changed, 248 insertions(+), 130 deletions(-)


base-commit: b560681c6bf623db41064ac486dd148d6c103e53
-- 
2.34.1


^ permalink raw reply	[flat|nested] 29+ messages in thread
* [PATCH] Revert "drm/sched: Qualify drm_sched_wakeup() by drm_sched_entity_is_ready()"
@ 2023-11-27 12:21 Bert Karwatzki
  0 siblings, 0 replies; 29+ messages in thread
From: Bert Karwatzki @ 2023-11-27 12:21 UTC (permalink / raw)
  To: Luben Tuikov
  Cc: robdclark, sarah.walker, ltuikov, ketil.johnsen, lina, mcanal,
	Liviu.Dudau, dri-devel, christian.koenig, boris.brezillon, dakr,
	Bert Karwatzki, intel-xe, faith.ekstrand, donald.robson

Commit f3123c25 (in combination with the use of work queues by the gpu
scheduler) leads to random lock ups of the GUI [1,2].

This is not a complete revert of commit f3123c25 as drm_sched_wakeup
still needs its entity argument to pass it to drm_sched_can_queue.

[1] https://gitlab.freedesktop.org/drm/amd/-/issues/2994
[2] https://lists.freedesktop.org/archives/dri-devel/2023-November/431606.html

This reverts commit f3123c2590005c5ff631653d31428e40cd10c618.
---
 drivers/gpu/drm/scheduler/sched_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index 682aebe96db7..550492a7a031 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -1029,9 +1029,8 @@ EXPORT_SYMBOL(drm_sched_job_cleanup);
 void drm_sched_wakeup(struct drm_gpu_scheduler *sched,
 		      struct drm_sched_entity *entity)
 {
-	if (drm_sched_entity_is_ready(entity))
-		if (drm_sched_can_queue(sched, entity))
-			drm_sched_run_job_queue(sched);
+	if (drm_sched_can_queue(sched, entity))
+		drm_sched_run_job_queue(sched);
 }

 /**
--
2.43.0


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

end of thread, other threads:[~2023-11-27 15:14 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-31  3:24 [PATCH v8 0/5] DRM scheduler changes for Xe Matthew Brost
2023-10-31  3:24 ` [PATCH v8 1/5] drm/sched: Add drm_sched_wqueue_* helpers Matthew Brost
2023-10-31  3:24 ` [PATCH v8 2/5] drm/sched: Convert drm scheduler to use a work queue rather than kthread Matthew Brost
2023-10-31  3:24 ` [PATCH v8 3/5] drm/sched: Split free_job into own work item Matthew Brost
2023-11-01 22:13   ` Luben Tuikov
2023-11-02 11:13   ` Tvrtko Ursulin
2023-11-02 22:46     ` [PATCH] drm/sched: Eliminate drm_sched_run_job_queue_if_ready() Luben Tuikov
2023-11-03 10:39       ` Tvrtko Ursulin
2023-11-04  0:25         ` Luben Tuikov
2023-11-06 12:54           ` Tvrtko Ursulin
2023-11-03 15:13       ` Matthew Brost
2023-11-04  0:24         ` Luben Tuikov
2023-11-02 22:58     ` [PATCH v8 3/5] drm/sched: Split free_job into own work item Luben Tuikov
2023-11-07  4:10     ` [PATCH] drm/sched: Don't disturb the entity when in RR-mode scheduling Luben Tuikov
2023-11-07 11:48       ` Matthew Brost
2023-11-08  3:28         ` Luben Tuikov
2023-11-07 17:53       ` Danilo Krummrich
2023-11-08  3:29         ` Luben Tuikov
2023-11-08  0:41       ` Danilo Krummrich
2023-11-09  6:52         ` Luben Tuikov
2023-11-09 19:24           ` Danilo Krummrich
2023-11-09 23:41             ` Danilo Krummrich
2023-11-09 23:49               ` Luben Tuikov
2023-11-27 13:30                 ` [PATCH] Revert "drm/sched: Qualify drm_sched_wakeup() by drm_sched_entity_is_ready()" Bert Karwatzki
2023-11-27 15:14                   ` Luben Tuikov
2023-10-31  3:24 ` [PATCH v8 4/5] drm/sched: Add drm_sched_start_timeout_unlocked helper Matthew Brost
2023-10-31  3:24 ` [PATCH v8 5/5] drm/sched: Add a helper to queue TDR immediately Matthew Brost
2023-11-01 22:16 ` [PATCH v8 0/5] DRM scheduler changes for Xe Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2023-11-27 12:21 [PATCH] Revert "drm/sched: Qualify drm_sched_wakeup() by drm_sched_entity_is_ready()" Bert Karwatzki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox