[Intel-gfx] [PATCH v4 11/12] drm/i915/guc: Preemption! With GuC

Chris Wilson chris at chris-wilson.co.uk
Wed Oct 25 21:14:18 UTC 2017


Quoting MichaƂ Winiarski (2017-10-25 21:00:19)
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index d803ef5f4a7f..c2506fb3a483 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2921,6 +2921,16 @@ i915_gem_reset_prepare_engine(struct intel_engine_cs *engine)
>         tasklet_kill(&engine->execlists.irq_tasklet);
>         tasklet_disable(&engine->execlists.irq_tasklet);
>  
> +       /*
> +        * We're using worker to queue preemption requests from the tasklet in
> +        * GuC submission mode.
> +        * Even though tasklet was disabled, we may still have a worker queued.
> +        * Let's make sure that all workers scheduled before disabling the
> +        * tasklet are completed before continuing with the reset.
> +        */
> +       if (engine->i915->guc.preempt_wq)
> +               flush_workqueue(engine->i915->guc.preempt_wq);
> +
>         if (engine->irq_seqno_barrier)
>                 engine->irq_seqno_barrier(engine);

https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6192/fi-glk-dsi/igt@drv_hangman@error-state-basic.html

[   31.382512] i915 0000:00:02.0: Resetting rcs0 after gpu hang
[   31.382864] INFO: trying to register non-static key.
[   31.382871] the code is fine but needs lockdep annotation.
[   31.382874] turning off the locking correctness validator.
[   31.382879] CPU: 0 PID: 1473 Comm: drv_hangman Not tainted 4.14.0-rc6-CI-Patchwork_6192+ #1
[   31.382884] Hardware name: Intel Corp. Geminilake/GLK RVP2 LP4SD (07), BIOS GELKRVPA.X64.0062.B30.1708222146 08/22/2017
[   31.382890] Call Trace:
[   31.382898]  dump_stack+0x68/0x9f
[   31.382903]  register_lock_class+0x3fd/0x580
[   31.382907]  ? __bfs+0x129/0x210
[   31.382912]  __lock_acquire+0xa4/0x1b00
[   31.382916]  ? flush_workqueue+0x75/0x520
[   31.382921]  ? __raw_spin_lock_init+0x21/0x60
[   31.382925]  lock_acquire+0xb0/0x200
[   31.382929]  ? lock_acquire+0xb0/0x200
[   31.382932]  ? flush_workqueue+0x75/0x520
[   31.382936]  flush_workqueue+0x98/0x520
[   31.382939]  ? flush_workqueue+0x75/0x520
[   31.382944]  ? _raw_spin_unlock_irq+0x37/0x50
[   31.382991]  i915_gem_reset_prepare_engine+0x5b/0x90 [i915]
[   31.383024]  ? i915_gem_reset_prepare_engine+0x5b/0x90 [i915]
[   31.383055]  i915_reset_engine+0x43/0x100 [i915]
[   31.383087]  i915_handle_error+0x1ee/0x430 [i915]
[   31.383095]  ? __might_fault+0x3e/0x90
[   31.383127]  i915_wedged_set+0x84/0xd0 [i915]
[   31.383132]  simple_attr_write+0xb4/0xd0
[   31.383138]  full_proxy_write+0x54/0x80
[   31.383143]  __vfs_write+0x28/0x130
[   31.383148]  ? rcu_read_lock_sched_held+0x7a/0x90
[   31.383152]  ? rcu_sync_lockdep_assert+0x2f/0x60
[   31.383157]  ? __sb_start_write+0x10c/0x200
[   31.383161]  vfs_write+0xc8/0x1c0
[   31.383164]  SyS_write+0x49/0xb0
[   31.383169]  entry_SYSCALL_64_fastpath+0x1c/0xb1
[   31.383173] RIP: 0033:0x7f3492708670
[   31.383177] RSP: 002b:00007fffcbef7258 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[   31.383182] RAX: ffffffffffffffda RBX: ffffffff81491ef3 RCX: 00007f3492708670
[   31.383186] RDX: 0000000000000002 RSI: 00005637752962c5 RDI: 0000000000000007
[   31.383190] RBP: ffffc900022abf88 R08: 0000563776b75df0 R09: 0000000000000000
[   31.383195] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[   31.383199] R13: 00007fffcbef7660 R14: 000056377527ea10 R15: 0000000000000007
[   31.383205]  ? __this_cpu_preempt_check+0x13/0x20
[   31.383232] BUG: unable to handle kernel paging request at 0000000100000058

> +static void guc_preempt_work_destroy(struct intel_guc *guc)
> +{
> +       struct drm_i915_private *dev_priv = guc_to_i915(guc);
> +       struct intel_engine_cs *engine;
> +       enum intel_engine_id id;
> +
> +       for_each_engine(engine, dev_priv, id)
> +               cancel_work_sync(&guc->preempt_work[id].work);
> +
> +       destroy_workqueue(guc->preempt_wq);

guc->preempt_wq = NULL;

glk is special in that CI run for trying and failing to enable the GuC
due to no fw. (Do I hear the noise of a combinatorial explosion in the
background?)
-Chris



More information about the Intel-gfx mailing list