]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Complete both freed-object passes before draining the workqueue
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 May 2019 13:57:51 +0000 (14:57 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 May 2019 19:38:50 +0000 (20:38 +0100)
commite90b5207ec1d3ebb555e3624f9e9a885d1a96b75
tree406b4fa8aafd3bdad6000d923fc2c229e049c762
parent481f4fbbf8169f5280e2c8168ec5e43515a1ce1e
drm/i915: Complete both freed-object passes before draining the workqueue

The workqueue code complains viciously if we try to queue more work onto
the queue while attampting to drain it. As we asynchronously free
objects and defer their enqueuing with RCU, it is quite tricky to
quiesce the system before attempting to drain the workqueue. Yet drain
we must to ensure that the worker is idle before unloading the module.

Give the freed object drain 3 whole passes with multiple rcu_barrier()
to give the defer freeing of several levels each protected by RCU and
needing a grace period before its parent can be freed, ultimately
resulting in a GEM object being freed after another RCU period.

A consequence is that it will make module unload even slower.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110550
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190501135753.8711-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_drv.h