From 4e31aa2e749700f6ece4c9454732166e7ffa7407 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 5 Nov 2020 16:07:23 +0100 Subject: [PATCH] 5.4-stable patches added patches: drm-i915-break-up-error-capture-compression-loops-with-cond_resched.patch --- ...-compression-loops-with-cond_resched.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 queue-5.4/drm-i915-break-up-error-capture-compression-loops-with-cond_resched.patch diff --git a/queue-5.4/drm-i915-break-up-error-capture-compression-loops-with-cond_resched.patch b/queue-5.4/drm-i915-break-up-error-capture-compression-loops-with-cond_resched.patch new file mode 100644 index 00000000000..9bd0a401231 --- /dev/null +++ b/queue-5.4/drm-i915-break-up-error-capture-compression-loops-with-cond_resched.patch @@ -0,0 +1,48 @@ +From 7d5553147613b50149238ac1385c60e5c7cacb34 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Wed, 16 Sep 2020 10:00:58 +0100 +Subject: drm/i915: Break up error capture compression loops with cond_resched() + +From: Chris Wilson + +commit 7d5553147613b50149238ac1385c60e5c7cacb34 upstream. + +As the error capture will compress user buffers as directed to by the +user, it can take an arbitrary amount of time and space. Break up the +compression loops with a call to cond_resched(), that will allow other +processes to schedule (avoiding the soft lockups) and also serve as a +warning should we try to make this loop atomic in the future. + +Testcase: igt/gem_exec_capture/many-* +Signed-off-by: Chris Wilson +Cc: Mika Kuoppala +Cc: stable@vger.kernel.org +Reviewed-by: Mika Kuoppala +Link: https://patchwork.freedesktop.org/patch/msgid/20200916090059.3189-2-chris@chris-wilson.co.uk +(cherry picked from commit 293f43c80c0027ff9299036c24218ac705ce584e) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_gpu_error.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/gpu/drm/i915/i915_gpu_error.c ++++ b/drivers/gpu/drm/i915/i915_gpu_error.c +@@ -307,6 +307,8 @@ static int compress_page(struct compress + + if (zlib_deflate(zstream, Z_NO_FLUSH) != Z_OK) + return -EIO; ++ ++ cond_resched(); + } while (zstream->avail_in); + + /* Fallback to uncompressed if we increase size? */ +@@ -392,6 +394,7 @@ static int compress_page(struct compress + if (!i915_memcpy_from_wc(ptr, src, PAGE_SIZE)) + memcpy(ptr, src, PAGE_SIZE); + dst->pages[dst->page_count++] = ptr; ++ cond_resched(); + + return 0; + } -- 2.47.3