drm/i915/gem: Move obj->lut_list under its own lock
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 Jul 2020 08:44:39 +0000 (09:44 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 Jul 2020 10:58:49 +0000 (11:58 +0100)
commit096a42dd1998a966c1b9e0cf489103d77d6473a5
tree4098ca3771eb9e84aa52ff2bfb00b1cc41ac7da8
parent0ba7ffea2d118af7ca0df26cad418f71486b93ad
drm/i915/gem: Move obj->lut_list under its own lock

The obj->lut_list is traversed when the object is closed as the file
table is destroyed during process termination. As this occurs before we
kill any outstanding context if, due to some bug or another, the closure
is blocked, then we fail to shootdown any inflight operations
potentially leaving the GPU spinning forever. As we only need to guard
the list against concurrent closures and insertions, the hold is short
and merits being treated as a simple spinlock.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200701084439.17025-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_context.c
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/gem/i915_gem_object.c
drivers/gpu/drm/i915/gem/i915_gem_object_types.h