Skip to content

Commit b69f8c4

Browse files
LuizOt31rodrigovivi
authored andcommitted
drm/i915: Remove todo and comments about struct_mutex
This patch completes the removal of struct_mutex from the driver. Remove the related TODO item, as the transition away from struct_mutex is now complete. Also clean up references to struct_mutex in i915.rst to avoid outdated documentation. Signed-off-by: Luiz Otavio Mello <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 34ac58d commit b69f8c4

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

Documentation/gpu/i915.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,20 +358,13 @@ Locking Guidelines
358358
#. All locking rules and interface contracts with cross-driver interfaces
359359
(dma-buf, dma_fence) need to be followed.
360360

361-
#. No struct_mutex anywhere in the code
362-
363361
#. dma_resv will be the outermost lock (when needed) and ww_acquire_ctx
364362
is to be hoisted at highest level and passed down within i915_gem_ctx
365363
in the call chain
366364

367365
#. While holding lru/memory manager (buddy, drm_mm, whatever) locks
368366
system memory allocations are not allowed
369367

370-
* Enforce this by priming lockdep (with fs_reclaim). If we
371-
allocate memory while holding these looks we get a rehash
372-
of the shrinker vs. struct_mutex saga, and that would be
373-
real bad.
374-
375368
#. Do not nest different lru/memory manager locks within each other.
376369
Take them in turn to update memory allocations, relying on the object’s
377370
dma_resv ww_mutex to serialize against other operations.

Documentation/gpu/todo.rst

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -173,31 +173,6 @@ Contact: Simona Vetter
173173

174174
Level: Intermediate
175175

176-
Get rid of dev->struct_mutex from GEM drivers
177-
---------------------------------------------
178-
179-
``dev->struct_mutex`` is the Big DRM Lock from legacy days and infested
180-
everything. Nowadays in modern drivers the only bit where it's mandatory is
181-
serializing GEM buffer object destruction. Which unfortunately means drivers
182-
have to keep track of that lock and either call ``unreference`` or
183-
``unreference_locked`` depending upon context.
184-
185-
Core GEM doesn't have a need for ``struct_mutex`` any more since kernel 4.8,
186-
and there's a GEM object ``free`` callback for any drivers which are
187-
entirely ``struct_mutex`` free.
188-
189-
For drivers that need ``struct_mutex`` it should be replaced with a driver-
190-
private lock. The tricky part is the BO free functions, since those can't
191-
reliably take that lock any more. Instead state needs to be protected with
192-
suitable subordinate locks or some cleanup work pushed to a worker thread. For
193-
performance-critical drivers it might also be better to go with a more
194-
fine-grained per-buffer object and per-context lockings scheme. Currently only
195-
the ``msm`` and `i915` drivers use ``struct_mutex``.
196-
197-
Contact: Simona Vetter, respective driver maintainers
198-
199-
Level: Advanced
200-
201176
Move Buffer Object Locking to dma_resv_lock()
202177
---------------------------------------------
203178

0 commit comments

Comments
 (0)