]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Trim struct_mutex hold duration for i915_gem_free_objects
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 13 Oct 2017 20:26:21 +0000 (21:26 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 16 Oct 2017 19:44:19 +0000 (20:44 +0100)
commit0f941f520a7c7b59cb53a6c7fe4254ae92df86d2
tree6835f462c34320565e20ec07c629b028e2d89357
parent4c80aaa72388b929b578172ea5edf2004fa99da4
drm/i915: Trim struct_mutex hold duration for i915_gem_free_objects

We free objects in bulk after they wait for their RCU grace period.
Currently, we take struct_mutex and unbind all the objects. This can lead
to a long lock duration during which time those objects have their pages
unfreeable (i.e. the shrinker is prevented from reaping those pages). If
we only process a single object under the struct_mutex and then free the
pages, the number of objects locked away from the shrinker is minimal
and we allow regular clients better access to struct_mutex if they need
it.

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