]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Pin the pages first in shmem prepare read/write
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 18 Aug 2016 16:16:50 +0000 (17:16 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 18 Aug 2016 21:36:45 +0000 (22:36 +0100)
commitc1d04087ec4c5de02bd95c341e046885683fe04d
tree8b1c971efc4773effa1fe21ba31ac49dd9334ef9
parentfe9a50a8c6c89ab58042b30909ce479bd16eb06d
drm/i915: Pin the pages first in shmem prepare read/write

There is an improbable, but not impossible, case that if we leave the
pages unpin as we operate on the object, then somebody via the shrinker
may steal the lock (which lock? right now, it is struct_mutex, THE lock)
and change the cache domains after we have already inspected them.

(Whilst here, avail ourselves of the opportunity to take a couple of
steps to make the two functions look more similar.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160818161718.27187-11-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c