]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Simplify userptr locking
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 10 Jun 2021 14:35:25 +0000 (16:35 +0200)
committerMatthew Auld <matthew.auld@intel.com>
Mon, 14 Jun 2021 11:23:49 +0000 (12:23 +0100)
commitd1027d4d9e234a10e4a060c183feb9c567e3a542
treeaecfa6ed9de8951da90fd80dda145a005c356c87
parentfcd1f2eaf74c1e806c85712ca5b88c4c6b950e33
drm/i915: Simplify userptr locking

Use an rwlock instead of spinlock for the global notifier lock
to reduce risk of contention in execbuf.

Protect object state with the object lock whenever possible rather
than with the global notifier lock

Don't take an explicit page_ref in userptr_submit_init() but rather
call get_pages() after obtaining the page list so that
get_pages() holds the page_ref. This means we don't need to call
userptr_submit_fini(), which is needed to avoid awkward locking
in our upcoming VM_BIND code.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210610143525.624677-1-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/gem/i915_gem_object.h
drivers/gpu/drm/i915/gem/i915_gem_userptr.c
drivers/gpu/drm/i915/i915_drv.h