All of lore.kernel.org
 help / color / mirror / Atom feed
* ww_mutex deadlock handling cleanup
@ 2019-06-14 12:41 Christian König
  2019-06-14 12:41 ` [PATCH 1/6] locking: add ww_mutex_(un)lock_for_each helpers Christian König
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Christian König @ 2019-06-14 12:41 UTC (permalink / raw)
  To: daniel, l.stach, linux+etnaviv, christian.gmeiner, yuq825, eric,
	peterz, thellstrom, dri-devel, linux-kernel, etnaviv, lima

The ww_mutex implementation allows drivers to acquire locks on a set of locking
primitives with detection of deadlocks. If a deadlock happens we can then
backoff and reacquire the contended lock until we should finally be able to
acquire all necessary locks for an operation.

The problem is that handling those deadlocks was the burden of the user of
the ww_mutex implementation and at least some users didn't got that right
on the first try.

So this patch adds two macros to lock and unlock multiple ww_mutex instances
with the necessary deadlock handling. I'm not a big fan of macros, but it still
better then implementing the same logic at least halve a dozen times.

Please note that only the first two patches are more than compile tested.
And this only cleans up the tip of the iceberg, just enough to show the
potential of those two macros.

Please review and/or comment,
Christian.



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

end of thread, other threads:[~2019-06-17  9:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 12:41 ww_mutex deadlock handling cleanup Christian König
2019-06-14 12:41 ` [PATCH 1/6] locking: add ww_mutex_(un)lock_for_each helpers Christian König
2019-06-14 12:56   ` Peter Zijlstra
2019-06-14 12:56     ` Peter Zijlstra
2019-06-14 13:04     ` Christian König
2019-06-14 12:41 ` [PATCH 2/6] drm/ttm: use new ww_mutex_(un)lock_for_each macros Christian König
2019-06-14 12:41 ` [PATCH 3/6] drm/gem: " Christian König
2019-06-14 12:41   ` Christian König
2019-06-14 12:59   ` Peter Zijlstra
2019-06-14 12:59     ` Peter Zijlstra
2019-06-14 13:06     ` Christian König
2019-06-14 13:21       ` Peter Zijlstra
2019-06-14 13:19   ` Peter Zijlstra
2019-06-14 15:22     ` Daniel Vetter
2019-06-14 18:10       ` Christian König
2019-06-14 18:24         ` Daniel Vetter
2019-06-14 18:24           ` Daniel Vetter
2019-06-14 18:51           ` Christian König
2019-06-14 20:30             ` Daniel Vetter
2019-06-14 20:30               ` Daniel Vetter
2019-06-15 13:56               ` Daniel Vetter
2019-06-15 13:56                 ` Daniel Vetter
2019-06-17  9:30                 ` Christian König
2019-06-14 12:41 ` [PATCH 4/6] drm/etnaviv: " Christian König
2019-06-14 12:41   ` Christian König
2019-06-14 12:41 ` [PATCH 5/6] drm/lima: " Christian König
2019-06-14 12:41   ` Christian König
2019-06-14 12:41 ` [PATCH 6/6] drm/vc4: " Christian König

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.