From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: tj@kernel.org, jiangshanlai@gmail.com, christian.koenig@amd.com,
ltuikov89@gmail.com, daniel@ffwll.ch
Subject: [PATCH v2 0/5] Use user-defined workqueue lockdep map for drm sched
Date: Tue, 30 Jul 2024 17:31:14 -0700 [thread overview]
Message-ID: <20240731003119.2422940-1-matthew.brost@intel.com> (raw)
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)
- Don't RFC
Matt
Matthew Brost (5):
workqueue: Split alloc_workqueue into internal function and lockdep
init
workqueue: Change workqueue lockdep map to pointer
workqueue: Add interface for user-defined workqueue lockdep map
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 ---
include/linux/workqueue.h | 25 +++++++++
kernel/workqueue.c | 75 ++++++++++++++++++++------
5 files changed, 97 insertions(+), 81 deletions(-)
--
2.34.1
next reply other threads:[~2024-07-31 0:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 0:31 Matthew Brost [this message]
2024-07-31 0:31 ` [PATCH v2 1/5] workqueue: Split alloc_workqueue into internal function and lockdep init Matthew Brost
2024-07-31 0:31 ` [PATCH v2 2/5] workqueue: Change workqueue lockdep map to pointer Matthew Brost
2024-07-31 0:31 ` [PATCH v2 3/5] workqueue: Add interface for user-defined workqueue lockdep map Matthew Brost
2024-07-31 0:36 ` Tejun Heo
2024-07-31 1:15 ` Matthew Brost
2024-07-31 0:31 ` [PATCH v2 4/5] drm/sched: Use drm sched lockdep map for submit_wq Matthew Brost
2024-07-31 0:31 ` [PATCH v2 5/5] drm/xe: Drop GuC submit_wq pool Matthew Brost
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=20240731003119.2422940-1-matthew.brost@intel.com \
--to=matthew.brost@intel.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ltuikov89@gmail.com \
--cc=tj@kernel.org \
/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
all inboxes | Powered by JetHome®