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: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com> Reported-by: NTomi Sarvela <tomi.p.sarvela@intel.com> Fixes: 290271de ("drm/i915: Spin for struct_mutex inside shrinker") Signed-off-by: NChris 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.ukTested-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com> (cherry picked from commit 6cb0c6ad) Signed-off-by: NJani Nikula <jani.nikula@intel.com>
Showing
想要评论请 注册 或 登录