OSDN Git Service

drm/i915/gem: Only revoke mmap handlers if active
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 2 Jul 2020 16:36:23 +0000 (17:36 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 2 Jul 2020 19:46:08 +0000 (20:46 +0100)
commitdb8337853b834f806ab537200d35f0d1909e6b03
tree265ec23ce80f6db63da3715a53b000b40848aa90
parentcb2baf42dcec630acc15f9ff2f8c09c8b70b03da
drm/i915/gem: Only revoke mmap handlers if active

Avoid waking up the device and taking stale locks if we know that the
object is not currently mmapped. This is particularly useful as not many
object are actually mmapped and so we can destroy them without waking
the device up, and gives us a little more freedom of workqueue ordering
during shutdown.

v2: Pull the release_mmap() into its single user in freeing the objects,
where there can not be any race with a concurrent user of the freed
object. Or so one hopes!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
Link: https://patchwork.freedesktop.org/patch/msgid/20200702163623.6402-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_mman.c
drivers/gpu/drm/i915/gem/i915_gem_mman.h
drivers/gpu/drm/i915/gem/i915_gem_object.c