aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_batch_pool.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-06-09 12:03:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-06-14 10:55:11 +0100
commit290271de34f6c22ec2337e3293224575459747d6 (patch)
treef96d17399bd8f949a07034ac82ada002f995624a /drivers/gpu/drm/i915/i915_gem_batch_pool.c
parentdrm/i915: Only restrict noreclaim in the early shrink passes (diff)
downloadlinux-dev-290271de34f6c22ec2337e3293224575459747d6.tar.xz
linux-dev-290271de34f6c22ec2337e3293224575459747d6.zip
drm/i915: Spin for struct_mutex inside shrinker
Having resolved whether or not we would deadlock upon a call to mutex_lock(&dev->struct_mutex), we can then spin for the contended struct_mutex if we are not the owner. We cannot afford to simply block and wait for the mutex, as the owner may itself be waiting for the allocator -- i.e. a cyclic deadlock. This should significantly improve the chance of running the shrinker for other processes whilst the GPU is busy. A more balanced approach would be to optimistically spin whilst the mutex owner was on the cpu and there was an opportunity to acquire the mutex for ourselves quickly. However, that requires support from kernel/locking/ and a new mutex_spin_trylock() primitive. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170609110350.1767-4-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_batch_pool.c')
0 files changed, 0 insertions, 0 deletions