]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gt: Pull release of node->age under the spinlock
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 30 Jul 2020 13:40:49 +0000 (14:40 +0100)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Mon, 7 Sep 2020 10:16:58 +0000 (13:16 +0300)
commit787e878c250489a4eedd76417043714d42af05a6
treedc598465f83222a21bd4ff900651357f452d386b
parente16f96a04d9f3fcd831b46ca26d98fcc0c06389c
drm/i915/gt: Pull release of node->age under the spinlock

We need to ensure that the list is valid prior to marking the node as
retrievable, otherwise we may see two threads compete over the same node
in intel_gt_get_buffer_pool(). If the first thread acquires and releases
the node in the same jiffie, the second thread may then acquire it (as
the jiffie now again matches the expected value) and claim the node
before it is put back into the list.

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/20200730134049.8822-1-chris@chris-wilson.co.uk
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c