drm/i915: Bump priority of clean up work

Submitted by Chris Wilson on July 12, 2018, 11:57 a.m.

Details

Message ID 20180712115729.3506-1-chris@chris-wilson.co.uk
State Accepted
Commit 41db645a33e775855aeeec1a437d5c1e24ff6c88
Headers show
Series "drm/i915: Bump priority of clean up work" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Chris Wilson July 12, 2018, 11:57 a.m.
We require that we keep the list of outstanding work short so that we do
not "leak" memory while pageflipping under stress. However that system
stress may delay kernel workers virtually indefinitely, which incurs the
pageflips stall and eventually hit a timeout waiting for the cleanup.

Try to combat CPU starvation of our short-lived cleanup workers by
switching to a high priority workqueue.

Testcase: igt/kms_cursor_legacy/all-pipes-torture-move
References: https://bugs.freedesktop.org/show_bug.cgi?id=107122
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
Not sure if highpri is enough to combat our RT torture...
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8a07de5ac740..626dea685b84 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12741,7 +12741,7 @@  static void intel_atomic_commit_tail(struct drm_atomic_state *state)
 	 * down.
 	 */
 	INIT_WORK(&state->commit_work, intel_atomic_cleanup_work);
-	schedule_work(&state->commit_work);
+	queue_work(system_highpri_wq, &state->commit_work);
 }
 
 static void intel_atomic_commit_work(struct work_struct *work)

Comments

Quoting Chris Wilson (2018-07-12 12:57:29)
> We require that we keep the list of outstanding work short so that we do
> not "leak" memory while pageflipping under stress. However that system
> stress may delay kernel workers virtually indefinitely, which incurs the
> pageflips stall and eventually hit a timeout waiting for the cleanup.
> 
> Try to combat CPU starvation of our short-lived cleanup workers by
> switching to a high priority workqueue.
> 
> Testcase: igt/kms_cursor_legacy/all-pipes-torture-move
> References: https://bugs.freedesktop.org/show_bug.cgi?id=107122
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> Not sure if highpri is enough to combat our RT torture...

CI thinks it is.
-Chris
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Quoting Chris Wilson (2018-07-12 12:57:29)
>> We require that we keep the list of outstanding work short so that we do
>> not "leak" memory while pageflipping under stress. However that system
>> stress may delay kernel workers virtually indefinitely, which incurs the
>> pageflips stall and eventually hit a timeout waiting for the cleanup.
>> 
>> Try to combat CPU starvation of our short-lived cleanup workers by
>> switching to a high priority workqueue.
>> 
>> Testcase: igt/kms_cursor_legacy/all-pipes-torture-move
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=107122
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> ---
>> Not sure if highpri is enough to combat our RT torture...
>
> CI thinks it is.

Not so familiar with the atomic commit. But it makes
sense and now there is evidence supporting it.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> -Chris
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Mika Kuoppala (2018-08-13 13:49:43)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Quoting Chris Wilson (2018-07-12 12:57:29)
> >> We require that we keep the list of outstanding work short so that we do
> >> not "leak" memory while pageflipping under stress. However that system
> >> stress may delay kernel workers virtually indefinitely, which incurs the
> >> pageflips stall and eventually hit a timeout waiting for the cleanup.
> >> 
> >> Try to combat CPU starvation of our short-lived cleanup workers by
> >> switching to a high priority workqueue.
> >> 
> >> Testcase: igt/kms_cursor_legacy/all-pipes-torture-move
> >> References: https://bugs.freedesktop.org/show_bug.cgi?id=107122
> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> ---
> >> Not sure if highpri is enough to combat our RT torture...
> >
> > CI thinks it is.
> 
> Not so familiar with the atomic commit. But it makes
> sense and now there is evidence supporting it.

Proof is indeed in the pudding; the CI stress case is about the worst it
can be so, with any luck the starvation issue is prevented. Thanks,
pushed.
-Chris