]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/shrinker: Wrap need_resched() inside preempt-disable
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 4 Aug 2017 10:41:35 +0000 (11:41 +0100)
committerJani Nikula <jani.nikula@intel.com>
Mon, 7 Aug 2017 10:38:56 +0000 (13:38 +0300)
commit5a121c6123f298a436e9f1a22de474c7d9535045
treefe4ac7530bfd8cde14873c3844aa29f04890e4f0
parenta06745b1a398af780059af88ebd988546e4e9c70
drm/i915/shrinker: Wrap need_resched() inside preempt-disable

In order for us to successfully detect the end of a timeslice,
preemption must be disabled. Otherwise, inside the loop we may be
preempted many times without our noticing, and each time our timeslice
will be reset, invalidating need_resched()

Reported-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reported-by: Tomi Sarvela <tomi.p.sarvela@intel.com>
Fixes: db40f24eab2b ("drm/i915: Spin for struct_mutex inside shrinker")
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>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.13-rc1+
Link: https://patchwork.freedesktop.org/patch/msgid/20170804104135.26805-1-chris@chris-wilson.co.uk
Tested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
(cherry picked from commit 6cb0c6ad9e07f2c7971c4e8e0d9b7ceba151a925)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_gem_shrinker.c