Skip to content

Use user-defined workqueue lockdep map for drm sched

Matthew Brost dri-devel intel-xe 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 7 repliesIn review
  2. v35 patches 8 repliesSuperseded
  3. v25 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC3 patches4 repliesSuperseded

Changes in v4 from the cover letter

- Rebase on 6.12 which has required work queue patches

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/sched: Use drm sched lockdep map for submit_wqdrivers/gpu/drm/scheduler/sched_main.c+11 -05 replies
2/2drm/xe: Drop GuC submit_wq pooldrivers/gpu/drm/xe/xe_guc_submit.c drivers/gpu/drm/xe/xe_guc_types.h+1 -662 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchNirmoy DasDanilo KrummrichHimal Prasad Ghimiray
1/2R-b A-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/2] Use user-defined workqueue lockdep map for drm sched

By default, each DRM scheduler instance creates an ordered workqueue for submission, and each workqueue creation allocates a new lockdep map. This becomes problematic when a DRM scheduler is created for every user queue (e.g., in DRM drivers with firmware schedulers like Xe) due to the limited number of available lockdep maps. With numerous user queues being created and destroyed, lockdep may run out of maps, leading to lockdep being disabled. Xe mitigated this by creating a pool of workqueues for DRM scheduler use. However, this approach also encounters issues if the driver is unloaded and reloaded multiple times or if many VFs are probed.

To address this, we propose creating a single lockdep map for all DRM scheduler workqueues, which will also resolve issues for other DRM drivers that create a DRM scheduler per user queue.

This solution has been tested by unloading and reloading the Xe driver. Before this series, around 30 driver reloads would result in lockdep being turned off. After implementing the series, the driver can be unloaded and reloaded hundreds of times without issues.

v2:
- Split workqueue changes into multiple patches
- Add alloc_workqueue_lockdep_map (Tejun)
- Drop RFC
v3:
- Drop __WQ_USER_OWNED_LOCKDEP (Tejun)
- static inline alloc_ordered_workqueue_lockdep_map (Tejun)
v4:
- Rebase on 6.12 which has required work queue patches

Matt

Matthew Brost (2):
drm/sched: Use drm sched lockdep map for submit_wq drm/xe: Drop GuC submit_wq pool

 drivers/gpu/drm/scheduler/sched_main.c | 11 +++++
 drivers/gpu/drm/xe/xe_guc_submit.c     | 60 +-------------------------
 drivers/gpu/drm/xe/xe_guc_types.h      |  7 ---
 3 files changed, 12 insertions(+), 66 deletions(-)
Signature · 1 line
2.34.1