[PATCH][SRU][F] UBUNTU: SAUCE: drm/i915: prevent direct writeback from the shrinker

Andrea Righi andrea.righi at canonical.com
Mon Apr 20 14:19:01 UTC 2020

BugLink: https://bugs.launchpad.net/bugs/1861359

The i915 shrinker can make the system unresponsive and kill interactive
performance by swapping out dirty objects to reclaim more memory.

Avoid the lags by preventing to swap out dirty objects from any task
(except kswapd).

This is not required in 5.5+, because it is properly fixed by commit
2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex")

However, backporting this commit to 5.4 is not trivial and the
regression potential is high. A simple change like this can be a
reasonable compromise to prevent the problem and avoid the risk of
introducing other bugs.

Fixes: 2d6692e642e7 ("drm/i915: Start writeback from the shrinker")
Signed-off-by: Sultan Alsawaf <sultan.alsawaf at canonical.com>
Signed-off-by: Andrea Righi <andrea.righi at canonical.com>
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
index edd21d14e64f..793bd586b80b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
@@ -357,8 +357,7 @@ i915_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
 				I915_SHRINK_BOUND |
 	if (sc->nr_scanned < sc->nr_to_scan && current_is_kswapd()) {
 		intel_wakeref_t wakeref;

More information about the kernel-team mailing list