drm/i915/gt: Harden the heartbeat against a stuck driver
Subsystems (3)
PATCH 1/33 drm/i915/gt: Harden the heartbeat against a stuck driver
If the driver get stuck holding the kernel timeline, we cannot issue a heartbeat and so fail to discover that the driver is indeed stuck and do not issue a GPU reset (which would hopefully unstick the driver!). Switch to using a trylock so that we can query if the heartbeat's timelin mutex is locked elsewhere, and then use the timer to probe if it remains stuck at the same spot for consecutive heartbeats, indicating that the mutex has not been released and the engine has not progressed.
--- drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 14 ++++++++++++-- drivers/gpu/drm/i915/gt/intel_engine_types.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +12 -2
@@ -65,6 +65,7 @@ static void heartbeat(struct work_struct *wrk)container_of (wrk,typeof (*engine), heartbeat.work.work);struct intel_context *ce = engine->kernel_context;struct i915_request *rq; +unsigned long serial;/* Just in case everything has gone horribly wrong, give it a kick */ intel_engine_flush_submission (engine);
@@ -122,10 +123,19 @@ static void heartbeat(struct work_struct *wrk) goto out; } -if (engine->wakeref_serial == engine->serial) + serial =READ_ONCE (engine->serial); +if (engine->wakeref_serial == serial) goto out; -mutex_lock (&ce->timeline->mutex); +if (!mutex_trylock (&ce->timeline->mutex)) { +/* Unable to lock the kernel timeline, is the engine stuck? */ +if (xchg (&engine->heartbeat.blocked, serial) == serial) +intel_gt_handle_error (engine->gt, engine->mask, +I915_ERROR_CAPTURE , +"stopped heartbeat on %s" , + engine->name); + goto out; + }intel_context_enter (ce); rq =__i915_request_create (ce,GFP_NOWAIT | __GFP_NOWARN);
drivers/gpu/drm/i915/gt/intel_engine_types.h +1 -0
@@ -348,6 +348,7 @@ struct intel_engine_cs {struct {struct delayed_work work;struct i915_request *systole; +unsigned long blocked; } heartbeat;unsigned long serial;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/33 drm/i915/gt: Move the heartbeat into the highprio system wq
As we ensure that the heartbeat is reasonably fast (and should not block), move the heartbeat work into the system_highprio_wq to avoid having this essential task be blocked behind other slow work, such as our own retire_work_handler.
References: https://gitlab.freedesktop.org/drm/intel/-/issues/2119
--- drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +1 -1
@@ -32,7 +32,7 @@ static bool next_heartbeat(struct intel_engine_cs *engine) delay =msecs_to_jiffies_timeout (delay);if (delay >=HZ ) delay =round_jiffies_up_relative (delay); -mod_delayed_work (system_wq, &engine->heartbeat.work, delay); +mod_delayed_work (system_highpri_wq, &engine->heartbeat.work, delay);return true; }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 02/33] drm/i915/gt: Move the heartbeat into the highprio system wq
Quoted 7 lines · Chris Wilson
As we ensure that the heartbeat is reasonably fast (and should not block), move the heartbeat work into the
system_highprio_wqto avoid having this essential task be blocked behind other slow work, such as our ownretire_work_handler.References: https://gitlab.freedesktop.org/drm/intel/-/issues/2119
Signed-off-by Chris Wilson <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +1
-1@@ -32,7 +32,7 @@ static bool next_heartbeat(struct intel_engine_cs *engine) delay =msecs_to_jiffies_timeout (delay);if (delay >=HZ ) delay =round_jiffies_up_relative (delay); -mod_delayed_work (system_wq, &engine->heartbeat.work, delay); +mod_delayed_work (system_highpri_wq, &engine->heartbeat.work, delay);return true; }Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/33 drm/i915/gt: Decouple completed requests on unwind
In reply to Chris WilsonSince the introduction of preempt-to-busy, requests can complete in the background, even while they are not on the engine->active.requests list. As such, the engine->active.request list itself is not in strict retirement order, and we have to scan the entire list while unwinding to not miss any. However, if the request is completed we currently leave it on the list [until retirement], but we could just as simply remove it and stop treating it as active. We would only have to then traverse it once while unwinding in quick succession.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +4 -2
@@ -1114,8 +1114,10 @@ __unwind_incomplete_requests(struct intel_engine_cs *engine)list_for_each_entry_safe_reverse (rq, rn, &engine->active.requests, sched.link) { -if (i915_request_completed (rq)) -continue ;/* XXX */ +if (i915_request_completed (rq)) { +list_del_init (&rq->sched.link); +continue ; + }__i915_request_unsubmit (rq);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/33 drm/i915/gt: Check for a completed last request once
In reply to Chris WilsonPull the repeated check for the last active request being completed to a single spot, when deciding whether or not execlist preemption is required.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +4 -10
@@ -2137,12 +2137,11 @@ static void execlists_dequeue(struct intel_engine_cs *engine)*/ if ((last = *active)) { -if (need_preempt (engine, last, rb)) { -if (i915_request_completed (last)) { -tasklet_hi_schedule (&execlists->tasklet); -return ; - } +if (i915_request_completed (last) && + !list_is_last (&last->sched.link, &engine->active.requests)) +return ; +if (need_preempt (engine, last, rb)) { ENGINE_TRACE(engine, "preempting last=%llx:%lld, prio=%d, hint=%d\n", last->fence.context,
@@ -2170,11 +2169,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine) last =NULL ; }else if (need_timeslice (engine, last, rb) &×lice_expired (execlists, last)) { -if (i915_request_completed (last)) { -tasklet_hi_schedule (&execlists->tasklet); -return ; - } - ENGINE_TRACE(engine, "expired last=%llx:%lld, prio=%d, hint=%d, yield?=%s\n", last->fence.context,
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 04/33] drm/i915/gt: Check for a completed last request once
Quoted 14 lines · Chris Wilson
Pull the repeated check for the last active request being completed to a single spot, when deciding whether or not execlist preemption is required.
Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/gt/intel_lrc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/gt/intel_lrc.c +0
-0
drivers/gpu/drm/i915/gt/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs *engine) · line 2141
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_lrc.c +2
-5@@ -2137,12 +2137,11 @@ static void execlists_dequeue(struct intel_engine_cs *engine)*/ if ((last = *active)) { -if (need_preempt (engine, last, rb)) { -if (i915_request_completed (last)) { -tasklet_hi_schedule (&execlists->tasklet); -return ; - } +if (i915_request_completed (last) && + !list_is_last (&last->sched.link, &engine->active.requests))
You return if it is not last? Also the hi schedule is gone. -Mika
Quoted 25 lines
drivers/gpu/drm/i915/gt/intel_lrc.c +2
-5+return ; +if (need_preempt (engine, last, rb)) { ENGINE_TRACE(engine, "preempting last=%llx:%lld, prio=%d, hint=%d\n", last->fence.context,@@ -2170,11 +2169,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine) last =NULL ; }else if (need_timeslice (engine, last, rb) &×lice_expired (execlists, last)) { -if (i915_request_completed (last)) { -tasklet_hi_schedule (&execlists->tasklet); -return ; - } - ENGINE_TRACE(engine, "expired last=%llx:%lld, prio=%d, hint=%d, yield?=%s\n", last->fence.context,Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 04/33] drm/i915/gt: Check for a completed last request once
Quoting Mika Kuoppala (2020-07-02 16:46:22)
Quoted 18 lines
Quoted 16 lines · Chris Wilson
Pull the repeated check for the last active request being completed to a single spot, when deciding whether or not execlist preemption is required.
Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/gt/intel_lrc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/gt/intel_lrc.c +0
-0@@ -2137,12 +2137,11 @@ static void execlists_dequeue(struct intel_engine_cs *engine)*/
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs *engine) · line 2141
Quoted 8 lines
drivers/gpu/drm/i915/gt/intel_lrc.c +2
-5if ((last = *active)) { -if (need_preempt (engine, last, rb)) { -if (i915_request_completed (last)) { -tasklet_hi_schedule (&execlists->tasklet); -return ; - } +if (i915_request_completed (last) && + !list_is_last (&last->sched.link, &engine->active.requests))You return if it is not last? Also the hi schedule is gone.
The kick was just causing us to busyspin ahead of the HW CS event. On tracing, it did not seem worth it.
If this is the last request, the GPU is now idling and we know that we will not try and lite restore into that request/context. So instead of waiting for the CS event, we go ahead and prepare the next pair of contexts.
If it was not the last request, we know there is a context the GPU will switch into, so the urgency is not an issue. However, we have to be careful that we don't issue an ELSP into that second context in case we catch it as it idles (thus hanging the HW).
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/33 drm/i915/gt: Replace direct submit with direct call to tasklet
In reply to Chris WilsonRather than having special case code for opportunistically calling process_csb() and performing a direct submit while holding the engine spinlock for submitting the request, simply call the tasklet directly. This allows us to retain the direct submission path, including the CS draining to allow fast/immediate submissions, without requiring any duplicated code paths.
The trickiest part here is to ensure that paired operations (such as schedule_in/schedule_out) remain under consistent locking domains, e.g. when pulled outside of the engine->active.lock
v2: Use bh kicking, see commit 3c53776e29f8 ("Mark HI and TASKLET softirq synchronous").
v3: Update engine-reset to be tasklet aware
--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 4 +- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 + drivers/gpu/drm/i915/gt/intel_engine_cs.c | 35 +++--- .../gpu/drm/i915/gt/intel_engine_heartbeat.c | 20 +-- drivers/gpu/drm/i915/gt/intel_lrc.c | 119 ++++++------------ drivers/gpu/drm/i915/gt/intel_reset.c | 60 +++++---- drivers/gpu/drm/i915/gt/intel_reset.h | 2 + drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 7 +- drivers/gpu/drm/i915/gt/selftest_lrc.c | 27 ++-- drivers/gpu/drm/i915/gt/selftest_reset.c | 8 +- drivers/gpu/drm/i915/i915_request.c | 2 + drivers/gpu/drm/i915/selftests/i915_request.c | 6 +- 12 files changed, 149 insertions(+), 143 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +3 -1
@@ -399,12 +399,14 @@ static bool __reset_engine(struct intel_engine_cs *engine)if (!intel_has_reset_engine (gt))return false; +local_bh_disable ();if (!test_and_set_bit (I915_RESET_ENGINE + engine->id, >->reset.flags)) { - success =intel_engine_reset (engine,NULL ) ==0 ; + success =__intel_engine_reset_bh (engine,NULL ) ==0 ;clear_and_wake_up_bit (I915_RESET_ENGINE + engine->id, >->reset.flags); } +local_bh_enable ();return success; }
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +2 -0
@@ -2355,7 +2355,9 @@ static void eb_request_add(struct i915_execbuffer *eb)__i915_request_skip (rq); } +local_bh_disable ();__i915_request_queue (rq, &attr); +local_bh_enable ();/* Try to clean up the client's timeline after submitting the request */ if (prev)
drivers/gpu/drm/i915/gt/intel_engine_cs.c +21 -14
@@ -903,32 +903,39 @@ static unsigned long stop_timeout(const struct intel_engine_cs *engine)return READ_ONCE (engine->props.stop_timeout_ms); } -int intel_engine_stop_cs (struct intel_engine_cs *engine) +static int __intel_engine_stop_cs (struct intel_engine_cs *engine, +int fast_timeout_us, +int slow_timeout_ms) {struct intel_uncore *uncore = engine->uncore; -const u32 base = engine->mmio_base; -const i915_reg_t mode =RING_MI_MODE (base); +const i915_reg_t mode =RING_MI_MODE (engine->mmio_base);int err; +intel_uncore_write_fw (uncore, mode,_MASKED_BIT_ENABLE (STOP_RING )); + err =__intel_wait_for_register_fw (engine->uncore, mode, +MODE_IDLE ,MODE_IDLE , + fast_timeout_us, + slow_timeout_ms, +NULL ); + +/* A final mmio read to let GPU writes be hopefully flushed to memory */ +intel_uncore_posting_read_fw (uncore, mode); +return err; +} + +int intel_engine_stop_cs (struct intel_engine_cs *engine) +{ +int err =0 ; +if (INTEL_GEN (engine->i915) <3 )return -ENODEV ;ENGINE_TRACE (engine,"\n" ); - -intel_uncore_write_fw (uncore, mode,_MASKED_BIT_ENABLE (STOP_RING )); - - err =0 ; -if (__intel_wait_for_register_fw (uncore, - mode,MODE_IDLE ,MODE_IDLE , -1000 ,stop_timeout (engine), -NULL )) { +if (__intel_engine_stop_cs (engine,1000 ,stop_timeout (engine))) {ENGINE_TRACE (engine,"timed out on STOP_RING -> IDLE\n" ); err = -ETIMEDOUT ; } -/* A final mmio read to let GPU writes be hopefully flushed to memory */ -intel_uncore_posting_read_fw (uncore, mode); -return err; }
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +13 -7
@@ -43,6 +43,17 @@ static void idle_pulse(struct intel_engine_cs *engine, struct i915_request *rq)i915_request_add_active_barriers (rq); } +static void heartbeat_commit (struct i915_request *rq, +const struct i915_sched_attr *attr) +{ +idle_pulse (rq->engine, rq); +__i915_request_commit (rq); + +local_bh_disable (); +__i915_request_queue (rq, attr); +local_bh_enable (); +} +static void show_heartbeat (const struct i915_request *rq,struct intel_engine_cs *engine) {
@@ -143,12 +154,10 @@ static void heartbeat(struct work_struct *wrk)if (IS_ERR (rq)) goto unlock; -idle_pulse (engine, rq);if (engine->i915->params.enable_hangcheck) engine->heartbeat.systole =i915_request_get (rq); -__i915_request_commit (rq); -__i915_request_queue (rq, &attr); +heartbeat_commit (rq, &attr); unlock:mutex_unlock (&ce->timeline->mutex);
@@ -229,10 +238,7 @@ int intel_engine_pulse(struct intel_engine_cs *engine) }__set_bit (I915_FENCE_FLAG_SENTINEL , &rq->fence.flags); -idle_pulse (engine, rq); - -__i915_request_commit (rq); -__i915_request_queue (rq, &attr); +heartbeat_commit (rq, &attr);GEM_BUG_ON (rq->sched.attr.priority <I915_PRIORITY_BARRIER ); err =0 ;
drivers/gpu/drm/i915/gt/intel_lrc.c +37 -82
277 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_reset.c +38 -22
126 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_reset.h +2 -0
@@ -34,6 +34,8 @@ void intel_gt_reset(struct intel_gt *gt, const char *reason);int intel_engine_reset (struct intel_engine_cs *engine,const char *reason); +int __intel_engine_reset_bh (struct intel_engine_cs *engine, +const char *reason);void __i915_request_reset (struct i915_request *rq,bool guilty);
drivers/gpu/drm/i915/gt/selftest_hangcheck.c +6 -1
@@ -1576,12 +1576,17 @@ static int __igt_atomic_reset_engine(struct intel_engine_cs *engine, engine->name, mode, p->name);tasklet_disable (t); +if (strcmp (p->name,"softirq" )) +local_bh_disable (); p->critical_section_begin (); - err =intel_engine_reset (engine,NULL ); + err =__intel_engine_reset_bh (engine,NULL ); p->critical_section_end (); +if (strcmp (p->name,"softirq" )) +local_bh_enable ();tasklet_enable (t); +tasklet_hi_schedule (t);if (err) pr_err("i915_reset_engine(%s:%s) failed under %s\n",
drivers/gpu/drm/i915/gt/selftest_lrc.c +17 -10
@@ -623,8 +623,10 @@ static int live_hold_reset(void *arg)/* We have our request executing, now remove it and reset */ +local_bh_disable ();if (test_and_set_bit (I915_RESET_ENGINE + id, >->reset.flags)) { +local_bh_enable ();intel_gt_set_wedged (gt); err = -EBUSY ; goto out;
@@ -638,12 +640,13 @@ static int live_hold_reset(void *arg)execlists_hold (engine, rq);GEM_BUG_ON (!i915_request_on_hold (rq)); -intel_engine_reset (engine,NULL ); +__intel_engine_reset_bh (engine,NULL );GEM_BUG_ON (rq->fence.error != -EIO );tasklet_enable (&engine->execlists.tasklet);clear_and_wake_up_bit (I915_RESET_ENGINE + id, >->reset.flags); +local_bh_enable ();/* Check that we do not resubmit the held request */ if (!i915_request_wait (rq,0 ,HZ /5 )) {
@@ -4572,8 +4575,10 @@ static int reset_virtual_engine(struct intel_gt *gt,GEM_BUG_ON (engine == ve->engine);/* Take ownership of the reset and tasklet */ +local_bh_disable ();if (test_and_set_bit (I915_RESET_ENGINE + engine->id, >->reset.flags)) { +local_bh_enable ();intel_gt_set_wedged (gt); err = -EBUSY ; goto out_heartbeat;
@@ -4593,12 +4598,13 @@ static int reset_virtual_engine(struct intel_gt *gt,execlists_hold (engine, rq);GEM_BUG_ON (!i915_request_on_hold (rq)); -intel_engine_reset (engine,NULL ); +__intel_engine_reset_bh (engine,NULL );GEM_BUG_ON (rq->fence.error != -EIO );/* Release our grasp on the engine, letting CS flow again */ tasklet_enable (&engine->execlists.tasklet);clear_and_wake_up_bit (I915_RESET_ENGINE + engine->id, >->reset.flags); +local_bh_enable ();/* Check that we do not resubmit the held request */ i915_request_get (rq);
@@ -6236,16 +6242,17 @@ static void garbage_reset(struct intel_engine_cs *engine,const unsigned int bit =I915_RESET_ENGINE + engine->id;unsigned long *lock = &engine->gt->reset.flags; -if (test_and_set_bit (bit, lock)) -return ; - -tasklet_disable (&engine->execlists.tasklet); +local_bh_disable (); +if (!test_and_set_bit (bit, lock)) { +tasklet_disable (&engine->execlists.tasklet); -if (!rq->fence.error) -intel_engine_reset (engine,NULL ); +if (!rq->fence.error) +__intel_engine_reset_bh (engine,NULL ); -tasklet_enable (&engine->execlists.tasklet); -clear_and_wake_up_bit (bit, lock); +tasklet_enable (&engine->execlists.tasklet); +clear_and_wake_up_bit (bit, lock); + } +local_bh_enable (); } static struct i915_request *garbage(struct intel_context *ce,
drivers/gpu/drm/i915/gt/selftest_reset.c +7 -1
@@ -132,11 +132,16 @@ static int igt_atomic_engine_reset(void *arg)for (p = igt_atomic_phases; p->name; p++) {GEM_TRACE ("intel_engine_reset(%s) under %s\n" , engine->name, p->name); +if (strcmp (p->name,"softirq" )) +local_bh_disable (); p->critical_section_begin (); - err =intel_engine_reset (engine,NULL ); + err =__intel_engine_reset_bh (engine,NULL ); p->critical_section_end (); +if (strcmp (p->name,"softirq" )) +local_bh_enable (); +if (err) {pr_err ("intel_engine_reset(%s) failed under %s\n" , engine->name, p->name);
@@ -146,6 +151,7 @@ static int igt_atomic_engine_reset(void *arg)intel_engine_pm_put (engine);tasklet_enable (&engine->execlists.tasklet); +tasklet_hi_schedule (&engine->execlists.tasklet);if (err)break ; }
drivers/gpu/drm/i915/i915_request.c +2 -0
@@ -1599,7 +1599,9 @@ void i915_request_add(struct i915_request *rq) attr = ctx->sched;rcu_read_unlock (); +local_bh_disable ();__i915_request_queue (rq, &attr); +local_bh_enable ();mutex_unlock (&tl->mutex); }
drivers/gpu/drm/i915/selftests/i915_request.c +1 -5
@@ -1926,9 +1926,7 @@ static int measure_inter_request(struct intel_context *ce)intel_ring_advance (rq, cs);i915_request_add (rq); } -local_bh_disable ();i915_sw_fence_commit (submit); -local_bh_enable ();intel_engine_flush_submission (ce->engine);heap_fence_put (submit);
@@ -2214,11 +2212,9 @@ static int measure_completion(struct intel_context *ce)intel_ring_advance (rq, cs);dma_fence_add_callback (&rq->fence, &cb.base, signal_cb); - -local_bh_disable ();i915_request_add (rq); -local_bh_enable (); +intel_engine_flush_submission (ce->engine);if (wait_for (READ_ONCE (sema[i]) ==-1 ,50 )) { err = -EIO ; goto err;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/33 drm/i915/gt: Use virtual_engine during execlists_dequeue
In reply to Chris WilsonRather than going back and forth between the rb_node entry and the virtual_engine type, store the ve local and reuse it. As the container_of conversion from rb_node to virtual_engine requires a variable offset, performing that conversion just once shaves off a bit of code.
v2: Keep a single virtual engine lookup, for typical use.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 209 ++++++++++++++-------------- 1 file changed, 101 insertions(+), 108 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +101 -108
@@ -454,7 +454,7 @@ static int queue_prio(const struct intel_engine_execlists *execlists)static inline bool need_preempt (const struct intel_engine_cs *engine,const struct i915_request *rq, -struct rb_node *rb) +const struct virtual_engine *ve) {int last_prio;
@@ -491,9 +491,7 @@ static inline bool need_preempt(const struct intel_engine_cs *engine, rq_prio(list_next_entry(rq, sched.link)) > last_prio)return true; -if (rb) { -struct virtual_engine *ve = -rb_entry (rb,typeof (*ve), nodes[engine->id].rb); +if (ve) {bool preempt = false;if (engine == ve->siblings[0 ]) {/* only preempt one sibling */
@@ -1819,6 +1817,35 @@ static bool virtual_matches(const struct virtual_engine *ve,return true; } +static struct virtual_engine * +first_virtual_engine (struct intel_engine_cs *engine) +{ +struct intel_engine_execlists *el = &engine->execlists; +struct rb_node *rb =rb_first_cached (&el->virtual); + +while (rb) { +struct virtual_engine *ve = +rb_entry (rb,typeof (*ve), nodes[engine->id].rb); +struct i915_request *rq =READ_ONCE (ve->request); + +if (!rq) {/* lazily cleanup after another engine handled rq */ +rb_erase_cached (rb, &el->virtual); +RB_CLEAR_NODE (rb); + rb =rb_first_cached (&el->virtual); +continue ; + } + +if (!virtual_matches (ve, rq, engine)) { + rb =rb_next (rb); +continue ; + } + +return ve; + } + +return NULL ; +} +static void virtual_xfer_breadcrumbs (struct virtual_engine *ve) {/*
@@ -1903,7 +1930,7 @@ static void defer_active(struct intel_engine_cs *engine)static bool need_timeslice (const struct intel_engine_cs *engine,const struct i915_request *rq, -const struct rb_node *rb) +const struct virtual_engine *ve) {int hint;
@@ -1912,9 +1939,7 @@ need_timeslice(const struct intel_engine_cs *engine, hint = engine->execlists.queue_priority_hint; -if (rb) { -const struct virtual_engine *ve = -rb_entry (rb,typeof (*ve), nodes[engine->id].rb); +if (ve) {const struct intel_engine_cs *inflight =intel_context_inflight (&ve->context);
@@ -2066,6 +2091,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)struct i915_request **port = execlists->pending;struct i915_request **const last_port = port + execlists->port_mask;struct i915_request *const *active = execlists->active; +struct virtual_engine *ve;struct i915_request *last;unsigned long flags;struct rb_node *rb;
@@ -2093,26 +2119,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)* and context switches) submission. */ spin_lock_irqsave (&engine->active.lock, flags); - -for (rb =rb_first_cached (&execlists->virtual); rb; ) { -struct virtual_engine *ve = -rb_entry (rb,typeof (*ve), nodes[engine->id].rb); -struct i915_request *rq =READ_ONCE (ve->request); - -if (!rq) {/* lazily cleanup after another engine handled rq */ -rb_erase_cached (rb, &execlists->virtual); -RB_CLEAR_NODE (rb); - rb =rb_first_cached (&execlists->virtual); -continue ; - } - -if (!virtual_matches (ve, rq, engine)) { - rb =rb_next (rb); -continue ; - } - -break ; - } + ve =first_virtual_engine (engine);/* * If the queue is higher priority than the last
@@ -2140,7 +2147,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)return ; } -if (need_preempt (engine, last, rb)) { +if (need_preempt (engine, last, ve)) { ENGINE_TRACE(engine, "preempting last=%llx:%lld, prio=%d, hint=%d\n", last->fence.context,
@@ -2166,7 +2173,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)__unwind_incomplete_requests (engine); last =NULL ; - }else if (need_timeslice (engine, last, rb) && + }else if (need_timeslice (engine, last, ve) &×lice_expired (execlists, last)) { ENGINE_TRACE(engine, "expired last=%llx:%lld, prio=%d, hint=%d, yield?=%s\n",
@@ -2216,111 +2223,97 @@ static void execlists_dequeue(struct intel_engine_cs *engine) } } -while (rb) {/* XXX virtual is always taking precedence */ -struct virtual_engine *ve = -rb_entry (rb,typeof (*ve), nodes[engine->id].rb); +while (ve) {/* XXX virtual is always taking precedence */ struct i915_request *rq;spin_lock (&ve->base.active.lock); rq = ve->request; -if (unlikely (!rq)) {/* lost the race to a sibling */ -spin_unlock (&ve->base.active.lock); -rb_erase_cached (rb, &execlists->virtual); -RB_CLEAR_NODE (rb); - rb =rb_first_cached (&execlists->virtual); -continue ; - } +if (unlikely (!rq))/* lost the race to a sibling */ + goto unlock;GEM_BUG_ON (rq != ve->request);GEM_BUG_ON (rq->engine != &ve->base);GEM_BUG_ON (rq->context != &ve->context); -if (rq_prio (rq) >=queue_prio (execlists)) { -if (!virtual_matches (ve, rq, engine)) { -spin_unlock (&ve->base.active.lock); - rb =rb_next (rb); -continue ; - } +if (unlikely (rq_prio (rq) <queue_prio (execlists))) { +spin_unlock (&ve->base.active.lock); +break ; + } -if (last && !can_merge_rq (last, rq)) { -spin_unlock (&ve->base.active.lock); -spin_unlock_irqrestore (&engine->active.lock, flags); -start_timeslice (engine,rq_prio (rq)); -return ;/* leave this for another sibling */ - } +GEM_BUG_ON (!virtual_matches (ve, rq, engine)); -ENGINE_TRACE (engine, -"virtual rq=%llx:%lld%s, new engine? %s\n" , - rq->fence.context, - rq->fence.seqno, -i915_request_completed (rq) ?"!" : -i915_request_started (rq) ?"*" : -"" , -yesno (engine != ve->siblings[0 ])); - -WRITE_ONCE (ve->request,NULL ); -WRITE_ONCE (ve->base.execlists.queue_priority_hint, -INT_MIN ); -rb_erase_cached (rb, &execlists->virtual); -RB_CLEAR_NODE (rb); +if (last && !can_merge_rq (last, rq)) { +spin_unlock (&ve->base.active.lock); +spin_unlock_irqrestore (&engine->active.lock, flags); +start_timeslice (engine,rq_prio (rq)); +return ;/* leave this for another sibling */ + } -GEM_BUG_ON (!(rq->execution_mask & engine->mask)); -WRITE_ONCE (rq->engine, engine); +ENGINE_TRACE (engine, +"virtual rq=%llx:%lld%s, new engine? %s\n" , + rq->fence.context, + rq->fence.seqno, +i915_request_completed (rq) ?"!" : +i915_request_started (rq) ?"*" : +"" , +yesno (engine != ve->siblings[0 ])); -if (engine != ve->siblings[0 ]) { -u32 *regs = ve->context.lrc_reg_state; -unsigned int n; +WRITE_ONCE (ve->request,NULL ); +WRITE_ONCE (ve->base.execlists.queue_priority_hint,INT_MIN ); -GEM_BUG_ON (READ_ONCE (ve->context.inflight)); + rb = &ve->nodes[engine->id].rb; +rb_erase_cached (rb, &execlists->virtual); +RB_CLEAR_NODE (rb); -if (!intel_engine_has_relative_mmio (engine)) -virtual_update_register_offsets (regs, - engine); +GEM_BUG_ON (!(rq->execution_mask & engine->mask)); +WRITE_ONCE (rq->engine, engine); -if (!list_empty (&ve->context.signals)) -virtual_xfer_breadcrumbs (ve); +if (engine != ve->siblings[0 ]) { +u32 *regs = ve->context.lrc_reg_state; +unsigned int n; -/* -* Move the bound engine to the top of the list -* for future execution. We then kick this -* tasklet first before checking others, so that -* we preferentially reuse this set of bound -* registers. -*/ -for (n =1 ; n < ve->num_siblings; n++) { -if (ve->siblings[n] == engine) { -swap (ve->siblings[n], - ve->siblings[0 ]); -break ; - } - } +GEM_BUG_ON (READ_ONCE (ve->context.inflight)); -GEM_BUG_ON (ve->siblings[0 ] != engine); - } +if (!intel_engine_has_relative_mmio (engine)) +virtual_update_register_offsets (regs, engine); -if (__i915_request_submit (rq)) { - submit = true; - last = rq; - } -i915_request_put (rq); +if (!list_empty (&ve->context.signals)) +virtual_xfer_breadcrumbs (ve);/* -* Hmm, we have a bunch of virtual engine requests, -* but the first one was already completed (thanks -* preempt-to-busy!). Keep looking at the veng queue -* until we have no more relevant requests (i.e. -* the normal submit queue has higher priority). +* Move the bound engine to the top of the list for +* future execution. We then kick this tasklet first +* before checking others, so that we preferentially +* reuse this set of bound registers. */ -if (!submit) { -spin_unlock (&ve->base.active.lock); - rb =rb_first_cached (&execlists->virtual); -continue ; +for (n =1 ; n < ve->num_siblings; n++) { +if (ve->siblings[n] == engine) { +swap (ve->siblings[n], ve->siblings[0 ]); +break ; + } } + +GEM_BUG_ON (ve->siblings[0 ] != engine); } +if (__i915_request_submit (rq)) { + submit = true; + last = rq; + } + +i915_request_put (rq); +unlock:spin_unlock (&ve->base.active.lock); -break ; + +/* +* Hmm, we have a bunch of virtual engine requests, +* but the first one was already completed (thanks +* preempt-to-busy!). Keep looking at the veng queue +* until we have no more relevant requests (i.e. +* the normal submit queue has higher priority). +*/ + ve = submit ?NULL :first_virtual_engine (engine); }while ((rb =rb_first_cached (&execlists->queue))) {
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/33 drm/i915/gt: Decouple inflight virtual engines
In reply to Chris WilsonOnce a virtual engine has been bound to a sibling, it will remain bound until we finally schedule out the last active request. We can not rebind the context to a new sibling while it is inflight as the context save will conflict, hence we wait. As we cannot then use any other sibliing while the context is inflight, only kick the bound sibling while it inflight and upon scheduling out the kick the rest (so that we can swap engines on timeslicing if the previously bound engine becomes oversubscribed).
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 30 +++++++++++++---------------- 1 file changed, 13 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +13 -17
@@ -1410,9 +1410,8 @@ static inline void execlists_schedule_in(struct i915_request *rq, int idx)static void kick_siblings (struct i915_request *rq,struct intel_context *ce) {struct virtual_engine *ve =container_of (ce,typeof (*ve), context); -struct i915_request *next =READ_ONCE (ve->request); -if (next == rq || (next && next->execution_mask & ~rq->execution_mask)) +if (READ_ONCE (ve->request))tasklet_hi_schedule (&ve->base.execlists.tasklet); }
@@ -1828,18 +1827,14 @@ first_virtual_engine(struct intel_engine_cs *engine)rb_entry (rb,typeof (*ve), nodes[engine->id].rb);struct i915_request *rq =READ_ONCE (ve->request); -if (!rq) {/* lazily cleanup after another engine handled rq */ +/* lazily cleanup after another engine handled rq */ +if (!rq || !virtual_matches (ve, rq, engine)) {rb_erase_cached (rb, &el->virtual);RB_CLEAR_NODE (rb); rb =rb_first_cached (&el->virtual);continue ; } -if (!virtual_matches (ve, rq, engine)) { - rb =rb_next (rb); -continue ; - } -return ve; }
@@ -5448,7 +5443,6 @@ static void virtual_submission_tasklet(unsigned long data)if (unlikely (!mask))return ; -local_irq_disable ();for (n =0 ; n < ve->num_siblings; n++) {struct intel_engine_cs *sibling =READ_ONCE (ve->siblings[n]);struct ve_node *const node = &ve->nodes[sibling->id];
@@ -5458,20 +5452,19 @@ static void virtual_submission_tasklet(unsigned long data)if (!READ_ONCE (ve->request))break ;/* already handled by a sibling's tasklet */ +spin_lock_irq (&sibling->active.lock); +if (unlikely (!(mask & sibling->mask))) {if (!RB_EMPTY_NODE (&node->rb)) { -spin_lock (&sibling->active.lock);rb_erase_cached (&node->rb, &sibling->execlists.virtual);RB_CLEAR_NODE (&node->rb); -spin_unlock (&sibling->active.lock); } -continue ; - } -spin_lock (&sibling->active.lock); + goto unlock_engine; + } -if (!RB_EMPTY_NODE (&node->rb)) { +if (unlikely (!RB_EMPTY_NODE (&node->rb))) {/* * Cheat and avoid rebalancing the tree if we can * reuse this node in situ.
@@ -5511,9 +5504,12 @@ static void virtual_submission_tasklet(unsigned long data)if (first && prio > sibling->execlists.queue_priority_hint)tasklet_hi_schedule (&sibling->execlists.tasklet); -spin_unlock (&sibling->active.lock); +unlock_engine: +spin_unlock_irq (&sibling->active.lock); + +if (intel_context_inflight (&ve->context)) +break ; } -local_irq_enable (); }static void virtual_submit_request (struct i915_request *rq)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/33 drm/i915/gt: Defer schedule_out until after the next dequeue
In reply to Chris WilsonInside schedule_out, we do extra work upon idling the context, such as updating the runtime, kicking off retires, kicking virtual engines. However, if we are in a series of processing single requests per contexts, we may find ourselves scheduling out the context, only to immediately schedule it back in during dequeue. This is just extra work that we can avoid if we keep the context marked as inflight across the dequeue. This becomes more significant later on for minimising virtual engine misses.
--- drivers/gpu/drm/i915/gt/intel_context_types.h | 4 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 111 ++++++++++++------ 2 files changed, 78 insertions(+), 37 deletions(-)
drivers/gpu/drm/i915/gt/intel_context_types.h +2 -2
@@ -45,8 +45,8 @@ struct intel_context {struct intel_engine_cs *engine;struct intel_engine_cs *inflight; -#define intel_context_inflight (ce) ptr_mask_bits(READ_ONCE((ce)->inflight), 2) -#define intel_context_inflight_count (ce) ptr_unmask_bits(READ_ONCE((ce)->inflight), 2) +#define intel_context_inflight (ce) ptr_mask_bits(READ_ONCE((ce)->inflight), 3) +#define intel_context_inflight_count (ce) ptr_unmask_bits(READ_ONCE((ce)->inflight), 3)struct i915_address_space *vm;struct i915_gem_context __rcu *gem_context;
drivers/gpu/drm/i915/gt/intel_lrc.c +76 -35
262 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/33 drm/i915/gt: Resubmit the virtual engine on schedule-out
In reply to Chris WilsonHaving recognised that we do not change the sibling until we schedule out, we can then defer the decision to resubmit the virtual engine from the unwind of the active queue to scheduling out of the virtual context.
By keeping the unwind order intact on the local engine, we can preserve data dependency ordering while doing a preempt-to-busy pass until we have determined the new ELSP. This means that if we try to timeslice between a virtual engine and a data-dependent ordinary request, the pair will maintain their relative ordering and we will avoid the resubmission, cancelling the timeslicing until further change.
The dilemma though is that we then may end up in a situation where the 'demotion' of the virtual request to an ordinary request in the engine queue results in filling the ELSP[] with virtual requests instead of spreading the load across the engines. To compensate for this, we mark each virtual request and refuse to resubmit a virtual request in the secondary ELSP slots, thus forcing subsequent virtual requests to be scheduled out after timeslicing. By delaying the decision until we schedule out, we will avoid unnecessary resubmission.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 118 ++++++++++++++++--------- drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +- 2 files changed, 75 insertions(+), 45 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +74 -44
@@ -1119,53 +1119,23 @@ __unwind_incomplete_requests(struct intel_engine_cs *engine)__i915_request_unsubmit (rq); -/* -* Push the request back into the queue for later resubmission. -* If this request is not native to this physical engine (i.e. -* it came from a virtual source), push it back onto the virtual -* engine so that it can be moved across onto another physical -* engine as load dictates. -*/ -if (likely (rq->execution_mask == engine->mask)) { -GEM_BUG_ON (rq_prio (rq) ==I915_PRIORITY_INVALID ); -if (rq_prio (rq) != prio) { - prio =rq_prio (rq); - pl =i915_sched_lookup_priolist (engine, prio); - } -GEM_BUG_ON (RB_EMPTY_ROOT (&engine->execlists.queue.rb_root)); - -list_move (&rq->sched.link, pl); -set_bit (I915_FENCE_FLAG_PQUEUE , &rq->fence.flags); +GEM_BUG_ON (rq_prio (rq) ==I915_PRIORITY_INVALID ); +if (rq_prio (rq) != prio) { + prio =rq_prio (rq); + pl =i915_sched_lookup_priolist (engine, prio); + } +GEM_BUG_ON (RB_EMPTY_ROOT (&engine->execlists.queue.rb_root)); -/* Check in case we rollback so far we wrap [size/2] */ -if (intel_ring_direction (rq->ring, -intel_ring_wrap (rq->ring, - rq->tail), - rq->ring->tail) >0 ) - rq->context->lrc.desc |=CTX_DESC_FORCE_RESTORE ; +list_move (&rq->sched.link, pl); +set_bit (I915_FENCE_FLAG_PQUEUE , &rq->fence.flags); - active = rq; - }else { -struct intel_engine_cs *owner = rq->context->engine; +/* Check in case we rollback so far we wrap [size/2] */ +if (intel_ring_direction (rq->ring, +intel_ring_wrap (rq->ring, rq->tail), + rq->ring->tail) >0 ) + rq->context->lrc.desc |=CTX_DESC_FORCE_RESTORE ; -/* -* Decouple the virtual breadcrumb before moving it -* back to the virtual engine -- we don't want the -* request to complete in the background and try -* and cancel the breadcrumb on the virtual engine -* (instead of the old engine where it is linked)! -*/ -if (test_bit (DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT , - &rq->fence.flags)) { -spin_lock_nested (&rq->lock, -SINGLE_DEPTH_NESTING ); -i915_request_cancel_breadcrumb (rq); -spin_unlock (&rq->lock); - } -WRITE_ONCE (rq->engine, owner); - owner->submit_request (rq); - active =NULL ; - } + active = rq; }return active;
@@ -1409,12 +1379,49 @@ static inline void execlists_schedule_in(struct i915_request *rq, int idx)GEM_BUG_ON (intel_context_inflight (ce) != rq->engine); } +static void +resubmit_virtual_request (struct i915_request *rq,struct virtual_engine *ve) +{ +struct intel_engine_cs *engine = rq->engine; +unsigned long flags; + +spin_lock_irqsave (&engine->active.lock, flags); + +/* +* Decouple the virtual breadcrumb before moving it back to the virtual +* engine -- we don't want the request to complete in the background +* and then try and cancel the breadcrumb on the virtual engine +* (instead of the old engine where it is linked)! +*/ +if (test_bit (DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT , &rq->fence.flags)) { +spin_lock_nested (&rq->lock,SINGLE_DEPTH_NESTING ); +i915_request_cancel_breadcrumb (rq); +spin_unlock (&rq->lock); + } + +clear_bit (I915_FENCE_FLAG_PQUEUE , &rq->fence.flags); +WRITE_ONCE (rq->engine, &ve->base); + ve->base.submit_request (rq); + +spin_unlock_irqrestore (&engine->active.lock, flags); +} +static void kick_siblings (struct i915_request *rq,struct intel_context *ce) {struct virtual_engine *ve =container_of (ce,typeof (*ve), context);if (READ_ONCE (ve->request))tasklet_hi_schedule (&ve->base.execlists.tasklet); + +/* +* This engine is now too busy to run this virtual request, so +* see if we can find an alternative engine for it to execute on. +* Once a request has become bonded to this engine, we treat it the +* same as other native request. +*/ +if (i915_request_in_priority_queue (rq) && + rq->execution_mask != rq->engine->mask) +resubmit_virtual_request (rq, ve); } static inline void
@@ -1657,6 +1664,20 @@ assert_pending_valid(const struct intel_engine_execlists *execlists, } sentinel =i915_request_has_sentinel (rq); +/* +* We want virtual requests to only be in the first slot so +* that they are never stuck behind a hog and can be immediately +* transferred onto the next idle engine. +*/ +if (rq->execution_mask != engine->mask && + port != execlists->pending) { +GEM_TRACE_ERR ("%s: virtual engine:%llx not in prime position[%zd]\n" , + engine->name, + ce->timeline->fence_context, + port - execlists->pending); +return false; + } +/* Hold tightly onto the lock to prevent concurrent retires! */ if (!spin_trylock_irqsave (&rq->lock, flags))continue ;
@@ -2349,6 +2370,15 @@ static void execlists_dequeue(struct intel_engine_cs *engine)if (i915_request_has_sentinel (last)) goto done; +/* +* We avoid submitting virtual requests into +* the secondary ports so that we can migrate +* the request immediately to another engine +* rather than wait for the primary request. +*/ +if (rq->execution_mask != engine->mask) + goto done; +/* * If GVT overrides us we only ever submit * port[0], leaving port[1] empty. Note that we
drivers/gpu/drm/i915/gt/selftest_lrc.c +1 -1
@@ -4592,7 +4592,7 @@ static int reset_virtual_engine(struct intel_gt *gt,spin_lock_irq (&engine->active.lock);__unwind_incomplete_requests (engine);spin_unlock_irq (&engine->active.lock); -GEM_BUG_ON (rq->engine != ve->engine); +GEM_BUG_ON (rq->engine != engine);/* Reset the engine while keeping our active request on hold */ execlists_hold (engine, rq);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/33 drm/i915/gt: Simplify virtual engine handling for execlists_hold()
In reply to Chris WilsonNow that the tasklet completely controls scheduling of the requests, and we postpone scheduling out the old requests, we can keep a hanging virtual request bound to the engine on which it hung, and remove it from te queue. On release, it will be returned to the same engine and remain in its queue until it is scheduled; after which point it will become eligible for transfer to a sibling. Instead, we could opt to resubmit the request along the virtual engine on unhold, making it eligible for load balancing immediately -- but that seems like a pointless optimisation for a hanging context.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 29 ----------------------------- 1 file changed, 29 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +0 -29
@@ -2785,35 +2785,6 @@ static bool execlists_hold(struct intel_engine_cs *engine, goto unlock; } -if (rq->engine != engine) {/* preempted virtual engine */ -struct virtual_engine *ve =to_virtual_engine (rq->engine); - -/* -* intel_context_inflight() is only protected by virtue -* of process_csb() being called only by the tasklet (or -* directly from inside reset while the tasklet is suspended). -* Assert that neither of those are allowed to run while we -* poke at the request queues. -*/ -GEM_BUG_ON (!reset_in_progress (&engine->execlists)); - -/* -* An unsubmitted request along a virtual engine will -* remain on the active (this) engine until we are able -* to process the context switch away (and so mark the -* context as no longer in flight). That cannot have happened -* yet, otherwise we would not be hanging! -*/ -spin_lock (&ve->base.active.lock); -GEM_BUG_ON (intel_context_inflight (rq->context) != engine); -GEM_BUG_ON (ve->request != rq); - ve->request =NULL ; -spin_unlock (&ve->base.active.lock); -i915_request_put (rq); - - rq->engine = engine; - } -/* * Transfer this request onto the hold queue to prevent it * being resumbitted to HW (and potentially completed) before we have
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/33 drm/i915/gt: ce->inflight updates are now serialised
In reply to Chris WilsonSince schedule-in and schedule-out are now both always under the tasklet bitlock, we can reduce the individual atomic operations to simple instructions and worry less.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 44 +++++++++++++---------------- 1 file changed, 19 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +19 -25
@@ -1341,7 +1341,7 @@ __execlists_schedule_in(struct i915_request *rq)unsigned int tag =ffs (READ_ONCE (engine->context_tag));GEM_BUG_ON (tag ==0 || tag >=BITS_PER_LONG ); -clear_bit (tag -1 , &engine->context_tag); +__clear_bit (tag -1 , &engine->context_tag); ce->lrc.ccid = tag << (GEN11_SW_CTX_ID_SHIFT -32 );BUILD_BUG_ON (BITS_PER_LONG >GEN12_MAX_CONTEXT_HW_ID );
@@ -1368,13 +1368,10 @@ static inline void execlists_schedule_in(struct i915_request *rq, int idx)GEM_BUG_ON (!intel_engine_pm_is_awake (rq->engine));trace_i915_request_in (rq, idx); - old =READ_ONCE (ce->inflight); -do { -if (!old) { -WRITE_ONCE (ce->inflight,__execlists_schedule_in (rq)); -break ; - } - }while (!try_cmpxchg (&ce->inflight, &old,ptr_inc (old))); + old = ce->inflight; +if (!old) + old =__execlists_schedule_in (rq); +WRITE_ONCE (ce->inflight,ptr_inc (old));GEM_BUG_ON (intel_context_inflight (ce) != rq->engine); }
@@ -1424,12 +1421,11 @@ static void kick_siblings(struct i915_request *rq, struct intel_context *ce)resubmit_virtual_request (rq, ve); } -static inline void -__execlists_schedule_out (struct i915_request *rq, -struct intel_engine_cs *const engine, -unsigned int ccid) +static inline void __execlists_schedule_out (struct i915_request *rq) {struct intel_context *const ce = rq->context; +struct intel_engine_cs *const engine = rq->engine; +unsigned int ccid;/* * NB process_csb() is not under the engine->active.lock and hence
@@ -1437,7 +1433,7 @@ __execlists_schedule_out(struct i915_request *rq,* refrain from doing non-trivial work here. */ -CE_TRACE (ce,"schedule-out, ccid:%x\n" , ccid); +CE_TRACE (ce,"schedule-out, ccid:%x\n" , ce->lrc.ccid);/* * If we have just completed this context, the engine may now be
@@ -1447,12 +1443,13 @@ __execlists_schedule_out(struct i915_request *rq, i915_request_completed(rq))intel_engine_add_retire (engine, ce->timeline); + ccid = ce->lrc.ccid; ccid >>=GEN11_SW_CTX_ID_SHIFT -32 ; ccid &=GEN12_MAX_CONTEXT_HW_ID ;if (ccid <BITS_PER_LONG ) {GEM_BUG_ON (ccid ==0 );GEM_BUG_ON (test_bit (ccid -1 , &engine->context_tag)); -set_bit (ccid -1 , &engine->context_tag); +__set_bit (ccid -1 , &engine->context_tag); }intel_context_update_runtime (ce);
@@ -1473,26 +1470,23 @@ __execlists_schedule_out(struct i915_request *rq,*/ if (ce->engine != engine)kick_siblings (rq, ce); - -intel_context_put (ce); }static inline void execlists_schedule_out (struct i915_request *rq) {struct intel_context *const ce = rq->context; -struct intel_engine_cs *cur, *old; -u32 ccid;trace_i915_request_out (rq); - ccid = rq->context->lrc.ccid; - old =READ_ONCE (ce->inflight); -do - cur =ptr_unmask_bits (old,2 ) ?ptr_dec (old) :NULL ; -while (!try_cmpxchg (&ce->inflight, &old, cur)); -if (!cur) -__execlists_schedule_out (rq, old, ccid); +GEM_BUG_ON (!ce->inflight); + ce->inflight =ptr_dec (ce->inflight); +if (!intel_context_inflight_count (ce)) { +GEM_BUG_ON (ce->inflight != rq->engine); +__execlists_schedule_out (rq); +WRITE_ONCE (ce->inflight,NULL ); +intel_context_put (ce); + }i915_request_put (rq); }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 12/33 drm/i915/gt: Drop atomic for engine->fw_active tracking
In reply to Chris WilsonSince schedule-in/out is now entirely serialised by the tasklet bitlock, we do not need to worry about concurrent in/out operations and so reduce the atomic operations to plain instructions.
--- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +- drivers/gpu/drm/i915/gt/intel_engine_types.h | 2 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_cs.c +1 -1
@@ -1540,7 +1540,7 @@ void intel_engine_dump(struct intel_engine_cs *engine,ktime_to_ms (intel_engine_get_busy_time (engine, &dummy)));drm_printf (m,"\tForcewake: %x domains, %d active\n" , - engine->fw_domain,atomic_read (&engine->fw_active)); + engine->fw_domain,READ_ONCE (engine->fw_active));rcu_read_lock (); rq =READ_ONCE (engine->heartbeat.systole);
drivers/gpu/drm/i915/gt/intel_engine_types.h +1 -1
@@ -322,7 +322,7 @@ struct intel_engine_cs {* as possible. */ enum forcewake_domains fw_domain; -atomic_t fw_active; +unsigned int fw_active;unsigned long context_tag;
drivers/gpu/drm/i915/gt/intel_lrc.c +2 -2
@@ -1350,7 +1350,7 @@ __execlists_schedule_in(struct i915_request *rq) ce->lrc.ccid |= engine->execlists.ccid;__intel_gt_pm_get (engine->gt); -if (engine->fw_domain && !atomic_fetch_inc (&engine->fw_active)) +if (engine->fw_domain && !engine->fw_active++)intel_uncore_forcewake_get (engine->uncore, engine->fw_domain);execlists_context_status_change (rq,INTEL_CONTEXT_SCHEDULE_IN );intel_engine_context_in (engine);
@@ -1455,7 +1455,7 @@ static inline void __execlists_schedule_out(struct i915_request *rq)intel_context_update_runtime (ce);intel_engine_context_out (engine);execlists_context_status_change (rq,INTEL_CONTEXT_SCHEDULE_OUT ); -if (engine->fw_domain && !atomic_dec_return (&engine->fw_active)) +if (engine->fw_domain && !--engine->fw_active)intel_uncore_forcewake_put (engine->uncore, engine->fw_domain);intel_gt_pm_put_async (engine->gt);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 13/33 drm/i915/gt: Extract busy-stats for ring-scheduler
In reply to Chris WilsonLift the busy-stats context-in/out implementation out of intel_lrc, so that we can reuse it for other scheduler implementations.
--- drivers/gpu/drm/i915/gt/intel_engine_stats.h | 49 ++++++++++++++++++++ drivers/gpu/drm/i915/gt/intel_lrc.c | 34 +------------- 2 files changed, 50 insertions(+), 33 deletions(-) create mode 100644 drivers/gpu/drm/i915/gt/intel_engine_stats.h
drivers/gpu/drm/i915/gt/intel_engine_stats.h new file +49 -0
@@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2020 Intel Corporation +*/ + +#ifndef __INTEL_ENGINE_STATS_H__ +#define __INTEL_ENGINE_STATS_H__ + +#include <linux/atomic.h> +#include <linux/ktime.h> +#include <linux/seqlock.h> + +#include "i915_gem.h" /* GEM_BUG_ON */ +#include "intel_engine.h" + +static inline void intel_engine_context_in (struct intel_engine_cs *engine) +{ +unsigned long flags; + +if (atomic_add_unless (&engine->stats.active,1 ,0 )) +return ; + +write_seqlock_irqsave (&engine->stats.lock, flags); +if (!atomic_add_unless (&engine->stats.active,1 ,0 )) { + engine->stats.start =ktime_get (); +atomic_inc (&engine->stats.active); + } +write_sequnlock_irqrestore (&engine->stats.lock, flags); +} + +static inline void intel_engine_context_out (struct intel_engine_cs *engine) +{ +unsigned long flags; + +GEM_BUG_ON (!atomic_read (&engine->stats.active)); + +if (atomic_add_unless (&engine->stats.active,-1 ,1 )) +return ; + +write_seqlock_irqsave (&engine->stats.lock, flags); +if (atomic_dec_and_test (&engine->stats.active)) { + engine->stats.total = +ktime_add (engine->stats.total, +ktime_sub (ktime_get (), engine->stats.start)); + } +write_sequnlock_irqrestore (&engine->stats.lock, flags); +} + +#endif /* __INTEL_ENGINE_STATS_H__ */
drivers/gpu/drm/i915/gt/intel_lrc.c +1 -33
@@ -139,6 +139,7 @@#include "i915_vgpu.h" #include "intel_context.h" #include "intel_engine_pm.h" +#include "intel_engine_stats.h" #include "intel_gt.h" #include "intel_gt_pm.h" #include "intel_gt_requests.h"
@@ -1164,39 +1165,6 @@ execlists_context_status_change(struct i915_request *rq, unsigned long status) status, rq); } -static void intel_engine_context_in (struct intel_engine_cs *engine) -{ -unsigned long flags; - -if (atomic_add_unless (&engine->stats.active,1 ,0 )) -return ; - -write_seqlock_irqsave (&engine->stats.lock, flags); -if (!atomic_add_unless (&engine->stats.active,1 ,0 )) { - engine->stats.start =ktime_get (); -atomic_inc (&engine->stats.active); - } -write_sequnlock_irqrestore (&engine->stats.lock, flags); -} - -static void intel_engine_context_out (struct intel_engine_cs *engine) -{ -unsigned long flags; - -GEM_BUG_ON (!atomic_read (&engine->stats.active)); - -if (atomic_add_unless (&engine->stats.active,-1 ,1 )) -return ; - -write_seqlock_irqsave (&engine->stats.lock, flags); -if (atomic_dec_and_test (&engine->stats.active)) { - engine->stats.total = -ktime_add (engine->stats.total, -ktime_sub (ktime_get (), engine->stats.start)); - } -write_sequnlock_irqrestore (&engine->stats.lock, flags); -} -static void execlists_check_context (const struct intel_context *ce,const struct intel_engine_cs *engine)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 14/33 drm/i915/gt: Convert stats.active to plain unsigned int
In reply to Chris WilsonAs context-in/out is now always serialised, we do not have to worry about concurrent enabling/disable of the busy-stats and can reduce the atomic_t active to a plain unsigned int, and the seqlock to a seqcount.
--- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 8 ++-- drivers/gpu/drm/i915/gt/intel_engine_stats.h | 45 ++++++++++++-------- drivers/gpu/drm/i915/gt/intel_engine_types.h | 4 +- 3 files changed, 34 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_cs.c +4 -4
@@ -338,7 +338,7 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id) engine->schedule =NULL ;ewma__engine_latency_init (&engine->latency); -seqlock_init (&engine->stats.lock); +seqcount_init (&engine->stats.lock);ATOMIC_INIT_NOTIFIER_HEAD (&engine->context_status_notifier);
@@ -1617,7 +1617,7 @@ static ktime_t __intel_engine_get_busy_time(struct intel_engine_cs *engine,* add it to the total. */ *now =ktime_get (); -if (atomic_read (&engine->stats.active)) +if (READ_ONCE (engine->stats.active)) total =ktime_add (total,ktime_sub (*now, engine->stats.start));return total;
@@ -1636,9 +1636,9 @@ ktime_t intel_engine_get_busy_time(struct intel_engine_cs *engine, ktime_t *now)ktime_t total;do { - seq =read_seqbegin (&engine->stats.lock); + seq =read_seqcount_begin (&engine->stats.lock); total =__intel_engine_get_busy_time (engine, now); - }while (read_seqretry (&engine->stats.lock, seq)); + }while (read_seqcount_retry (&engine->stats.lock, seq));return total; }
drivers/gpu/drm/i915/gt/intel_engine_stats.h +28 -17
61 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_engine_types.h +2 -2
@@ -545,12 +545,12 @@ struct intel_engine_cs {/** * @active: Number of contexts currently scheduled in. */ -atomic_t active; +unsigned int active;/** * @lock: Lock protecting the below fields. */ -seqlock_t lock; +seqcount_t lock;/** * @total: Total time this engine was busy.
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 15/33 drm/i915: Lift waiter/signaler iterators
In reply to Chris WilsonLift the list iteration defines for traversing the signaler/waiter lists into i915_scheduler.h for reuse.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 10 ---------- drivers/gpu/drm/i915/i915_scheduler_types.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +0 -10
@@ -1840,16 +1840,6 @@ static void virtual_xfer_breadcrumbs(struct virtual_engine *ve)intel_engine_transfer_stale_breadcrumbs (ve->siblings[0 ], &ve->context); } -#define for_each_waiter (p__, rq__) \ - list_for_each_entry_lockless(p__, \ - &(rq__)->sched.waiters_list, \ - wait_link) - -#define for_each_signaler (p__, rq__) \ - list_for_each_entry_rcu(p__, \ - &(rq__)->sched.signalers_list, \ - signal_link) -static void defer_request (struct i915_request *rq,struct list_head *const pl) {LIST_HEAD (list);
drivers/gpu/drm/i915/i915_scheduler_types.h +10 -0
@@ -81,4 +81,14 @@ struct i915_dependency {#define I915_DEPENDENCY_WEAK BIT(2) }; +#define for_each_waiter (p__, rq__) \ + list_for_each_entry_lockless(p__, \ + &(rq__)->sched.waiters_list, \ + wait_link) + +#define for_each_signaler (p__, rq__) \ + list_for_each_entry_rcu(p__, \ + &(rq__)->sched.signalers_list, \ + signal_link) +#endif /* _I915_SCHEDULER_TYPES_H_ */
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 16/33 drm/i915: Strip out internal priorities
In reply to Chris WilsonSince we are not using any internal priority levels, and in the next few patches will introduce a new index for which the optimisation is not so lear cut, discard the small table within the priolist.
--- .../gpu/drm/i915/gt/intel_engine_heartbeat.c | 2 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 22 ++------ drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 - .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 6 +-- drivers/gpu/drm/i915/i915_priolist_types.h | 8 +-- drivers/gpu/drm/i915/i915_scheduler.c | 51 +++---------------- drivers/gpu/drm/i915/i915_scheduler.h | 18 ++----- 7 files changed, 21 insertions(+), 88 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +1 -1
@@ -113,7 +113,7 @@ static void heartbeat(struct work_struct *wrk)* low latency and no jitter] the chance to naturally * complete before being preempted. */ - attr.priority =I915_PRIORITY_MASK ; + attr.priority =0 ;if (rq->sched.attr.priority >= attr.priority) attr.priority |=I915_USER_PRIORITY (I915_PRIORITY_HEARTBEAT );if (rq->sched.attr.priority >= attr.priority)
drivers/gpu/drm/i915/gt/intel_lrc.c +5 -17
@@ -435,22 +435,13 @@ static int effective_prio(const struct i915_request *rq)static int queue_prio (const struct intel_engine_execlists *execlists) { -struct i915_priolist *p;struct rb_node *rb; rb =rb_first_cached (&execlists->queue);if (!rb)return INT_MIN ; -/* -* As the priolist[] are inverted, with the highest priority in [0], -* we have to flip the index value to become priority. -*/ - p =to_priolist (rb); -if (!I915_USER_PRIORITY_SHIFT ) -return p->priority; - -return ((p->priority +1 ) <<I915_USER_PRIORITY_SHIFT ) -ffs (p->used); +return to_priolist (rb)->priority; } static inline bool need_preempt(const struct intel_engine_cs *engine,
@@ -2286,9 +2277,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine)while ((rb =rb_first_cached (&execlists->queue))) {struct i915_priolist *p =to_priolist (rb);struct i915_request *rq, *rn; -int i; -priolist_for_each_request_consume (rq, rn, p, i) { +priolist_for_each_request_consume (rq, rn, p) {bool merge = true;/*
@@ -4251,9 +4241,8 @@ static void execlists_reset_cancel(struct intel_engine_cs *engine)/* Flush the queued requests to the timeline list (for retiring). */ while ((rb =rb_first_cached (&execlists->queue))) {struct i915_priolist *p =to_priolist (rb); -int i; -priolist_for_each_request_consume (rq, rn, p, i) { +priolist_for_each_request_consume (rq, rn, p) {mark_eio (rq);__i915_request_submit (rq); }
@@ -5277,7 +5266,7 @@ static int __execlists_context_alloc(struct intel_context *ce,static struct list_head *virtual_queue (struct virtual_engine *ve) { -return &ve->base.execlists.default_priolist.requests[0 ]; +return &ve->base.execlists.default_priolist.requests; }static void virtual_context_destroy (struct kref *kref)
@@ -5836,9 +5825,8 @@ void intel_execlists_show_requests(struct intel_engine_cs *engine, count =0 ;for (rb =rb_first_cached (&execlists->queue); rb; rb =rb_next (rb)) {struct i915_priolist *p =rb_entry (rb,typeof (*p), node); -int i; -priolist_for_each_request (rq, p, i) { +priolist_for_each_request (rq, p) {if (count++ < max -1 )show_request (m, rq,"\t\tQ " );else
drivers/gpu/drm/i915/gt/selftest_lrc.c +0 -2
@@ -1102,7 +1102,6 @@ create_rewinder(struct intel_context *ce,intel_ring_advance (rq, cs); - rq->sched.attr.priority =I915_PRIORITY_MASK ; err =0 ; err:i915_request_get (rq);
@@ -5365,7 +5364,6 @@ create_timestamp(struct intel_context *ce, void *slot, int idx)intel_ring_advance (rq, cs); - rq->sched.attr.priority =I915_PRIORITY_MASK ; err =0 ; err:i915_request_get (rq);
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +2 -4
@@ -312,9 +312,8 @@ static void __guc_dequeue(struct intel_engine_cs *engine)while ((rb =rb_first_cached (&execlists->queue))) {struct i915_priolist *p =to_priolist (rb);struct i915_request *rq, *rn; -int i; -priolist_for_each_request_consume (rq, rn, p, i) { +priolist_for_each_request_consume (rq, rn, p) {if (last && rq->context != last->context) {if (port == last_port) goto done;
@@ -463,9 +462,8 @@ static void guc_reset_cancel(struct intel_engine_cs *engine)/* Flush the queued requests to the timeline list (for retiring). */ while ((rb =rb_first_cached (&execlists->queue))) {struct i915_priolist *p =to_priolist (rb); -int i; -priolist_for_each_request_consume (rq, rn, p, i) { +priolist_for_each_request_consume (rq, rn, p) {list_del_init (&rq->sched.link);__i915_request_submit (rq);dma_fence_set_error (&rq->fence, -EIO );
drivers/gpu/drm/i915/i915_priolist_types.h +2 -6
@@ -27,11 +27,8 @@ enum {#define I915_USER_PRIORITY_SHIFT 0#define I915_USER_PRIORITY (x) ((x) << I915_USER_PRIORITY_SHIFT) -#define I915_PRIORITY_COUNT BIT(I915_USER_PRIORITY_SHIFT) -#define I915_PRIORITY_MASK (I915_PRIORITY_COUNT - 1) -/* Smallest priority value that cannot be bumped. */ -#define I915_PRIORITY_INVALID (INT_MIN | (u8)I915_PRIORITY_MASK) +#define I915_PRIORITY_INVALID (INT_MIN)/* * Requests containing performance queries must not be preempted by
@@ -45,9 +42,8 @@ enum {#define I915_PRIORITY_BARRIER (I915_PRIORITY_UNPREEMPTABLE - 1)struct i915_priolist { -struct list_head requests[I915_PRIORITY_COUNT ]; +struct list_head requests;struct rb_node node; -unsigned long used;int priority; };
drivers/gpu/drm/i915/i915_scheduler.c +6 -45
100 lines not on this page · raw message
drivers/gpu/drm/i915/i915_scheduler.h +5 -13
@@ -13,17 +13,11 @@#include "i915_scheduler_types.h" -#define priolist_for_each_request (it, plist, idx) \ - for (idx = 0; idx < ARRAY_SIZE((plist)->requests); idx++) \ - list_for_each_entry(it, &(plist)->requests[idx], sched.link) - -#define priolist_for_each_request_consume (it, n, plist, idx) \ - for (; \ - (plist)->used ? (idx = __ffs((plist)->used)), 1 : 0; \ - (plist)->used &= ~BIT(idx)) \ - list_for_each_entry_safe(it, n, \ - &(plist)->requests[idx], \ - sched.link) +#define priolist_for_each_request (it, plist) \ + list_for_each_entry(it, &(plist)->requests, sched.link) + +#define priolist_for_each_request_consume (it, n, plist) \ + list_for_each_entry_safe(it, n, &(plist)->requests, sched.link)void i915_sched_node_init (struct i915_sched_node *node);void i915_sched_node_reinit (struct i915_sched_node *node);
@@ -42,8 +36,6 @@ void i915_sched_node_fini(struct i915_sched_node *node);void i915_schedule (struct i915_request *request,const struct i915_sched_attr *attr); -void i915_schedule_bump_priority (struct i915_request *rq,unsigned int bump); -struct list_head *i915_sched_lookup_priolist (struct intel_engine_cs *engine,int prio);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 17/33 drm/i915: Remove I915_USER_PRIORITY_SHIFT
In reply to Chris WilsonAs we do not have any internal priority levels, the priority can be set directed from the user values.
--- drivers/gpu/drm/i915/display/intel_display.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_context.c | 6 +-- .../i915/gem/selftests/i915_gem_object_blt.c | 4 +- .../gpu/drm/i915/gt/intel_engine_heartbeat.c | 6 +-- drivers/gpu/drm/i915/gt/selftest_lrc.c | 44 +++++++------------ drivers/gpu/drm/i915/i915_priolist_types.h | 3 -- drivers/gpu/drm/i915/i915_scheduler.c | 1 - 7 files changed, 23 insertions(+), 45 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -3
@@ -15908,9 +15908,7 @@ static void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state)static void fb_obj_bump_render_priority (struct drm_i915_gem_object *obj) { -struct i915_sched_attr attr = { - .priority =I915_USER_PRIORITY (I915_PRIORITY_DISPLAY ), - }; +struct i915_sched_attr attr = { .priority =I915_PRIORITY_DISPLAY };i915_gem_object_wait_priority (obj,0 , &attr); }
drivers/gpu/drm/i915/gem/i915_gem_context.c +3 -3
@@ -714,7 +714,7 @@ __create_context(struct drm_i915_private *i915)kref_init (&ctx->ref); ctx->i915 = i915; - ctx->sched.priority =I915_USER_PRIORITY (I915_PRIORITY_NORMAL ); + ctx->sched.priority =I915_PRIORITY_NORMAL ;mutex_init (&ctx->mutex);spin_lock_init (&ctx->stale.lock);
@@ -1996,7 +1996,7 @@ static int set_priority(struct i915_gem_context *ctx, !capable(CAP_SYS_NICE))return -EPERM ; - ctx->sched.priority =I915_USER_PRIORITY (priority); + ctx->sched.priority = priority;context_apply_all (ctx, __apply_priority, ctx);return 0 ;
@@ -2499,7 +2499,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,case I915_CONTEXT_PARAM_PRIORITY : args->size =0 ; - args->value = ctx->sched.priority >>I915_USER_PRIORITY_SHIFT ; + args->value = ctx->sched.priority;break ;case I915_CONTEXT_PARAM_SSEU :
drivers/gpu/drm/i915/gem/selftests/i915_gem_object_blt.c +2 -2
@@ -220,7 +220,7 @@ static int igt_fill_blt_thread(void *arg)return PTR_ERR (ctx); prio =i915_prandom_u32_max_state (I915_PRIORITY_MAX , prng); - ctx->sched.priority =I915_USER_PRIORITY (prio); + ctx->sched.priority = prio; } ce =i915_gem_context_get_engine (ctx,0 );
@@ -338,7 +338,7 @@ static int igt_copy_blt_thread(void *arg)return PTR_ERR (ctx); prio =i915_prandom_u32_max_state (I915_PRIORITY_MAX , prng); - ctx->sched.priority =I915_USER_PRIORITY (prio); + ctx->sched.priority = prio; } ce =i915_gem_context_get_engine (ctx,0 );
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +2 -4
@@ -69,9 +69,7 @@ static void show_heartbeat(const struct i915_request *rq,static void heartbeat (struct work_struct *wrk) { -struct i915_sched_attr attr = { - .priority =I915_USER_PRIORITY (I915_PRIORITY_MIN ), - }; +struct i915_sched_attr attr = { .priority =I915_PRIORITY_MIN };struct intel_engine_cs *engine =container_of (wrk,typeof (*engine), heartbeat.work.work);struct intel_context *ce = engine->kernel_context;
@@ -115,7 +113,7 @@ static void heartbeat(struct work_struct *wrk)*/ attr.priority =0 ;if (rq->sched.attr.priority >= attr.priority) - attr.priority |=I915_USER_PRIORITY (I915_PRIORITY_HEARTBEAT ); + attr.priority =I915_PRIORITY_HEARTBEAT ;if (rq->sched.attr.priority >= attr.priority) attr.priority =I915_PRIORITY_BARRIER ;
drivers/gpu/drm/i915/gt/selftest_lrc.c +15 -29
130 lines not on this page · raw message
drivers/gpu/drm/i915/i915_priolist_types.h +0 -3
@@ -24,9 +24,6 @@ enum { I915_PRIORITY_DISPLAY, }; -#define I915_USER_PRIORITY_SHIFT 0 -#define I915_USER_PRIORITY (x) ((x) << I915_USER_PRIORITY_SHIFT) -/* Smallest priority value that cannot be bumped. */ #define I915_PRIORITY_INVALID (INT_MIN)
drivers/gpu/drm/i915/i915_scheduler.c +0 -1
@@ -71,7 +71,6 @@ i915_sched_lookup_priolist(struct intel_engine_cs *engine, int prio)lockdep_assert_held (&engine->active.lock);assert_priolists (execlists); - prio >>=I915_USER_PRIORITY_SHIFT ;if (unlikely (execlists->no_priolist)) prio =I915_PRIORITY_NORMAL ;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 18/33 drm/i915: Replace engine->schedule() with a known request operation
In reply to Chris WilsonLooking to the future, we want to set the scheduling attributes explicitly and so replace the generic engine->schedule() with the more direct i915_request_set_priority()
What it loses in removing the 'schedule' name from the function, it gains in having an explicit entry point with a stated goal.
--- drivers/gpu/drm/i915/display/intel_display.c | 9 +---- drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +- drivers/gpu/drm/i915/gem/i915_gem_wait.c | 27 +++++---------- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 3 -- .../gpu/drm/i915/gt/intel_engine_heartbeat.c | 4 +-- drivers/gpu/drm/i915/gt/intel_engine_types.h | 29 ++++++++-------- drivers/gpu/drm/i915/gt/intel_engine_user.c | 2 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 3 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 11 +++---- drivers/gpu/drm/i915/gt/selftest_lrc.c | 33 +++++-------------- drivers/gpu/drm/i915/i915_request.c | 11 ++++--- drivers/gpu/drm/i915/i915_scheduler.c | 15 +++++---- drivers/gpu/drm/i915/i915_scheduler.h | 3 +- 13 files changed, 57 insertions(+), 95 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -8
@@ -15906,13 +15906,6 @@ static void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state)intel_unpin_fb_vma (vma, old_plane_state->flags); } -static void fb_obj_bump_render_priority (struct drm_i915_gem_object *obj) -{ -struct i915_sched_attr attr = { .priority =I915_PRIORITY_DISPLAY }; - -i915_gem_object_wait_priority (obj,0 , &attr); -} -/** * intel_prepare_plane_fb - Prepare fb for usage on plane * @_plane: drm plane to prepare for
@@ -15989,7 +15982,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,if (ret)return ret; -fb_obj_bump_render_priority (obj); +i915_gem_object_wait_priority (obj,0 ,I915_PRIORITY_DISPLAY );i915_gem_object_flush_frontbuffer (obj,ORIGIN_DIRTYFB );if (!new_plane_state->uapi.fence) {/* implicit fencing */
drivers/gpu/drm/i915/gem/i915_gem_object.h +1 -1
@@ -476,7 +476,7 @@ int i915_gem_object_wait(struct drm_i915_gem_object *obj, long timeout);int i915_gem_object_wait_priority (struct drm_i915_gem_object *obj,unsigned int flags, -const struct i915_sched_attr *attr); +int prio);void __i915_gem_object_flush_frontbuffer (struct drm_i915_gem_object *obj,enum fb_op_origin origin);
drivers/gpu/drm/i915/gem/i915_gem_wait.c +8 -19
@@ -93,28 +93,17 @@ i915_gem_object_wait_reservation(struct dma_resv *resv,return timeout; } -static void __fence_set_priority (struct dma_fence *fence, -const struct i915_sched_attr *attr) +static void __fence_set_priority (struct dma_fence *fence,int prio) { -struct i915_request *rq; -struct intel_engine_cs *engine; -if (dma_fence_is_signaled (fence) || !dma_fence_is_i915 (fence))return ; - rq =to_request (fence); - engine = rq->engine; -local_bh_disable (); -rcu_read_lock ();/* RCU serialisation for set-wedged protection */ -if (engine->schedule) - engine->schedule (rq, attr); -rcu_read_unlock (); +i915_request_set_priority (to_request (fence), prio);local_bh_enable ();/* kick the tasklets if queues were reprioritised */ } -static void fence_set_priority (struct dma_fence *fence, -const struct i915_sched_attr *attr) +static void fence_set_priority (struct dma_fence *fence,int prio) {/* Recurse once into a fence-array */ if (dma_fence_is_array (fence)) {
@@ -122,16 +111,16 @@ static void fence_set_priority(struct dma_fence *fence,int i;for (i =0 ; i < array->num_fences; i++) -__fence_set_priority (array->fences[i], attr); +__fence_set_priority (array->fences[i], prio); }else { -__fence_set_priority (fence, attr); +__fence_set_priority (fence, prio); } }int i915_gem_object_wait_priority (struct drm_i915_gem_object *obj,unsigned int flags, -const struct i915_sched_attr *attr) +int prio) {struct dma_fence *excl;
@@ -146,7 +135,7 @@ i915_gem_object_wait_priority(struct drm_i915_gem_object *obj,return ret;for (i =0 ; i < count; i++) { -fence_set_priority (shared[i], attr); +fence_set_priority (shared[i], prio);dma_fence_put (shared[i]); }
@@ -156,7 +145,7 @@ i915_gem_object_wait_priority(struct drm_i915_gem_object *obj, }if (excl) { -fence_set_priority (excl, attr); +fence_set_priority (excl, prio);dma_fence_put (excl); }return 0 ;
drivers/gpu/drm/i915/gt/intel_engine_cs.c +0 -3
@@ -334,9 +334,6 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id)if (engine->context_size)DRIVER_CAPS (i915)->has_logical_contexts = true; -/* Nothing to do here, execute in order of dependencies */ - engine->schedule =NULL ; -ewma__engine_latency_init (&engine->latency);seqcount_init (&engine->stats.lock);
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +2 -2
@@ -103,7 +103,7 @@ static void heartbeat(struct work_struct *wrk)* but all other contexts, including the kernel * context are stuck waiting for the signal. */ - }else if (engine->schedule && + }else if (intel_engine_has_scheduler (engine) && rq->sched.attr.priority <I915_PRIORITY_BARRIER ) {/* * Gradually raise the priority of the heartbeat to
@@ -118,7 +118,7 @@ static void heartbeat(struct work_struct *wrk) attr.priority =I915_PRIORITY_BARRIER ;local_bh_disable (); - engine->schedule (rq, &attr); +i915_request_set_priority (rq, attr.priority);local_bh_enable (); }else {if (IS_ENABLED (CONFIG_DRM_I915_DEBUG_GEM ))
drivers/gpu/drm/i915/gt/intel_engine_types.h +14 -15
@@ -483,14 +483,6 @@ struct intel_engine_cs {void (*bond_execute)(struct i915_request *rq,struct dma_fence *signal); -/* -* Call when the priority on a request has changed and it and its -* dependencies may need rescheduling. Note the request itself may -* not be ready to run! -*/ -void (*schedule)(struct i915_request *request, -const struct i915_sched_attr *attr); -void (*release)(struct intel_engine_cs *engine);struct intel_engine_execlists execlists;
@@ -508,13 +500,14 @@ struct intel_engine_cs {#define I915_ENGINE_USING_CMD_PARSER BIT(0)#define I915_ENGINE_SUPPORTS_STATS BIT(1) -#define I915_ENGINE_HAS_PREEMPTION BIT(2) -#define I915_ENGINE_HAS_SEMAPHORES BIT(3) -#define I915_ENGINE_HAS_TIMESLICES BIT(4) -#define I915_ENGINE_NEEDS_BREADCRUMB_TASKLET BIT(5) -#define I915_ENGINE_IS_VIRTUAL BIT(6) -#define I915_ENGINE_HAS_RELATIVE_MMIO BIT(7) -#define I915_ENGINE_REQUIRES_CMD_PARSER BIT(8) +#define I915_ENGINE_HAS_SCHEDULER BIT(2) +#define I915_ENGINE_HAS_PREEMPTION BIT(3) +#define I915_ENGINE_HAS_SEMAPHORES BIT(4) +#define I915_ENGINE_HAS_TIMESLICES BIT(5) +#define I915_ENGINE_NEEDS_BREADCRUMB_TASKLET BIT(6) +#define I915_ENGINE_IS_VIRTUAL BIT(7) +#define I915_ENGINE_HAS_RELATIVE_MMIO BIT(8) +#define I915_ENGINE_REQUIRES_CMD_PARSER BIT(9)unsigned int flags;/*
@@ -600,6 +593,12 @@ intel_engine_supports_stats(const struct intel_engine_cs *engine)return engine->flags &I915_ENGINE_SUPPORTS_STATS ; } +static inline bool +intel_engine_has_scheduler (const struct intel_engine_cs *engine) +{ +return engine->flags &I915_ENGINE_HAS_SCHEDULER ; +} +static inline bool intel_engine_has_preemption (const struct intel_engine_cs *engine) {
drivers/gpu/drm/i915/gt/intel_engine_user.c +1 -1
@@ -108,7 +108,7 @@ static void set_scheduler_caps(struct drm_i915_private *i915)for_each_uabi_engine (engine, i915) {/* all engines must agree! */ int i; -if (engine->schedule) +if (intel_engine_has_scheduler (engine)) enabled |= (I915_SCHEDULER_CAP_ENABLED |I915_SCHEDULER_CAP_PRIORITY );else
drivers/gpu/drm/i915/gt/intel_lrc.c +1 -2
@@ -4877,7 +4877,6 @@ static void execlists_park(struct intel_engine_cs *engine)void intel_execlists_set_default_submission (struct intel_engine_cs *engine) { engine->submit_request = execlists_submit_request; - engine->schedule = i915_schedule; engine->execlists.tasklet.func = execlists_submission_tasklet; engine->reset.prepare = execlists_reset_prepare;
@@ -4888,6 +4887,7 @@ void intel_execlists_set_default_submission(struct intel_engine_cs *engine) engine->park = execlists_park; engine->unpark =NULL ; + engine->flags |=I915_ENGINE_HAS_SCHEDULER ; engine->flags |=I915_ENGINE_SUPPORTS_STATS ;if (!intel_vgpu_active (engine->i915)) { engine->flags |=I915_ENGINE_HAS_SEMAPHORES ;
@@ -5622,7 +5622,6 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings, ve->base.cops = &virtual_context_ops; ve->base.request_alloc = execlists_request_alloc; - ve->base.schedule = i915_schedule; ve->base.submit_request = virtual_submit_request; ve->base.bond_execute = virtual_bond_execute;
drivers/gpu/drm/i915/gt/selftest_hangcheck.c +5 -6
@@ -726,12 +726,11 @@ static int active_engine(void *data) rq[idx] =i915_request_get (new);i915_request_add (new); -if (engine->schedule && arg->flags &TEST_PRIORITY ) { -struct i915_sched_attr attr = { - .priority = -i915_prandom_u32_max_state (512 , &prng), - }; - engine->schedule (rq[idx], &attr); +if (intel_engine_has_scheduler (engine) && + arg->flags &TEST_PRIORITY ) { +int prio =i915_prandom_u32_max_state (512 , &prng); + +i915_request_set_priority (rq[idx], prio); } err =active_request_put (old);
drivers/gpu/drm/i915/gt/selftest_lrc.c +8 -25
@@ -293,12 +293,8 @@ static int live_unlite_restore(struct intel_gt *gt, int prio)i915_request_put (rq[0 ]);if (prio) { -struct i915_sched_attr attr = { - .priority = prio, - }; -/* Alternatively preempt the spinner with ce[1] */ - engine->schedule (rq[1 ], &attr); +i915_request_set_priority (rq[1 ], prio); }/* And switch back to ce[0] for good measure */
@@ -898,9 +894,6 @@ release_queue(struct intel_engine_cs *engine,struct i915_vma *vma, int idx, int prio) { - struct i915_sched_attr attr = { - .priority = prio, - }; struct i915_request *rq;u32 *cs;
@@ -925,7 +918,7 @@ release_queue(struct intel_engine_cs *engine,i915_request_add (rq);local_bh_disable (); - engine->schedule (rq, &attr); +i915_request_set_priority (rq, prio);local_bh_enable ();/* kick tasklet */ i915_request_put (rq);
@@ -1332,7 +1325,6 @@ static int live_timeslice_queue(void *arg) goto err_pin;for_each_engine (engine, gt, id) { -struct i915_sched_attr attr = { .priority =I915_PRIORITY_MAX };struct i915_request *rq, *nop;if (!intel_engine_has_preemption (engine))
@@ -1347,7 +1339,7 @@ static int live_timeslice_queue(void *arg) err =PTR_ERR (rq); goto err_heartbeat; } - engine->schedule (rq, &attr); +i915_request_set_priority (rq,I915_PRIORITY_MAX ); err =wait_for_submit (engine, rq,HZ /2 );if (err) { pr_err("%s: Timed out trying to submit semaphores\n",
@@ -1834,7 +1826,6 @@ static int live_late_preempt(void *arg)struct i915_gem_context *ctx_hi, *ctx_lo;struct igt_spinner spin_hi, spin_lo;struct intel_engine_cs *engine; -struct i915_sched_attr attr = {};enum intel_engine_id id;int err = -ENOMEM ;
@@ -1897,8 +1888,7 @@ static int live_late_preempt(void *arg) goto err_wedged; } - attr.priority =I915_PRIORITY_MAX ; - engine->schedule (rq, &attr); +i915_request_set_priority (rq,I915_PRIORITY_MAX );if (!igt_wait_for_spinner (&spin_hi, rq)) {pr_err ("High priority context failed to preempt the low priority context\n" );
@@ -2374,7 +2364,6 @@ static int live_preempt_cancel(void *arg)static int live_suppress_self_preempt (void *arg) { -struct i915_sched_attr attr = { .priority =I915_PRIORITY_MAX };struct intel_gt *gt = arg;struct intel_engine_cs *engine;struct preempt_client a, b;
@@ -2445,7 +2434,7 @@ static int live_suppress_self_preempt(void *arg)i915_request_add (rq_b);GEM_BUG_ON (i915_request_completed (rq_a)); - engine->schedule (rq_a, &attr); +i915_request_set_priority (rq_a,I915_PRIORITY_MAX );igt_spinner_end (&a.spin);if (!igt_wait_for_spinner (&b.spin, rq_b)) {
@@ -2513,7 +2502,6 @@ static int live_chain_preempt(void *arg) goto err_client_hi;for_each_engine (engine, gt, id) { -struct i915_sched_attr attr = { .priority =I915_PRIORITY_MAX };struct igt_live_test t;struct i915_request *rq;int ring_size, count, i;
@@ -2580,7 +2568,7 @@ static int live_chain_preempt(void *arg)i915_request_get (rq);i915_request_add (rq); - engine->schedule (rq, &attr); +i915_request_set_priority (rq,I915_PRIORITY_MAX );igt_spinner_end (&hi.spin);if (i915_request_wait (rq,0 ,HZ /5 ) <0 ) {
@@ -2931,14 +2919,12 @@ static int live_preempt_gang(void *arg)return -EIO ;do { -struct i915_sched_attr attr = { .priority = prio++ }; - err =create_gang (engine, &rq);if (err)break ;/* Submit each spinner at increasing priority */ - engine->schedule (rq, &attr); +i915_request_set_priority (rq, prio++); }while (prio <=I915_PRIORITY_MAX && !__igt_timeout (end_time,NULL )); pr_debug("%s: Preempt chain of %d requests\n",
@@ -3160,9 +3146,6 @@ static int preempt_user(struct intel_engine_cs *engine, struct i915_vma *global, int id) { -struct i915_sched_attr attr = { - .priority =I915_PRIORITY_MAX - };struct i915_request *rq;int err =0 ;u32 *cs;
@@ -3187,7 +3170,7 @@ static int preempt_user(struct intel_engine_cs *engine,i915_request_get (rq);i915_request_add (rq); - engine->schedule (rq, &attr); +i915_request_set_priority (rq,I915_PRIORITY_MAX );if (i915_request_wait (rq,0 ,HZ /2 ) <0 ) err = -ETIME ;
drivers/gpu/drm/i915/i915_request.c +6 -5
@@ -1180,7 +1180,7 @@ __i915_request_await_execution(struct i915_request *to, }/* Couple the dependency tree for PI on this exposed to->fence */ -if (to->engine->schedule) { +if (intel_engine_has_scheduler (to->engine)) { err =i915_sched_node_add_dependency (&to->sched, &from->sched,I915_DEPENDENCY_WEAK );
@@ -1321,7 +1321,7 @@ i915_request_await_request(struct i915_request *to, struct i915_request *from)return 0 ; } -if (to->engine->schedule) { +if (intel_engine_has_scheduler (to->engine)) { ret =i915_sched_node_add_dependency (&to->sched, &from->sched,I915_DEPENDENCY_EXTERNAL );
@@ -1508,7 +1508,7 @@ __i915_request_add_to_timeline(struct i915_request *rq)__i915_sw_fence_await_dma_fence (&rq->submit, &prev->fence, &rq->dmaq); -if (rq->engine->schedule) +if (intel_engine_has_scheduler (rq->engine)) __i915_sched_node_add_dependency(&rq->sched, &prev->sched, &rq->dep,
@@ -1574,8 +1574,9 @@ void __i915_request_queue(struct i915_request *rq,* decide whether to preempt the entire chain so that it is ready to * run at the earliest possible convenience. */ -if (attr && rq->engine->schedule) - rq->engine->schedule (rq, attr); +if (attr) +i915_request_set_priority (rq, attr->priority); +i915_sw_fence_commit (&rq->semaphore);i915_sw_fence_commit (&rq->submit); }
drivers/gpu/drm/i915/i915_scheduler.c +9 -6
@@ -216,10 +216,8 @@ static void kick_submission(struct intel_engine_cs *engine,rcu_read_unlock (); } -static void __i915_schedule (struct i915_sched_node *node, -const struct i915_sched_attr *attr) +static void __i915_schedule (struct i915_sched_node *node,int prio) { -const int prio =max (attr->priority, node->attr.priority);struct intel_engine_cs *engine;struct i915_dependency *dep, *p;struct i915_dependency stack;
@@ -233,6 +231,8 @@ static void __i915_schedule(struct i915_sched_node *node,if (node_signaled (node))return ; + prio =max (prio, node->attr.priority); + stack.signaler = node;list_add (&stack.dfs_link, &dfs);
@@ -286,7 +286,7 @@ static void __i915_schedule(struct i915_sched_node *node,*/ if (node->attr.priority ==I915_PRIORITY_INVALID ) {GEM_BUG_ON (!list_empty (&node->link)); - node->attr = *attr; + node->attr.priority = prio;if (stack.dfs_link.next == stack.dfs_link.prev)return ;
@@ -341,10 +341,13 @@ static void __i915_schedule(struct i915_sched_node *node,spin_unlock (&engine->active.lock); } -void i915_schedule (struct i915_request *rq,const struct i915_sched_attr *attr) +void i915_request_set_priority (struct i915_request *rq,int prio) { +if (!intel_engine_has_scheduler (rq->engine)) +return ; +spin_lock_irq (&schedule_lock); -__i915_schedule (&rq->sched, attr); +__i915_schedule (&rq->sched, prio);spin_unlock_irq (&schedule_lock); }
drivers/gpu/drm/i915/i915_scheduler.h +1 -2
@@ -33,8 +33,7 @@ int i915_sched_node_add_dependency(struct i915_sched_node *node,void i915_sched_node_fini (struct i915_sched_node *node); -void i915_schedule (struct i915_request *request, -const struct i915_sched_attr *attr); +void i915_request_set_priority (struct i915_request *request,int prio);struct list_head *i915_sched_lookup_priolist (struct intel_engine_cs *engine,int prio);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 19/33 drm/i915/gt: Do not suspend bonded requests if one hangs
In reply to Chris WilsonTreat the dependency between bonded requests as weak and leave the remainder of the pair on the GPU if one hangs.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/gt/intel_lrc.c +6 -0
@@ -2697,6 +2697,9 @@ static void __execlists_hold(struct i915_request *rq)struct i915_request *w =container_of (p->waiter,typeof (*w), sched); +if (p->flags &I915_DEPENDENCY_WEAK ) +continue ; +/* Leave semaphores spinning on the other engines */ if (w->engine != rq->engine)continue ;
@@ -2792,6 +2795,9 @@ static void __execlists_unhold(struct i915_request *rq)struct i915_request *w =container_of (p->waiter,typeof (*w), sched); +if (p->flags &I915_DEPENDENCY_WEAK ) +continue ; +/* Propagate any change in error status */ if (rq->fence.error)i915_request_set_error_once (w, rq->fence.error);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 20/33 drm/i915: Teach the i915_dependency to use a double-lock
In reply to Chris WilsonCurrently, we construct and teardown the i915_dependency chains using a global spinlock. As the lists are entirely local, it should be possible to use an double-lock with an explicit nesting [signaler -> waiter, always] and so avoid the costly convenience of a global spinlock.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 6 +-- drivers/gpu/drm/i915/i915_request.c | 2 +- drivers/gpu/drm/i915/i915_scheduler.c | 44 +++++++++++++-------- drivers/gpu/drm/i915/i915_scheduler.h | 2 +- drivers/gpu/drm/i915/i915_scheduler_types.h | 1 + 5 files changed, 34 insertions(+), 21 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +3 -3
@@ -1852,7 +1852,7 @@ static void defer_request(struct i915_request *rq, struct list_head * const pl)struct i915_request *w =container_of (p->waiter,typeof (*w), sched); -if (p->flags &I915_DEPENDENCY_WEAK ) +if (!p->waiter || p->flags &I915_DEPENDENCY_WEAK )continue ;/* Leave semaphores spinning on the other engines */
@@ -2697,7 +2697,7 @@ static void __execlists_hold(struct i915_request *rq)struct i915_request *w =container_of (p->waiter,typeof (*w), sched); -if (p->flags &I915_DEPENDENCY_WEAK ) +if (!p->waiter || p->flags &I915_DEPENDENCY_WEAK )continue ;/* Leave semaphores spinning on the other engines */
@@ -2795,7 +2795,7 @@ static void __execlists_unhold(struct i915_request *rq)struct i915_request *w =container_of (p->waiter,typeof (*w), sched); -if (p->flags &I915_DEPENDENCY_WEAK ) +if (!p->waiter || p->flags &I915_DEPENDENCY_WEAK )continue ;/* Propagate any change in error status */
drivers/gpu/drm/i915/i915_request.c +1 -1
@@ -337,7 +337,7 @@ bool i915_request_retire(struct i915_request *rq)intel_context_unpin (rq->context);free_capture_list (rq); -i915_sched_node_fini (&rq->sched); +i915_sched_node_retire (&rq->sched);i915_request_put (rq);return true;
drivers/gpu/drm/i915/i915_scheduler.c +28 -16
95 lines not on this page · raw message
drivers/gpu/drm/i915/i915_scheduler.h +1 -1
@@ -31,7 +31,7 @@ int i915_sched_node_add_dependency(struct i915_sched_node *node,struct i915_sched_node *signal, unsigned long flags); -void i915_sched_node_fini (struct i915_sched_node *node); +void i915_sched_node_retire (struct i915_sched_node *node);void i915_request_set_priority (struct i915_request *request,int prio);
drivers/gpu/drm/i915/i915_scheduler_types.h +1 -0
@@ -60,6 +60,7 @@ struct i915_sched_attr {* others. */ struct i915_sched_node { +spinlock_t lock;/* protect the lists */ struct list_head signalers_list;/* those before us, we depend upon */ struct list_head waiters_list;/* those after us, they depend upon us */ struct list_head link;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 21/33 drm/i915: Restructure priority inheritance
In reply to Chris WilsonIn anticipation of wanting to be able to call pi from underneath an engine's active.lock, rework the priority inheritance to primarily work along an engine's priority queue, delegating any other engine that the chain may traverse to a worker. This reduces the global spinlock from governing the entire priority inheritance depth-first search, to a small lock around a single list.
--- drivers/gpu/drm/i915/i915_scheduler.c | 246 ++++++++++---------- drivers/gpu/drm/i915/i915_scheduler_types.h | 6 +- 2 files changed, 130 insertions(+), 122 deletions(-)
drivers/gpu/drm/i915/i915_scheduler.c +126 -120
@@ -17,7 +17,66 @@ static struct i915_global_scheduler {struct kmem_cache *slab_priorities; } global; -static DEFINE_SPINLOCK (schedule_lock); +static DEFINE_SPINLOCK (ipi_lock); +static LIST_HEAD (ipi_list); + +static inline int rq_prio (const struct i915_request *rq) +{ +return READ_ONCE (rq->sched.attr.priority); +} + +static void ipi_schedule (struct irq_work *wrk) +{ +rcu_read_lock (); +do { +struct i915_dependency *p; +struct i915_request *rq; +unsigned long flags; +int prio; + +spin_lock_irqsave (&ipi_lock, flags); + p =list_first_entry_or_null (&ipi_list,typeof (*p), ipi_link); +if (p) { + rq =container_of (p->signaler,typeof (*rq), sched); +list_del_init (&p->ipi_link); + + prio = p->ipi_priority; + p->ipi_priority =I915_PRIORITY_INVALID ; + } +spin_unlock_irqrestore (&ipi_lock, flags); +if (!p) +break ; + +if (i915_request_completed (rq)) +continue ; + +if (prio >rq_prio (rq)) +i915_request_set_priority (rq, prio); + }while (1 ); +rcu_read_unlock (); +} + +static DEFINE_IRQ_WORK(ipi_work, ipi_schedule); + +/* +* Virtual engines complicate acquiring the engine timeline lock, +* as their rq->engine pointer is not stable until under that +* engine lock. The simple ploy we use is to take the lock then +* check that the rq still belongs to the newly locked engine. +*/ +#define lock_engine_irqsave (rq, flags) ({ \ + struct i915_request * const rq__ = (rq); \ + struct intel_engine_cs *engine__ = READ_ONCE(rq__->engine); \ +\ + spin_lock_irqsave(&engine__->active.lock, (flags)); \ + while (engine__ != READ_ONCE((rq__)->engine)) { \ + spin_unlock(&engine__->active.lock); \ + engine__ = READ_ONCE(rq__->engine); \ + spin_lock(&engine__->active.lock); \ + } \ +\ + engine__; \ +})static const struct i915_request *node_to_request (const struct i915_sched_node *node)
@@ -126,42 +185,6 @@ void __i915_priolist_free(struct i915_priolist *p)kmem_cache_free (global.slab_priorities, p); } -struct sched_cache { -struct list_head *priolist; -}; - -static struct intel_engine_cs * -sched_lock_engine (const struct i915_sched_node *node, -struct intel_engine_cs *locked, -struct sched_cache *cache) -{ -const struct i915_request *rq =node_to_request (node); -struct intel_engine_cs *engine; - -GEM_BUG_ON (!locked); - -/* -* Virtual engines complicate acquiring the engine timeline lock, -* as their rq->engine pointer is not stable until under that -* engine lock. The simple ploy we use is to take the lock then -* check that the rq still belongs to the newly locked engine. -*/ -while (locked != (engine =READ_ONCE (rq->engine))) { -spin_unlock (&locked->active.lock); -memset (cache,0 ,sizeof (*cache)); -spin_lock (&engine->active.lock); - locked = engine; - } - -GEM_BUG_ON (locked != engine); -return locked; -} - -static inline int rq_prio (const struct i915_request *rq) -{ -return rq->sched.attr.priority; -} -static inline bool need_preempt (int prio,int active) {/*
@@ -216,25 +239,15 @@ static void kick_submission(struct intel_engine_cs *engine,rcu_read_unlock (); } -static void __i915_schedule (struct i915_sched_node *node,int prio) +static void __i915_request_set_priority (struct i915_request *rq,int prio) { -struct intel_engine_cs *engine; -struct i915_dependency *dep, *p; -struct i915_dependency stack; -struct sched_cache cache; +struct intel_engine_cs *engine = rq->engine; +struct i915_request *rn; +struct list_head *plist;LIST_HEAD (dfs); -/* Needed in order to use the temporary link inside i915_dependency */ -lockdep_assert_held (&schedule_lock); -GEM_BUG_ON (prio ==I915_PRIORITY_INVALID ); - -if (node_signaled (node)) -return ; - - prio =max (prio, node->attr.priority); - - stack.signaler = node; -list_add (&stack.dfs_link, &dfs); +lockdep_assert_held (&engine->active.lock); +list_add (&rq->sched.dfs, &dfs);/* * Recursively bump all dependent priorities to match the new request.
@@ -254,66 +267,47 @@ static void __i915_schedule(struct i915_sched_node *node, int prio)* end result is a topological list of requests in reverse order, the * last element in the list is the request we must execute first. */ -list_for_each_entry (dep, &dfs, dfs_link) { -struct i915_sched_node *node = dep->signaler; +list_for_each_entry (rq, &dfs, sched.dfs) { +struct i915_dependency *p; -/* If we are already flying, we know we have no signalers */ -if (node_started (node)) -continue ; +/* Also release any children on this engine that are ready */ +GEM_BUG_ON (rq->engine != engine); -/* -* Within an engine, there can be no cycle, but we may -* refer to the same dependency chain multiple times -* (redundant dependencies are not eliminated) and across -* engines. -*/ -list_for_each_entry (p, &node->signalers_list, signal_link) { -GEM_BUG_ON (p == dep);/* no cycles! */ +for_each_signaler (p, rq) { +struct i915_request *s = +container_of (p->signaler,typeof (*s), sched); -if (node_signaled (p->signaler)) -continue ; +GEM_BUG_ON (s == rq); -if (prio >READ_ONCE (p->signaler->attr.priority)) -list_move_tail (&p->dfs_link, &dfs); - } - } +if (rq_prio (s) >= prio) +continue ; -/* -* If we didn't need to bump any existing priorities, and we haven't -* yet submitted this request (i.e. there is no potential race with -* execlists_submit_request()), we can set our own priority and skip -* acquiring the engine locks. -*/ -if (node->attr.priority ==I915_PRIORITY_INVALID ) { -GEM_BUG_ON (!list_empty (&node->link)); - node->attr.priority = prio; +if (i915_request_completed (s)) +continue ; -if (stack.dfs_link.next == stack.dfs_link.prev) -return ; +if (s->engine != rq->engine) { +spin_lock (&ipi_lock); +if (prio > p->ipi_priority) { + p->ipi_priority = prio; +list_move (&p->ipi_link, &ipi_list); +irq_work_queue (&ipi_work); + } +spin_unlock (&ipi_lock); +continue ; + } -__list_del_entry (&stack.dfs_link); +list_move_tail (&s->sched.dfs, &dfs); + } } -memset (&cache,0 ,sizeof (cache)); - engine =node_to_request (node)->engine; -spin_lock (&engine->active.lock); - -/* Fifo and depth-first replacement ensure our deps execute before us */ - engine =sched_lock_engine (node, engine, &cache); -list_for_each_entry_safe_reverse (dep, p, &dfs, dfs_link) { -INIT_LIST_HEAD (&dep->dfs_link); + plist =i915_sched_lookup_priolist (engine, prio); - node = dep->signaler; - engine =sched_lock_engine (node, engine, &cache); -lockdep_assert_held (&engine->active.lock); +/* Fifo and depth-first replacement ensure our deps execute first */ +list_for_each_entry_safe_reverse (rq, rn, &dfs, sched.dfs) { +GEM_BUG_ON (rq->engine != engine); -/* Recheck after acquiring the engine->timeline.lock */ -if (prio <= node->attr.priority ||node_signaled (node)) -continue ; - -GEM_BUG_ON (node_to_request (node)->engine != engine); - -WRITE_ONCE (node->attr.priority, prio); +INIT_LIST_HEAD (&rq->sched.dfs); +WRITE_ONCE (rq->sched.attr.priority, prio);/* * Once the request is ready, it will be placed into the
@@ -323,32 +317,36 @@ static void __i915_schedule(struct i915_sched_node *node, int prio)* any preemption required, be dealt with upon submission. * See engine->submit_request() */ -if (list_empty (&node->link)) +if (!i915_request_is_ready (rq))continue ; -if (i915_request_in_priority_queue (node_to_request (node))) { -if (!cache.priolist) - cache.priolist = -i915_sched_lookup_priolist (engine, - prio); -list_move_tail (&node->link, cache.priolist); - } +if (i915_request_in_priority_queue (rq)) +list_move_tail (&rq->sched.link, plist); -/* Defer (tasklet) submission until after all of our updates. */ -kick_submission (engine,node_to_request (node), prio); +/* Defer (tasklet) submission until after all updates. */ +kick_submission (engine, rq, prio); } - -spin_unlock (&engine->active.lock); }void i915_request_set_priority (struct i915_request *rq,int prio) { -if (!intel_engine_has_scheduler (rq->engine)) -return ; +struct intel_engine_cs *engine; +unsigned long flags; + + engine =lock_engine_irqsave (rq, flags); +if (!intel_engine_has_scheduler (engine)) + goto unlock; -spin_lock_irq (&schedule_lock); -__i915_schedule (&rq->sched, prio); -spin_unlock_irq (&schedule_lock); +if (i915_request_completed (rq)) + goto unlock; + +if (prio <=rq_prio (rq)) + goto unlock; + +__i915_request_set_priority (rq, prio); + +unlock: +spin_unlock_irqrestore (&engine->active.lock, flags); }void i915_sched_node_init (struct i915_sched_node *node)
@@ -358,6 +356,7 @@ void i915_sched_node_init(struct i915_sched_node *node)INIT_LIST_HEAD (&node->signalers_list);INIT_LIST_HEAD (&node->waiters_list);INIT_LIST_HEAD (&node->link); +INIT_LIST_HEAD (&node->dfs);i915_sched_node_reinit (node); }
@@ -396,7 +395,8 @@ bool __i915_sched_node_add_dependency(struct i915_sched_node *node,spin_lock_irq (&signal->lock);if (!node_signaled (signal)) { -INIT_LIST_HEAD (&dep->dfs_link); +INIT_LIST_HEAD (&dep->ipi_link); + dep->ipi_priority =I915_PRIORITY_INVALID ; dep->signaler = signal; dep->waiter = node; dep->flags = flags;
@@ -464,6 +464,12 @@ void i915_sched_node_retire(struct i915_sched_node *node)GEM_BUG_ON (dep->signaler != node); +if (unlikely (!list_empty (&dep->ipi_link))) { +spin_lock (&ipi_lock); +list_del (&dep->ipi_link); +spin_unlock (&ipi_lock); + } + w =READ_ONCE (dep->waiter);if (w) {spin_lock_nested (&w->lock,SINGLE_DEPTH_NESTING );
drivers/gpu/drm/i915/i915_scheduler_types.h +4 -2
@@ -63,7 +63,8 @@ struct i915_sched_node {spinlock_t lock;/* protect the lists */ struct list_head signalers_list;/* those before us, we depend upon */ struct list_head waiters_list;/* those after us, they depend upon us */ -struct list_head link; +struct list_head link;/* guarded by engine->active.lock */ +struct list_head dfs;/* guarded by engine->active.lock */ struct i915_sched_attr attr;unsigned int flags;#define I915_SCHED_HAS_EXTERNAL_CHAIN BIT(0)
@@ -75,11 +76,12 @@ struct i915_dependency {struct i915_sched_node *waiter;struct list_head signal_link;struct list_head wait_link; -struct list_head dfs_link; +struct list_head ipi_link;unsigned long flags;#define I915_DEPENDENCY_ALLOC BIT(0)#define I915_DEPENDENCY_EXTERNAL BIT(1)#define I915_DEPENDENCY_WEAK BIT(2) +int ipi_priority; };#define for_each_waiter (p__, rq__) \
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 22/33 drm/i915/gt: Remove timeslice suppression
In reply to Chris WilsonIn the next patch, we remove the strict priority system and continuously re-evaluate the relative priority of tasks. As such we need to enable the timeslice whenever there is more than one context in the pipeline. This simplifies the decision and removes some of the tweaks to suppress timeslicing, allowing us to lift the timeslice enabling to a common spot at the end of running the submission tasklet.
--- drivers/gpu/drm/i915/gt/intel_engine_types.h | 10 -- drivers/gpu/drm/i915/gt/intel_lrc.c | 161 ++++++------------- 2 files changed, 53 insertions(+), 118 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_types.h +0 -10
@@ -231,16 +231,6 @@ struct intel_engine_execlists {*/ unsigned int port_mask; -/** -* @switch_priority_hint: Second context priority. -* -* We submit multiple contexts to the HW simultaneously and would -* like to occasionally switch between them to emulate timeslicing. -* To know when timeslicing is suitable, we track the priority of -* the context submitted second. -*/ -int switch_priority_hint; -/** * @queue_priority_hint: Highest pending priority. *
drivers/gpu/drm/i915/gt/intel_lrc.c +53 -108
252 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 23/33 drm/i915: Fair low-latency scheduling
In reply to Chris WilsonThe first "scheduler" was a topographical sorting of requests into priority order. The execution order was deterministic, the earliest submitted, highest priority request would be executed first. Priority inherited ensured that inversions were kept at bay, and allowed us to dynamically boost priorities (e.g. for interactive pageflips).
The minimalistic timeslicing scheme was an attempt to introduce fairness between long running requests, by evicting the active request at the end of a timeslice and moving it to the back of its priority queue (while ensuring that dependencies were kept in order). For short running requests from many clients of equal priority, the scheme is still very much FIFO submission ordering, and as unfair as before.
To impose fairness, we need an external metric that ensures that clients are interpersed, we don't execute one long chain from client A before executing any of client B. This could be imposed by the clients by using a fences based on an external clock, that is they only submit work for a "frame" at frame-interval, instead of submitting as much work as they are able to. The standard SwapBuffers approach is akin to double bufferring, where as one frame is being executed, the next is being submitted, such that there is always a maximum of two frames per client in the pipeline. Even this scheme exhibits unfairness under load as a single client will execute two frames back to back before the next, and with enough clients, deadlines will be missed.
The idea introduced by BFS/MuQSS is that fairness is introduced by metering with an external clock. Every request, when it becomes ready to execute is assigned a virtual deadline, and execution order is then determined by earliest deadline. Priority is used as a hint, rather than strict ordering, where high priority requests have earlier deadlines, but not necessarily earlier than outstanding work. Thus work is executed in order of 'readiness', with timeslicing to demote long running work.
The Achille's heel of this scheduler is its strong preference for low-latency and favouring of new queues. Whereas it was easy to dominate the old scheduler by flooding it with many requests over a short period of time, the new scheduler can be dominated by a 'synchronous' client that waits for each of its requests to complete before submitting the next. As such a client has no history, it is always considered ready-to-run and receives an earlier deadline than the long running requests.
To check the impact on throughput (often the downfall of latency sensitive schedulers), we used gem_wsim to simulate various transcode workloads with different load balancers, and varying the number of competing [heterogenous] clients.
+mB--------------------------------------------------------------------+
| a | | cda | | c.a | | ..aa | | ..---. | | -.--+-. | | .c.-.-+++. b | | b bb.d-c-+--+++.aab aa b b | |b b b b b. b ..---+++-+++++....a. b. b b b b b b| 1 A| | 2 |___AM____| | 3 |A__| | 4 |MA_| | +----------------------------------------------------------------------+ Clients Min Max Median Avg Stddev 1 -8.20 5.4 -0.045 -0.02375 0.094722134 2 -15.96 19.28 -0.64 -1.05 2.2428076 4 -5.11 2.95 -1.15 -1.0683333 0.72382651 8 -5.63 1.85 -0.905 -0.87122449 0.73390971
The impact was on average 1% under contention due to the change in context execution order and number of context switches.
--- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 12 +- .../gpu/drm/i915/gt/intel_engine_heartbeat.c | 1 + drivers/gpu/drm/i915/gt/intel_engine_pm.c | 4 +- drivers/gpu/drm/i915/gt/intel_engine_types.h | 14 - drivers/gpu/drm/i915/gt/intel_lrc.c | 204 +++++----- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 5 +- drivers/gpu/drm/i915/gt/selftest_lrc.c | 41 +- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 6 +- drivers/gpu/drm/i915/i915_priolist_types.h | 7 +- drivers/gpu/drm/i915/i915_request.c | 1 + drivers/gpu/drm/i915/i915_scheduler.c | 349 +++++++++++++----- drivers/gpu/drm/i915/i915_scheduler.h | 24 +- drivers/gpu/drm/i915/i915_scheduler_types.h | 17 + .../drm/i915/selftests/i915_mock_selftests.h | 1 + drivers/gpu/drm/i915/selftests/i915_request.c | 1 + .../gpu/drm/i915/selftests/i915_scheduler.c | 49 +++ 16 files changed, 478 insertions(+), 258 deletions(-) create mode 100644 drivers/gpu/drm/i915/selftests/i915_scheduler.c
drivers/gpu/drm/i915/gt/intel_engine_cs.c +6 -6
@@ -513,7 +513,6 @@ void intel_engine_init_execlists(struct intel_engine_cs *engine) execlists->active =memset (execlists->inflight,0 ,sizeof (execlists->inflight)); - execlists->queue_priority_hint =INT_MIN ; execlists->queue =RB_ROOT_CACHED ; }
@@ -1199,14 +1198,15 @@ bool intel_engine_can_store_dword(struct intel_engine_cs *engine) } } -static int print_sched_attr (const struct i915_sched_attr *attr, -char *buf,int x,int len) +static int print_sched (const struct i915_sched_node *node, +char *buf,int x,int len) { -if (attr->priority ==I915_PRIORITY_INVALID ) +if (node->attr.priority ==I915_PRIORITY_INVALID )return x; x +=snprintf (buf + x, len - x, -" prio=%d" , attr->priority); +" prio=%d, dl=%llu" , + node->attr.priority, node->deadline);return x; }
@@ -1219,7 +1219,7 @@ static void print_request(struct drm_printer *m,char buf[80 ] ="" ;int x =0 ; - x =print_sched_attr (&rq->sched.attr, buf, x,sizeof (buf)); + x =print_sched (&rq->sched, buf, x,sizeof (buf)); drm_printf(m, "%s %llx:%llx%s%s %s @ %dms: %s\n", prefix,
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +1 -0
@@ -235,6 +235,7 @@ int intel_engine_pulse(struct intel_engine_cs *engine) goto out_unlock; } + rq->sched.deadline =0 ;__set_bit (I915_FENCE_FLAG_SENTINEL , &rq->fence.flags);heartbeat_commit (rq, &attr);GEM_BUG_ON (rq->sched.attr.priority <I915_PRIORITY_BARRIER );
drivers/gpu/drm/i915/gt/intel_engine_pm.c +1 -3
@@ -188,6 +188,7 @@ static bool switch_to_kernel_context(struct intel_engine_cs *engine)i915_request_add_active_barriers (rq);/* Install ourselves as a preemption barrier */ + rq->sched.deadline =0 ; rq->sched.attr.priority =I915_PRIORITY_BARRIER ;if (likely (!__i915_request_commit (rq))) {/* engine should be idle! */ /*
@@ -248,9 +249,6 @@ static int __engine_park(struct intel_wakeref *wf)intel_engine_park_heartbeat (engine);intel_engine_disarm_breadcrumbs (engine); -/* Must be reset upon idling, or we may miss the busy wakeup. */ -GEM_BUG_ON (engine->execlists.queue_priority_hint !=INT_MIN ); -if (engine->park) engine->park (engine);
drivers/gpu/drm/i915/gt/intel_engine_types.h +0 -14
@@ -231,20 +231,6 @@ struct intel_engine_execlists {*/ unsigned int port_mask; -/** -* @queue_priority_hint: Highest pending priority. -* -* When we add requests into the queue, or adjust the priority of -* executing requests, we compute the maximum priority of those -* pending requests. We can then use this value to determine if -* we need to preempt the executing requests to service the queue. -* However, since the we may have recorded the priority of an inflight -* request we wanted to preempt but since completed, at the time of -* dequeuing the priority hint may no longer may match the highest -* available request priority. -*/ -int queue_priority_hint; -/** * @queue: queue of requests, in priority lists */
drivers/gpu/drm/i915/gt/intel_lrc.c +83 -121
490 lines not on this page · raw message
drivers/gpu/drm/i915/gt/selftest_hangcheck.c +4 -1
@@ -878,7 +878,10 @@ static int __igt_reset_engines(struct intel_gt *gt,break ; } -if (i915_request_wait (rq,0 ,HZ /5 ) <0 ) { +/* With deadlines, no strict priority */ +i915_request_set_deadline (rq,0 ); + +if (i915_request_wait (rq,0 ,HZ /2 ) <0 ) {struct drm_printer p =drm_info_printer (gt->i915->drm.dev);
drivers/gpu/drm/i915/gt/selftest_lrc.c +29 -12
136 lines not on this page · raw message
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -5
@@ -333,8 +333,6 @@ static void __guc_dequeue(struct intel_engine_cs *engine)i915_priolist_free (p); } done: - execlists->queue_priority_hint = - rb ?to_priolist (rb)->priority :INT_MIN ;if (submit) { *port =schedule_in (last, port - execlists->inflight); *++port =NULL ;
@@ -473,12 +471,10 @@ static void guc_reset_cancel(struct intel_engine_cs *engine)rb_erase_cached (&p->node, &execlists->queue);i915_priolist_free (p); } +GEM_BUG_ON (!RB_EMPTY_ROOT (&execlists->queue.rb_root));/* Remaining _unready_ requests will be nop'ed when submitted */ - execlists->queue_priority_hint =INT_MIN ; - execlists->queue =RB_ROOT_CACHED ; -spin_unlock_irqrestore (&engine->active.lock, flags); }
drivers/gpu/drm/i915/i915_priolist_types.h +4 -3
@@ -22,6 +22,8 @@ enum {/* Interactive workload, scheduled for immediate pageflipping */ I915_PRIORITY_DISPLAY , + + __I915_PRIORITY_KERNEL__ };/* Smallest priority value that cannot be bumped. */
@@ -35,13 +37,12 @@ enum {* i.e. nothing can have higher priority and force us to usurp the * active request. */ -#define I915_PRIORITY_UNPREEMPTABLE INT_MAX -#define I915_PRIORITY_BARRIER (I915_PRIORITY_UNPREEMPTABLE - 1) +#define I915_PRIORITY_BARRIER INT_MAXstruct i915_priolist {struct list_head requests;struct rb_node node; -int priority; +u64 deadline; };#endif /* _I915_PRIOLIST_TYPES_H_ */
drivers/gpu/drm/i915/i915_request.c +1 -0
@@ -685,6 +685,7 @@ semaphore_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)switch (state) {case FENCE_COMPLETE : +i915_request_update_deadline (rq);break ;case FENCE_FREE :
drivers/gpu/drm/i915/i915_scheduler.c +261 -88
480 lines not on this page · raw message
drivers/gpu/drm/i915/i915_scheduler.h +19 -5
@@ -34,15 +34,29 @@ int i915_sched_node_add_dependency(struct i915_sched_node *node,void i915_sched_node_retire (struct i915_sched_node *node);void i915_request_set_priority (struct i915_request *request,int prio); +void i915_request_set_deadline (struct i915_request *request,u64 deadline); + +void i915_request_update_deadline (struct i915_request *request); + +u64 i915_scheduler_virtual_deadline (u64 kt,int priority); +u64 i915_scheduler_next_virtual_deadline (int priority); + +bool intel_engine_queue_request (struct intel_engine_cs *engine, +struct i915_request *rq);struct list_head * -i915_sched_lookup_priolist (struct intel_engine_cs *engine,int prio); +i915_sched_lookup_priolist (struct intel_engine_cs *engine,u64 deadline); + +void i915_priolist_free (struct i915_priolist *p); + +static inline u64 i915_sched_to_ticks (ktime_t kt) +{ +return ktime_to_ns (kt) >>I915_SCHED_DEADLINE_SHIFT ; +} -void __i915_priolist_free (struct i915_priolist *p); -static inline void i915_priolist_free (struct i915_priolist *p) +static inline u64 i915_sched_to_ns (u64 deadline) { -if (p->priority !=I915_PRIORITY_NORMAL ) -__i915_priolist_free (p); +return deadline <<I915_SCHED_DEADLINE_SHIFT ; }#endif /* _I915_SCHEDULER_H_ */
drivers/gpu/drm/i915/i915_scheduler_types.h +17 -0
@@ -69,6 +69,22 @@ struct i915_sched_node {unsigned int flags;#define I915_SCHED_HAS_EXTERNAL_CHAIN BIT(0)intel_engine_mask_t semaphores; + +/** +* @deadline: [virtual] deadline +* +* When the request is ready for execution, it is given a quota +* (the engine's timeslice) and a virtual deadline. The virtual +* deadline is derived from the current time: +* ktime_get() + (prio_ratio * timeslice) +* +* Requests are then executed in order of deadline completion. +* Requests with earlier deadlines than currently executing on +* the engine will preempt the active requests. +*/ +u64 deadline; +#define I915_SCHED_DEADLINE_SHIFT 19/* i.e. roughly 500us buckets */ +#define I915_DEADLINE_NEVER U64_MAX };struct i915_dependency {
@@ -81,6 +97,7 @@ struct i915_dependency {#define I915_DEPENDENCY_ALLOC BIT(0)#define I915_DEPENDENCY_EXTERNAL BIT(1)#define I915_DEPENDENCY_WEAK BIT(2) +u64 ipi_deadline;int ipi_priority; };
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h +1 -0
@@ -25,6 +25,7 @@ selftest(ring, intel_ring_mock_selftests) selftest(engine, intel_engine_cs_mock_selftests) selftest(timelines, intel_timeline_mock_selftests) selftest(requests, i915_request_mock_selftests) +selftest(scheduler, i915_scheduler_mock_selftests) selftest(objects, i915_gem_object_mock_selftests) selftest(phys, i915_gem_phys_mock_selftests)selftest (dmabuf, i915_gem_dmabuf_mock_selftests)
drivers/gpu/drm/i915/selftests/i915_request.c +1 -0
@@ -2123,6 +2123,7 @@ static int measure_preemption(struct intel_context *ce)intel_ring_advance (rq, cs); rq->sched.attr.priority =I915_PRIORITY_BARRIER ; + rq->sched.deadline =0 ; elapsed[i -1 ] =ENGINE_READ_FW (ce->engine,RING_TIMESTAMP );i915_request_add (rq);
drivers/gpu/drm/i915/selftests/i915_scheduler.c new file +49 -0
49 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 24/33 drm/i915/gt: Specify a deadline for the heartbeat
In reply to Chris WilsonAs we know when we expect the heartbeat to be checked for completion, pass this information along as its deadline. We still do not complain if the deadline is missed, at least until we have tried a few times, but it will allow for quicker hang detection on systems where deadlines are adhered to.
--- drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +13 -0
@@ -54,6 +54,16 @@ static void heartbeat_commit(struct i915_request *rq,local_bh_enable (); } +static void set_heartbeat_deadline (struct intel_engine_cs *engine, +struct i915_request *rq) +{ +unsigned long interval; + + interval =READ_ONCE (engine->props.heartbeat_interval_ms); +if (interval) +i915_request_set_deadline (rq,ktime_get () + (interval <<20 )); +} +static void show_heartbeat (const struct i915_request *rq,struct intel_engine_cs *engine) {
@@ -119,6 +129,8 @@ static void heartbeat(struct work_struct *wrk)local_bh_disable ();i915_request_set_priority (rq, attr.priority); +if (attr.priority ==I915_PRIORITY_BARRIER ) +i915_request_set_deadline (rq,0 );local_bh_enable (); }else {if (IS_ENABLED (CONFIG_DRM_I915_DEBUG_GEM ))
@@ -155,6 +167,7 @@ static void heartbeat(struct work_struct *wrk)if (engine->i915->params.enable_hangcheck) engine->heartbeat.systole =i915_request_get (rq); +set_heartbeat_deadline (engine, rq);heartbeat_commit (rq, &attr); unlock:
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 25/33 drm/i915: Replace the priority boosting for the display with a deadline
In reply to Chris WilsonFor a modeset/pageflip, there is a very precise deadline by which the frame must be completed in order to hit the vblank and be shown. While we don't pass along that exact information, we can at least inform the scheduler that this request-chain needs to be completed asap.
--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ++-- drivers/gpu/drm/i915/gem/i915_gem_wait.c | 19 ++++++++++--------- drivers/gpu/drm/i915/i915_priolist_types.h | 3 --- 4 files changed, 13 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
@@ -15982,7 +15982,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,if (ret)return ret; -i915_gem_object_wait_priority (obj,0 ,I915_PRIORITY_DISPLAY ); +i915_gem_object_wait_deadline (obj,0 ,ktime_get ()/* next vblank? */ );i915_gem_object_flush_frontbuffer (obj,ORIGIN_DIRTYFB );if (!new_plane_state->uapi.fence) {/* implicit fencing */
drivers/gpu/drm/i915/gem/i915_gem_object.h +2 -2
@@ -474,9 +474,9 @@ static inline void __start_cpu_write(struct drm_i915_gem_object *obj)int i915_gem_object_wait (struct drm_i915_gem_object *obj,unsigned int flags,long timeout); -int i915_gem_object_wait_priority (struct drm_i915_gem_object *obj, +int i915_gem_object_wait_deadline (struct drm_i915_gem_object *obj,unsigned int flags, -int prio); +ktime_t deadline);void __i915_gem_object_flush_frontbuffer (struct drm_i915_gem_object *obj,enum fb_op_origin origin);
drivers/gpu/drm/i915/gem/i915_gem_wait.c +10 -9
@@ -93,17 +93,18 @@ i915_gem_object_wait_reservation(struct dma_resv *resv,return timeout; } -static void __fence_set_priority (struct dma_fence *fence,int prio) +static void __fence_set_deadline (struct dma_fence *fence,ktime_t deadline) {if (dma_fence_is_signaled (fence) || !dma_fence_is_i915 (fence))return ;local_bh_disable (); -i915_request_set_priority (to_request (fence), prio); +i915_request_set_deadline (to_request (fence), +i915_sched_to_ticks (deadline));local_bh_enable ();/* kick the tasklets if queues were reprioritised */ } -static void fence_set_priority (struct dma_fence *fence,int prio) +static void fence_set_deadline (struct dma_fence *fence,ktime_t deadline) {/* Recurse once into a fence-array */ if (dma_fence_is_array (fence)) {
@@ -111,16 +112,16 @@ static void fence_set_priority(struct dma_fence *fence, int prio)int i;for (i =0 ; i < array->num_fences; i++) -__fence_set_priority (array->fences[i], prio); +__fence_set_deadline (array->fences[i], deadline); }else { -__fence_set_priority (fence, prio); +__fence_set_deadline (fence, deadline); } }int -i915_gem_object_wait_priority (struct drm_i915_gem_object *obj, +i915_gem_object_wait_deadline (struct drm_i915_gem_object *obj,unsigned int flags, -int prio) +ktime_t deadline) {struct dma_fence *excl;
@@ -135,7 +136,7 @@ i915_gem_object_wait_priority(struct drm_i915_gem_object *obj,return ret;for (i =0 ; i < count; i++) { -fence_set_priority (shared[i], prio); +fence_set_deadline (shared[i], deadline);dma_fence_put (shared[i]); }
@@ -145,7 +146,7 @@ i915_gem_object_wait_priority(struct drm_i915_gem_object *obj, }if (excl) { -fence_set_priority (excl, prio); +fence_set_deadline (excl, deadline);dma_fence_put (excl); }return 0 ;
drivers/gpu/drm/i915/i915_priolist_types.h +0 -3
@@ -20,9 +20,6 @@ enum {/* A preemptive pulse used to monitor the health of each engine */ I915_PRIORITY_HEARTBEAT , -/* Interactive workload, scheduled for immediate pageflipping */ -I915_PRIORITY_DISPLAY , - __I915_PRIORITY_KERNEL__ };
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 26/33 drm/i915: Move saturated workload detection to the GT
In reply to Chris WilsonWhen we introduced the saturated workload detection to tell us to back off from semaphore usage [semaphores have a noticeable impact on contended bus cycles with the CPU for some heavy workloads], we first introduced it as a per-context tracker. This allows individual contexts to try and optimise their own usage, but we found that with the local tracking and the no-semaphore boosting, the first context to disable semaphores got a massive priority boost and so would starve the rest and all new contexts (as they started with semaphores enabled and lower priority). Hence we moved the saturated workload detection to the engine, and a consequence had to disable semaphores on virtual engines.
Now that we do not have semaphore priority boosting, we can move the tracking to the GT and virtual engines can now utilise the faster inter-engine synchronisation, while maintaining the global information to back off on saturation.
References: 44d89409a12e ("drm/i915: Make the semaphore saturation mask global")
--- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 +- drivers/gpu/drm/i915/gt/intel_engine_types.h | 2 -- drivers/gpu/drm/i915/gt/intel_gt_types.h | 2 ++ drivers/gpu/drm/i915/gt/intel_lrc.c | 15 --------------- drivers/gpu/drm/i915/i915_request.c | 13 ++++++++----- 5 files changed, 11 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_pm.c +1 -1
@@ -230,7 +230,7 @@ static int __engine_park(struct intel_wakeref *wf)struct intel_engine_cs *engine =container_of (wf,typeof (*engine), wakeref); - engine->saturated =0 ; +clear_bit (engine->id, &engine->gt->saturated);/* * If one and only one request is completed between pm events,
drivers/gpu/drm/i915/gt/intel_engine_types.h +0 -2
@@ -319,8 +319,6 @@ struct intel_engine_cs {struct intel_context *kernel_context;/* pinned */ -intel_engine_mask_t saturated;/* submitting semaphores too late? */ -struct {struct delayed_work work;struct i915_request *systole;
drivers/gpu/drm/i915/gt/intel_gt_types.h +2 -0
@@ -74,6 +74,8 @@ struct intel_gt {*/ intel_wakeref_t awake; +unsigned long saturated;/* submitting semaphores too late? */ +u32 clock_frequency;struct intel_llc llc;
drivers/gpu/drm/i915/gt/intel_lrc.c +0 -15
@@ -5519,21 +5519,6 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings, ve->base.instance =I915_ENGINE_CLASS_INVALID_VIRTUAL ; ve->base.uabi_instance =I915_ENGINE_CLASS_INVALID_VIRTUAL ; -/* -* The decision on whether to submit a request using semaphores -* depends on the saturated state of the engine. We only compute -* this during HW submission of the request, and we need for this -* state to be globally applied to all requests being submitted -* to this engine. Virtual engines encompass more than one physical -* engine and so we cannot accurately tell in advance if one of those -* engines is already saturated and so cannot afford to use a semaphore -* and be pessimized in priority for doing so -- if we are the only -* context using semaphores after all other clients have stopped, we -* will be starved on the saturated system. Such a global switch for -* semaphores is less than ideal, but alas is the current compromise. -*/ - ve->base.saturated =ALL_ENGINES ; -snprintf (ve->base.name,sizeof (ve->base.name),"virtual" );intel_engine_init_active (&ve->base,ENGINE_VIRTUAL );
drivers/gpu/drm/i915/i915_request.c +8 -5
@@ -551,7 +551,7 @@ bool __i915_request_submit(struct i915_request *request)*/ if (request->sched.semaphores &&i915_sw_fence_signaled (&request->semaphore)) - engine->saturated |= request->sched.semaphores; +set_bit (engine->id, &engine->gt->saturated); engine->emit_fini_breadcrumb (request, request->ring->vaddr + request->postfix);
@@ -988,8 +988,7 @@ i915_request_await_start(struct i915_request *rq, struct i915_request *signal)return err; } -static intel_engine_mask_t -already_busywaiting (struct i915_request *rq) +static bool engine_saturated (struct intel_engine_cs *engine) {/* * Polling a semaphore causes bus traffic, delaying other users of
@@ -1003,7 +1002,7 @@ already_busywaiting(struct i915_request *rq)* * See the are-we-too-late? check in __i915_request_submit(). */ -return rq->sched.semaphores |READ_ONCE (rq->engine->saturated); +return engine->mask &READ_ONCE (engine->gt->saturated); } static int
@@ -1084,7 +1083,11 @@ emit_semaphore_wait(struct i915_request *to, goto await_fence;/* Just emit the first semaphore we see as request space is limited. */ -if (already_busywaiting (to) & mask) +if (to->sched.semaphores & mask) + goto await_fence; + +/* Don't over use semaphores, they may be fast but not free. */ +if (engine_saturated (to->engine)) goto await_fence;if (i915_request_await_start (to, from) <0 )
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 27/33 Restore "drm/i915: drop engine_pin/unpin_breadcrumbs_irq"
In reply to Chris WilsonThis was removed in commit 478ffad6d690 ("drm/i915: drop engine_pin/unpin_breadcrumbs_irq") as the last user had been removed, but now there is a promise of a new user in the next patch.
--- drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 22 +++++++++++++++++++++ drivers/gpu/drm/i915/gt/intel_engine.h | 3 +++ 2 files changed, 25 insertions(+)
drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +22 -0
@@ -220,6 +220,28 @@ static void signal_irq_work(struct irq_work *work) } } +void intel_engine_pin_breadcrumbs_irq (struct intel_engine_cs *engine) +{ +struct intel_breadcrumbs *b = &engine->breadcrumbs; + +spin_lock_irq (&b->irq_lock); +if (!b->irq_enabled++) +irq_enable (engine); +GEM_BUG_ON (!b->irq_enabled);/* no overflow! */ +spin_unlock_irq (&b->irq_lock); +} + +void intel_engine_unpin_breadcrumbs_irq (struct intel_engine_cs *engine) +{ +struct intel_breadcrumbs *b = &engine->breadcrumbs; + +spin_lock_irq (&b->irq_lock); +GEM_BUG_ON (!b->irq_enabled);/* no underflow! */ +if (!--b->irq_enabled) +irq_disable (engine); +spin_unlock_irq (&b->irq_lock); +} +static bool __intel_breadcrumbs_arm_irq (struct intel_breadcrumbs *b) { struct intel_engine_cs *engine =
drivers/gpu/drm/i915/gt/intel_engine.h +3 -0
@@ -226,6 +226,9 @@ void intel_engine_init_execlists(struct intel_engine_cs *engine);void intel_engine_init_breadcrumbs (struct intel_engine_cs *engine);void intel_engine_fini_breadcrumbs (struct intel_engine_cs *engine); +void intel_engine_pin_breadcrumbs_irq (struct intel_engine_cs *engine); +void intel_engine_unpin_breadcrumbs_irq (struct intel_engine_cs *engine); +void intel_engine_disarm_breadcrumbs (struct intel_engine_cs *engine); static inline void
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 28/33 drm/i915/gt: Couple tasklet scheduling for all CS interrupts
In reply to Chris WilsonIf any engine asks for the tasklet to be kicked from the CS interrupt, do so. Currently, this is used by the execlists scheduler backends to feed in the next request to the HW, and similarly could be used by a ring scheduler, as will be seen in the next patch.
--- drivers/gpu/drm/i915/gt/intel_gt_irq.c | 19 ++++++++++++++----- drivers/gpu/drm/i915/gt/intel_gt_irq.h | 3 +++ drivers/gpu/drm/i915/gt/intel_rps.c | 2 +- drivers/gpu/drm/i915/i915_irq.c | 8 ++++---- 4 files changed, 22 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt_irq.c +14 -5
@@ -60,6 +60,15 @@ cs_irq_handler(struct intel_engine_cs *engine, u32 iir)tasklet_hi_schedule (&engine->execlists.tasklet); } +void gen2_engine_cs_irq (struct intel_engine_cs *engine) +{ +if (!list_empty (&engine->breadcrumbs.signalers)) +intel_engine_signal_breadcrumbs (engine); + +if (intel_engine_needs_breadcrumb_tasklet (engine)) +tasklet_hi_schedule (&engine->execlists.tasklet); +} +static u32 gen11_gt_engine_identity (struct intel_gt *gt,const unsigned int bank,const unsigned int bit)
@@ -273,9 +282,9 @@ void gen11_gt_irq_postinstall(struct intel_gt *gt)void gen5_gt_irq_handler (struct intel_gt *gt,u32 gt_iir) {if (gt_iir >_RENDER_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (gt->engine_class[RENDER_CLASS ][0 ]); +gen2_engine_cs_irq (gt->engine_class[RENDER_CLASS ][0 ]);if (gt_iir &ILK_BSD_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (gt->engine_class[VIDEO_DECODE_CLASS ][0 ]); +gen2_engine_cs_irq (gt->engine_class[VIDEO_DECODE_CLASS ][0 ]); }static void gen7_parity_error_irq_handler (struct intel_gt *gt,u32 iir)
@@ -299,11 +308,11 @@ static void gen7_parity_error_irq_handler(struct intel_gt *gt, u32 iir)void gen6_gt_irq_handler (struct intel_gt *gt,u32 gt_iir) {if (gt_iir >_RENDER_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (gt->engine_class[RENDER_CLASS ][0 ]); +gen2_engine_cs_irq (gt->engine_class[RENDER_CLASS ][0 ]);if (gt_iir >_BSD_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (gt->engine_class[VIDEO_DECODE_CLASS ][0 ]); +gen2_engine_cs_irq (gt->engine_class[VIDEO_DECODE_CLASS ][0 ]);if (gt_iir >_BLT_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (gt->engine_class[COPY_ENGINE_CLASS ][0 ]); +gen2_engine_cs_irq (gt->engine_class[COPY_ENGINE_CLASS ][0 ]); if (gt_iir & (GT_BLT_CS_ERROR_INTERRUPT | GT_BSD_CS_ERROR_INTERRUPT |
drivers/gpu/drm/i915/gt/intel_gt_irq.h +3 -0
@@ -9,6 +9,7 @@#include <linux/types.h> +struct intel_engine_cs ;struct intel_gt ;#define GEN8_GT_IRQS (GEN8_GT_RCS_IRQ | \
@@ -19,6 +20,8 @@ struct intel_gt; GEN8_GT_PM_IRQ | \ GEN8_GT_GUC_IRQ) +void gen2_engine_cs_irq (struct intel_engine_cs *engine); +void gen11_gt_irq_reset (struct intel_gt *gt);void gen11_gt_irq_postinstall (struct intel_gt *gt);void gen11_gt_irq_handler (struct intel_gt *gt,const u32 master_ctl);
drivers/gpu/drm/i915/gt/intel_rps.c +1 -1
@@ -1740,7 +1740,7 @@ void gen6_rps_irq_handler(struct intel_rps *rps, u32 pm_iir)return ;if (pm_iir &PM_VEBOX_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (gt->engine[VECS0 ]); +gen2_engine_cs_irq (gt->engine[VECS0 ]);if (pm_iir &PM_VEBOX_CS_ERROR_INTERRUPT )DRM_DEBUG ("Command parser error, pm_iir 0x%08x\n" , pm_iir);
drivers/gpu/drm/i915/i915_irq.c +4 -4
@@ -3685,7 +3685,7 @@ static irqreturn_t i8xx_irq_handler(int irq, void *arg)intel_uncore_write16 (&dev_priv->uncore,GEN2_IIR , iir);if (iir &I915_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (dev_priv->gt.engine[RCS0 ]); +gen2_engine_cs_irq (dev_priv->gt.engine[RCS0 ]);if (iir &I915_MASTER_ERROR_INTERRUPT )i8xx_error_irq_handler (dev_priv, eir, eir_stuck);
@@ -3790,7 +3790,7 @@ static irqreturn_t i915_irq_handler(int irq, void *arg)I915_WRITE (GEN2_IIR , iir);if (iir &I915_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (dev_priv->gt.engine[RCS0 ]); +gen2_engine_cs_irq (dev_priv->gt.engine[RCS0 ]);if (iir &I915_MASTER_ERROR_INTERRUPT )i9xx_error_irq_handler (dev_priv, eir, eir_stuck);
@@ -3932,10 +3932,10 @@ static irqreturn_t i965_irq_handler(int irq, void *arg)I915_WRITE (GEN2_IIR , iir);if (iir &I915_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (dev_priv->gt.engine[RCS0 ]); +gen2_engine_cs_irq (dev_priv->gt.engine[RCS0 ]);if (iir &I915_BSD_USER_INTERRUPT ) -intel_engine_signal_breadcrumbs (dev_priv->gt.engine[VCS0 ]); +gen2_engine_cs_irq (dev_priv->gt.engine[VCS0 ]);if (iir &I915_MASTER_ERROR_INTERRUPT )i9xx_error_irq_handler (dev_priv, eir, eir_stuck);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 29/33 drm/i915/gt: Support creation of 'internal' rings
In reply to Chris WilsonTo support legacy ring buffer scheduling, we want a virtual ringbuffer for each client. These rings are purely for holding the requests as they are being constructed on the CPU and never accessed by the GPU, so they should not be bound into the GGTT, and we can use plain old WB mapped pages.
As they are not bound, we need to nerf a few assumptions that a rq->ring is in the GGTT.
--- drivers/gpu/drm/i915/gt/intel_context.c | 2 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 17 ++---- drivers/gpu/drm/i915/gt/intel_ring.c | 63 ++++++++++++++-------- drivers/gpu/drm/i915/gt/intel_ring.h | 12 ++++- drivers/gpu/drm/i915/gt/intel_ring_types.h | 2 + 5 files changed, 57 insertions(+), 39 deletions(-)
drivers/gpu/drm/i915/gt/intel_context.c +1 -1
@@ -127,7 +127,7 @@ int __intel_context_do_pin(struct intel_context *ce) goto err_active;CE_TRACE (ce,"pin ring:{start:%08x, head:%04x, tail:%04x}\n" , -i915_ggtt_offset (ce->ring->vma), +intel_ring_address (ce->ring), ce->ring->head, ce->ring->tail);smp_mb__before_atomic ();/* flush pin before it is visible */
drivers/gpu/drm/i915/gt/intel_engine_cs.c +3 -14
@@ -1267,7 +1267,7 @@ static int print_ring(char *buf, int sz, struct i915_request *rq) len = scnprintf(buf, sz, "ring:{start:%08x, hwsp:%08x, seqno:%08x, runtime:%llums}, ", - i915_ggtt_offset(rq->ring->vma), + intel_ring_address(rq->ring), tl ? tl->hwsp_offset : 0, hwsp_seqno(rq), DIV_ROUND_CLOSEST_ULL(intel_context_get_total_runtime_ns(rq->context),
@@ -1559,7 +1559,7 @@ void intel_engine_dump(struct intel_engine_cs *engine,print_request (m, rq,"\t\tactive " );drm_printf (m,"\t\tring->start: 0x%08x\n" , -i915_ggtt_offset (rq->ring->vma)); +intel_ring_address (rq->ring));drm_printf (m,"\t\tring->head: 0x%08x\n" , rq->ring->head); drm_printf(m, "\t\tring->tail: 0x%08x\n",
@@ -1640,13 +1640,6 @@ ktime_t intel_engine_get_busy_time(struct intel_engine_cs *engine, ktime_t *now)return total; } -static bool match_ring (struct i915_request *rq) -{ -u32 ring =ENGINE_READ (rq->engine,RING_START ); - -return ring ==i915_ggtt_offset (rq->ring->vma); -} -struct i915_request *intel_engine_find_active_request (struct intel_engine_cs *engine) {
@@ -1686,11 +1679,7 @@ intel_engine_find_active_request(struct intel_engine_cs *engine)continue ;if (!i915_request_started (request)) -continue ; - -/* More than one preemptible request may match! */ -if (!match_ring (request)) -continue ; +break ; active = request;break ;
drivers/gpu/drm/i915/gt/intel_ring.c +40 -23
121 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_ring.h +11 -1
@@ -9,12 +9,14 @@#include "i915_gem.h" /* GEM_BUG_ON */ #include "i915_request.h" +#include "i915_vma.h" #include "intel_ring_types.h" struct intel_engine_cs ;struct intel_ring * -intel_engine_create_ring (struct intel_engine_cs *engine,int size); +intel_engine_create_ring (struct intel_engine_cs *engine,unsigned int size); +#define INTEL_RING_CREATE_INTERNAL BIT(0)u32 *intel_ring_begin (struct i915_request *rq,unsigned int num_dwords);int intel_ring_cacheline_align (struct i915_request *rq);
@@ -137,4 +139,12 @@ __intel_ring_space(unsigned int head, unsigned int tail, unsigned int size) return (head - tail - CACHELINE_BYTES) & (size - 1); } +static inline u32 intel_ring_address (const struct intel_ring *ring) +{ +if (ring->flags &INTEL_RING_CREATE_INTERNAL ) +return -1 ; + +return i915_ggtt_offset (ring->vma); +} +#endif /* INTEL_RING_H */
drivers/gpu/drm/i915/gt/intel_ring_types.h +2 -0
@@ -47,6 +47,8 @@ struct intel_ring {u32 size;u32 wrap;u32 effective_size; + + unsigned long flags; };#endif /* INTEL_RING_TYPES_H */
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 30/33 drm/i915/gt: Use client timeline address for seqno writes
In reply to Chris WilsonIf we allow for per-client timelines, even with legacy ring submission, we open the door to a world full of possiblities [scheduling and semaphores].
--- drivers/gpu/drm/i915/gt/gen6_engine_cs.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/gt/gen6_engine_cs.c +9 -12
@@ -373,11 +373,10 @@ u32 *gen7_emit_breadcrumb_rcs(struct i915_request *rq, u32 *cs)u32 *gen6_emit_breadcrumb_xcs (struct i915_request *rq,u32 *cs) { -GEM_BUG_ON (i915_request_active_timeline (rq)->hwsp_ggtt != rq->engine->status_page.vma); -GEM_BUG_ON (offset_in_page (i915_request_active_timeline (rq)->hwsp_offset) !=I915_GEM_HWS_SEQNO_ADDR ); +u32 addr =i915_request_active_timeline (rq)->hwsp_offset; - *cs++ =MI_FLUSH_DW |MI_FLUSH_DW_OP_STOREDW |MI_FLUSH_DW_STORE_INDEX ; - *cs++ =I915_GEM_HWS_SEQNO_ADDR |MI_FLUSH_DW_USE_GTT ; + *cs++ =MI_FLUSH_DW |MI_FLUSH_DW_OP_STOREDW ; + *cs++ = addr |MI_FLUSH_DW_USE_GTT ; *cs++ = rq->fence.seqno; *cs++ =MI_USER_INTERRUPT ;
@@ -391,19 +390,17 @@ u32 *gen6_emit_breadcrumb_xcs(struct i915_request *rq, u32 *cs)#define GEN7_XCS_WA 32u32 *gen7_emit_breadcrumb_xcs (struct i915_request *rq,u32 *cs) { +u32 addr =i915_request_active_timeline (rq)->hwsp_offset;int i; -GEM_BUG_ON (i915_request_active_timeline (rq)->hwsp_ggtt != rq->engine->status_page.vma); -GEM_BUG_ON (offset_in_page (i915_request_active_timeline (rq)->hwsp_offset) !=I915_GEM_HWS_SEQNO_ADDR ); - - *cs++ =MI_FLUSH_DW |MI_INVALIDATE_TLB | -MI_FLUSH_DW_OP_STOREDW |MI_FLUSH_DW_STORE_INDEX ; - *cs++ =I915_GEM_HWS_SEQNO_ADDR |MI_FLUSH_DW_USE_GTT ; + *cs++ =MI_FLUSH_DW |MI_FLUSH_DW_OP_STOREDW ; + *cs++ = addr |MI_FLUSH_DW_USE_GTT ; *cs++ = rq->fence.seqno;for (i =0 ; i <GEN7_XCS_WA ; i++) { - *cs++ =MI_STORE_DWORD_INDEX ; - *cs++ =I915_GEM_HWS_SEQNO_ADDR ; + *cs++ =MI_STORE_DWORD_IMM_GEN4 |MI_USE_GGTT ; + *cs++ =0 ; + *cs++ = addr; *cs++ = rq->fence.seqno; }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 31/33 drm/i915/gt: Infrastructure for ring scheduling
In reply to Chris WilsonBuild a bare bones scheduler to sit on top the global legacy ringbuffer submission. This virtual execlists scheme should be applicable to all older platforms.
A key problem we have with the legacy ring buffer submission is that it only allows for FIFO queuing. All clients share the global request queue and must contend for its lock when submitting. As any client may need to wait for external events, all clients must then wait. However, if we stage each client into their own virtual ringbuffer with their own timelines, we can copy the client requests into the global ringbuffer only when they are ready, reordering the submission around stalls. Furthermore, the ability to reorder gives us rudimentarily priority sorting -- although without preemption support, once something is on the GPU it stays on the GPU, and so it is still possible for a hog to delay a high priority request (such as updating the display). However, it does means that in keeping a short submission queue, the high priority request will be next. This design resembles the old guc submission scheduler, for reordering requests onto a global workqueue.
The implementation uses the MI_USER_INTERRUPT at the end of every request to track completion, so is more interrupt happy than execlists [which has an interrupt for each context event, albeit two]. Our interrupts on these system are relatively heavy, and in the past we have been able to completely starve Sandybrige by the interrupt traffic. Our interrupt handlers are being much better (in part offloading the work to bottom halves leaving the interrupt itself only dealing with acking the registers) but we can still see the impact of starvation in the uneven submission latency on a saturated system.
Overall though, the short sumission queues and extra interrupts do not appear to be affecting throughput (+-10%, some tasks even improve to the reduced request overheads) and improve latency. [Which is a massive improvement since the introduction of Sandybridge!]
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/gt/intel_engine.h | 1 + drivers/gpu/drm/i915/gt/intel_engine_types.h | 1 + .../gpu/drm/i915/gt/intel_ring_scheduler.c | 736 ++++++++++++++++++ .../gpu/drm/i915/gt/intel_ring_submission.c | 13 +- .../gpu/drm/i915/gt/intel_ring_submission.h | 16 + 6 files changed, 762 insertions(+), 6 deletions(-) create mode 100644 drivers/gpu/drm/i915/gt/intel_ring_scheduler.c create mode 100644 drivers/gpu/drm/i915/gt/intel_ring_submission.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -109,6 +109,7 @@ gt-y += \ gt/intel_renderstate.o \ gt/intel_reset.o \ gt/intel_ring.o \ + gt/intel_ring_scheduler.o \ gt/intel_ring_submission.o \ gt/intel_rps.o \ gt/intel_sseu.o \
drivers/gpu/drm/i915/gt/intel_engine.h +1 -0
@@ -209,6 +209,7 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine);int intel_engine_resume (struct intel_engine_cs *engine);int intel_ring_submission_setup (struct intel_engine_cs *engine); +int intel_ring_scheduler_setup (struct intel_engine_cs *engine);int intel_engine_stop_cs (struct intel_engine_cs *engine);void intel_engine_cancel_stop_cs (struct intel_engine_cs *engine);
drivers/gpu/drm/i915/gt/intel_engine_types.h +1 -0
@@ -334,6 +334,7 @@ struct intel_engine_cs {struct {struct intel_ring *ring;struct intel_timeline *timeline; +struct intel_context *context; } legacy;/*
drivers/gpu/drm/i915/gt/intel_ring_scheduler.c new file +736 -0
736 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_ring_submission.c +7 -6
@@ -36,6 +36,7 @@#include "intel_gt.h" #include "intel_reset.h" #include "intel_ring.h" +#include "intel_ring_submission.h" #include "shmem_utils.h" /* Rough estimate of the typical request size, performing a flush,
@@ -214,7 +215,7 @@ static void set_pp_dir(struct intel_engine_cs *engine) } } -static int xcs_resume (struct intel_engine_cs *engine) +int intel_ring_submission_resume (struct intel_engine_cs *engine) {struct drm_i915_private *dev_priv = engine->i915;struct intel_ring *ring = engine->legacy.ring;
@@ -318,7 +319,7 @@ static int xcs_resume(struct intel_engine_cs *engine)return ret; } -static void reset_prepare (struct intel_engine_cs *engine) +void intel_ring_submission_reset_prepare (struct intel_engine_cs *engine) {struct intel_uncore *uncore = engine->uncore;const u32 base = engine->mmio_base;
@@ -425,7 +426,7 @@ static void reset_rewind(struct intel_engine_cs *engine, bool stalled)spin_unlock_irqrestore (&engine->active.lock, flags); } -static void reset_finish (struct intel_engine_cs *engine) +void intel_ring_submission_reset_finish (struct intel_engine_cs *engine) { }
@@ -1056,11 +1057,11 @@ static void setup_common(struct intel_engine_cs *engine)setup_irq (engine); - engine->resume = xcs_resume; - engine->reset.prepare = reset_prepare; + engine->resume = intel_ring_submission_resume; + engine->reset.prepare = intel_ring_submission_reset_prepare; engine->reset.rewind = reset_rewind; engine->reset.cancel = reset_cancel; - engine->reset.finish = reset_finish; + engine->reset.finish = intel_ring_submission_reset_finish; engine->cops = &ring_context_ops; engine->request_alloc = ring_request_alloc;
drivers/gpu/drm/i915/gt/intel_ring_submission.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2020 Intel Corporation +*/ + +#ifndef __INTEL_RING_SUBMISSION_H__ +#define __INTEL_RING_SUBMISSION_H__ + +struct intel_engine_cs ; + +void intel_ring_submission_reset_prepare (struct intel_engine_cs *engine); +void intel_ring_submission_reset_finish (struct intel_engine_cs *engine); + +int intel_ring_submission_resume (struct intel_engine_cs *engine); + +#endif /* __INTEL_RING_SUBMISSION_H__ */
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
kernel test robot
build botRe: [Intel-gfx] [PATCH 31/33] drm/i915/gt: Infrastructure for ring scheduling
Thank you for the patch! Perhaps something to improve:
Hi Chris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip]
[cannot apply to v5.8-rc3 next-20200701]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chris-Wilson/drm-i915-gt-Harden-the-heartbeat-against-a-stuck-driver/20200701-164638 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: x86_64-allyesconfig (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project c8f1d442d0858f66fd4128fde6f67eb5202fa2b1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/i915/gt/intel_ring_scheduler.c:44:42: warning: implicit conversion from 'u64' (aka 'unsigned long long') to 'int' changes value from 18446744073709551615 to -1 [-Wconstant-conversion]
return rb ? to_priolist(rb)->deadline : I915_DEADLINE_NEVER;
~~~~~~ ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_scheduler_types.h:87:29: note: expanded from macro 'I915_DEADLINE_NEVER'
#define I915_DEADLINE_NEVER U64_MAX
^~~~~~~
include/linux/limits.h:22:19: note: expanded from macro 'U64_MAX'
#define U64_MAX ((u64)~0ULL)
^~~~~~~~~~
drivers/gpu/drm/i915/gt/intel_ring_scheduler.c:42:19: warning: unused function 'queue_deadline' [-Wunused-function]
static inline int queue_deadline(struct rb_node *rb)
^
>> drivers/gpu/drm/i915/gt/intel_ring_scheduler.c:47:20: warning: function 'reset_in_progress' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static inline bool reset_in_progress(const struct intel_engine_execlists *el)
^
drivers/gpu/drm/i915/gt/intel_ring_scheduler.c:115:20: warning: unused function 'ring_map_dw' [-Wunused-function]
static inline u32 *ring_map_dw(struct intel_ring *ring, u32 len)
^4 warnings generated.
vim +44 drivers/gpu/drm/i915/gt/intel_ring_scheduler.c
41
> 42 static inline int queue_deadline(struct rb_node *rb)
43 {
> 44 return rb ? to_priolist(rb)->deadline : I915_DEADLINE_NEVER;
45 }
46
> 47 static inline bool reset_in_progress(const struct intel_engine_execlists *el)
48 {
49 return unlikely(!__tasklet_is_enabled(&el->tasklet));
50 }
51 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
PATCH 32/33 drm/i915/gt: Implement ring scheduler for gen6/7
In reply to Chris WilsonA key prolem with legacy ring buffer submission is that it is an inheret FIFO queue across all clients; if one blocks, they all block. A scheduler allows us to avoid that limitation, and ensures that all clients can submit in parallel, removing the resource contention of the global ringbuffer.
Having built the ring scheduler infrastructure over top of the global ringbuffer submission, we now need to provide the HW knowledge required to build command packets and implement context switching.
--- .../gpu/drm/i915/gt/intel_ring_scheduler.c | 423 +++++++++++++++++- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 421 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/intel_ring_scheduler.c +420 -3
@@ -7,6 +7,10 @@#include <drm/i915_drm.h> +#include "gen2_engine_cs.h" +#include "gen6_engine_cs.h" +#include "gen6_ppgtt.h" +#include "gen7_renderclear.h" #include "i915_drv.h" #include "intel_context.h" #include "intel_engine_stats.h"
@@ -139,8 +143,258 @@ static void ring_copy(struct intel_ring *dst,memcpy (out, src->vaddr + start, end - start); } +static void mi_set_context (struct intel_ring *ring, +struct intel_engine_cs *engine, +struct intel_context *ce, +u32 flags) +{ +struct drm_i915_private *i915 = engine->i915; +enum intel_engine_id id; +const int num_engines = +IS_HASWELL (i915) ?RUNTIME_INFO (i915)->num_engines -1 :0 ; +int len; +u32 *cs; + + len =4 ; +if (IS_GEN (i915,7 )) + len +=2 + (num_engines ?4 * num_engines +6 :0 ); +else if (IS_GEN (i915,5 )) + len +=2 ; + + cs =ring_map_dw (ring, len); + +/* WaProgramMiArbOnOffAroundMiSetContext:ivb,vlv,hsw,bdw,chv */ +if (IS_GEN (i915,7 )) { + *cs++ =MI_ARB_ON_OFF |MI_ARB_DISABLE ; +if (num_engines) { +struct intel_engine_cs *signaller; + + *cs++ =MI_LOAD_REGISTER_IMM (num_engines); +for_each_engine (signaller, engine->gt, id) { +if (signaller == engine) +continue ; + + *cs++ =i915_mmio_reg_offset ( +RING_PSMI_CTL (signaller->mmio_base)); + *cs++ =_MASKED_BIT_ENABLE ( +GEN6_PSMI_SLEEP_MSG_DISABLE ); + } + } + }else if (IS_GEN (i915,5 )) { +/* +* This w/a is only listed for pre-production ilk a/b steppings, +* but is also mentioned for programming the powerctx. To be +* safe, just apply the workaround; we do not use SyncFlush so +* this should never take effect and so be a no-op! +*/ + *cs++ =MI_SUSPEND_FLUSH |MI_SUSPEND_FLUSH_EN ; + } + + *cs++ =MI_NOOP ; + *cs++ =MI_SET_CONTEXT ; + *cs++ =i915_ggtt_offset (ce->state) | flags; +/* +* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP +* WaMiSetContext_Hang:snb,ivb,vlv +*/ + *cs++ =MI_NOOP ; + +if (IS_GEN (i915,7 )) { +if (num_engines) { +struct intel_engine_cs *signaller; +i915_reg_t last_reg = {};/* keep gcc quiet */ + + *cs++ =MI_LOAD_REGISTER_IMM (num_engines); +for_each_engine (signaller, engine->gt, id) { +if (signaller == engine) +continue ; + + last_reg =RING_PSMI_CTL (signaller->mmio_base); + *cs++ =i915_mmio_reg_offset (last_reg); + *cs++ =_MASKED_BIT_DISABLE ( +GEN6_PSMI_SLEEP_MSG_DISABLE ); + } + +/* Insert a delay before the next switch! */ + *cs++ =MI_STORE_REGISTER_MEM |MI_SRM_LRM_GLOBAL_GTT ; + *cs++ =i915_mmio_reg_offset (last_reg); + *cs++ =intel_gt_scratch_offset (engine->gt, +INTEL_GT_SCRATCH_FIELD_DEFAULT ); + *cs++ =MI_NOOP ; + } + *cs++ =MI_ARB_ON_OFF |MI_ARB_ENABLE ; + }else if (IS_GEN (i915,5 )) { + *cs++ =MI_SUSPEND_FLUSH ; + } +} + +static struct i915_address_space *vm_alias (struct i915_address_space *vm) +{ +if (i915_is_ggtt (vm)) + vm = &i915_vm_to_ggtt (vm)->alias->vm; + +return vm; +} + +static void load_pd_dir (struct intel_ring *ring, +struct intel_engine_cs *engine, +const struct i915_ppgtt *ppgtt) +{ +u32 *cs =ring_map_dw (ring,10 ); + + *cs++ =MI_LOAD_REGISTER_IMM (1 ); + *cs++ =i915_mmio_reg_offset (RING_PP_DIR_DCLV (engine->mmio_base)); + *cs++ =PP_DIR_DCLV_2G ; + + *cs++ =MI_LOAD_REGISTER_IMM (1 ); + *cs++ =i915_mmio_reg_offset (RING_PP_DIR_BASE (engine->mmio_base)); + *cs++ =px_base (ppgtt->pd)->ggtt_offset <<10 ; + +/* Stall until the page table load is complete? */ + *cs++ =MI_STORE_REGISTER_MEM |MI_SRM_LRM_GLOBAL_GTT ; + *cs++ =i915_mmio_reg_offset (RING_PP_DIR_BASE (engine->mmio_base)); + *cs++ =intel_gt_scratch_offset (engine->gt, +INTEL_GT_SCRATCH_FIELD_DEFAULT ); + *cs++ =MI_NOOP ; +} + +static struct i915_address_space *current_vm (struct intel_engine_cs *engine) +{ +struct intel_context *old = engine->legacy.context; + +return old ?vm_alias (old->vm) :NULL ; +} + +static void gen6_emit_invalidate_rcs (struct intel_ring *ring, +struct intel_engine_cs *engine) +{ +u32 addr, flags; +u32 *cs; + + addr =intel_gt_scratch_offset (engine->gt, +INTEL_GT_SCRATCH_FIELD_RENDER_FLUSH ); + + flags =PIPE_CONTROL_QW_WRITE |PIPE_CONTROL_CS_STALL ; + flags |=PIPE_CONTROL_TLB_INVALIDATE ; + +if (INTEL_GEN (engine->i915) >=7 ) + flags |=PIPE_CONTROL_GLOBAL_GTT_IVB ; +else + addr |=PIPE_CONTROL_GLOBAL_GTT ; + + cs =ring_map_dw (ring,4 ); + *cs++ =GFX_OP_PIPE_CONTROL (4 ); + *cs++ = flags; + *cs++ = addr; + *cs++ =0 ; +} + +static struct i915_address_space * +clear_residuals (struct intel_ring *ring,struct intel_engine_cs *engine) +{ +struct intel_context *ce = engine->kernel_context; +struct i915_address_space *vm =vm_alias (engine->gt->vm); +u32 flags; + +if (vm !=current_vm (engine)) +load_pd_dir (ring, engine,i915_vm_to_ppgtt (vm)); + +if (ce->state) +mi_set_context (ring, engine, ce, +MI_MM_SPACE_GTT |MI_RESTORE_INHIBIT ); + +if (IS_HASWELL (engine->i915)) + flags =MI_BATCH_PPGTT_HSW |MI_BATCH_NON_SECURE_HSW ; +else + flags =MI_BATCH_NON_SECURE_I965 ; + +__gen6_emit_bb_start (ring_map_dw (ring,2 ), + engine->wa_ctx.vma->node.start, flags); + +return vm; +} + +static void remap_l3_slice (struct intel_ring *ring, +struct intel_engine_cs *engine, +int slice) +{ +u32 *cs, *remap_info = engine->i915->l3_parity.remap_info[slice]; +int i; + +if (!remap_info) +return ; + +/* +* Note: We do not worry about the concurrent register cacheline hang +* here because no other code should access these registers other than +* at initialization time. +*/ + cs =ring_map_dw (ring,GEN7_L3LOG_SIZE /4 *2 +2 ); + *cs++ =MI_LOAD_REGISTER_IMM (GEN7_L3LOG_SIZE /4 ); +for (i =0 ; i <GEN7_L3LOG_SIZE /4 ; i++) { + *cs++ =i915_mmio_reg_offset (GEN7_L3LOG (slice, i)); + *cs++ = remap_info[i]; + } + *cs++ =MI_NOOP ; +} + +static void remap_l3 (struct intel_ring *ring, +struct intel_engine_cs *engine, +struct intel_context *ce) +{ +struct i915_gem_context *ctx = +rcu_dereference_protected (ce->gem_context, true); +int bit, idx =-1 ; + +if (!ctx || !ctx->remap_slice) +return ; + +do { + bit =ffs (ctx->remap_slice); +remap_l3_slice (ring, engine, idx += bit); + }while (ctx->remap_slice >>= bit); +} +static void switch_context (struct intel_ring *ring,struct i915_request *rq) { +struct intel_engine_cs *engine = rq->engine; +struct i915_address_space *cvm =current_vm (engine); +struct intel_context *ce = rq->context; +struct i915_address_space *vm; + +if (engine->wa_ctx.vma && ce != engine->kernel_context) { +if (engine->wa_ctx.vma->private != ce) { + cvm =clear_residuals (ring, engine); +intel_context_put (engine->wa_ctx.vma->private); + engine->wa_ctx.vma->private =intel_context_get (ce); + } + } + + vm =vm_alias (ce->vm); +if (vm != cvm) +load_pd_dir (ring, engine,i915_vm_to_ppgtt (vm)); + +if (ce->state) { +u32 flags; + +GEM_BUG_ON (engine->id !=RCS0 ); + +/* For resource streamer on HSW+ and power context elsewhere */ +BUILD_BUG_ON (HSW_MI_RS_SAVE_STATE_EN !=MI_SAVE_EXT_STATE_EN ); +BUILD_BUG_ON (HSW_MI_RS_RESTORE_STATE_EN !=MI_RESTORE_EXT_STATE_EN ); + + flags =MI_SAVE_EXT_STATE_EN |MI_MM_SPACE_GTT ; +if (test_bit (CONTEXT_VALID_BIT , &ce->flags)) { +gen6_emit_invalidate_rcs (ring, engine); + flags |=MI_RESTORE_EXT_STATE_EN ; + }else { + flags |=MI_RESTORE_INHIBIT ; + } + +mi_set_context (ring, engine, ce, flags); + } + +remap_l3 (ring, engine, ce); }static struct i915_request *ring_submit (struct i915_request *rq)
@@ -167,6 +421,15 @@ copy_active(struct i915_request **port, struct i915_request * const *active)return port; } +static void write_tail (struct intel_engine_cs *engine,u32 tail) +{ +/* Clear the context id. Here be magic! */ +if (engine->fw_domain) +ENGINE_WRITE_FW (engine,RING_RNCID ,0 ); + +ENGINE_WRITE (engine,RING_TAIL , tail); +} +static void dequeue (struct intel_engine_cs *engine) {struct intel_engine_execlists *const el = &engine->execlists;
@@ -211,7 +474,7 @@ static void dequeue(struct intel_engine_cs *engine)WRITE_ONCE (el->active, el->pending);wmb ();/* paranoid flush of WCB before RING_TAIL write */ -ENGINE_WRITE (engine,RING_TAIL , engine->legacy.ring->tail); +write_tail (engine, engine->legacy.ring->tail);memcpy (el->inflight, el->pending, (port - el->pending +1 ) *sizeof (*port));
@@ -421,6 +684,33 @@ static void submission_unpark(struct intel_engine_cs *engine)intel_engine_pin_breadcrumbs_irq (engine); } +static int gen4_emit_init_breadcrumb (struct i915_request *rq) +{ +struct intel_timeline *tl =i915_request_timeline (rq); +u32 *cs; + +GEM_BUG_ON (i915_request_has_initial_breadcrumb (rq)); +if (!tl->has_initial_breadcrumb) +return 0 ; + + cs =intel_ring_begin (rq,4 ); +if (IS_ERR (cs)) +return PTR_ERR (cs); + + *cs++ =MI_STORE_DWORD_IMM_GEN4 |MI_USE_GGTT ; + *cs++ =0 ; + *cs++ = tl->hwsp_offset; + *cs++ = rq->fence.seqno -1 ; + +intel_ring_advance (rq, cs); + +/* Record the updated position of the request's payload */ + rq->infix =intel_ring_offset (rq, cs); + +__set_bit (I915_FENCE_FLAG_INITIAL_BREADCRUMB , &rq->fence.flags); +return 0 ; +} +static void ring_context_destroy (struct kref *ref) {struct intel_context *ce =container_of (ref,typeof (*ce), ref);
@@ -436,8 +726,30 @@ static void ring_context_destroy(struct kref *ref)intel_context_free (ce); } +static int __context_pin_ppgtt (struct intel_context *ce) +{ +struct i915_address_space *vm; +int err =0 ; + + vm =vm_alias (ce->vm); +if (vm) + err =gen6_ppgtt_pin (i915_vm_to_ppgtt ((vm))); + +return err; +} + +static void __context_unpin_ppgtt (struct intel_context *ce) +{ +struct i915_address_space *vm; + + vm =vm_alias (ce->vm); +if (vm) +gen6_ppgtt_unpin (i915_vm_to_ppgtt (vm)); +} +static void ring_context_unpin (struct intel_context *ce) { +__context_unpin_ppgtt (ce); }static int alloc_context_vma (struct intel_context *ce)
@@ -565,7 +877,7 @@ static int ring_context_alloc(struct intel_context *ce)static int ring_context_pin (struct intel_context *ce) { -return 0 ; +return __context_pin_ppgtt (ce); }static void ring_context_reset (struct intel_context *ce)
@@ -621,12 +933,19 @@ static void ring_release(struct intel_engine_cs *engine)set_current_context (&engine->legacy.context,NULL ); +if (engine->wa_ctx.vma) { +intel_context_put (engine->wa_ctx.vma->private); +i915_vma_unpin_and_release (&engine->wa_ctx.vma,0 ); + } +intel_ring_unpin (engine->legacy.ring);intel_ring_put (engine->legacy.ring); }static void setup_irq (struct intel_engine_cs *engine) { + engine->irq_enable = gen6_irq_enable; + engine->irq_disable = gen6_irq_disable; }static void setup_common (struct intel_engine_cs *engine)
@@ -635,7 +954,7 @@ static void setup_common(struct intel_engine_cs *engine)/* gen8+ are only supported with execlists */ GEM_BUG_ON (INTEL_GEN (i915) >=8 ); -GEM_BUG_ON (INTEL_GEN (i915) <8 ); +GEM_BUG_ON (INTEL_GEN (i915) <6 );setup_irq (engine);
@@ -651,24 +970,62 @@ static void setup_common(struct intel_engine_cs *engine) engine->cops = &ring_context_ops; engine->request_alloc = ring_request_alloc; + engine->emit_init_breadcrumb = gen4_emit_init_breadcrumb; +if (INTEL_GEN (i915) >=7 ) + engine->emit_fini_breadcrumb = gen7_emit_breadcrumb_xcs; +else if (INTEL_GEN (i915) >=6 ) + engine->emit_fini_breadcrumb = gen6_emit_breadcrumb_xcs; +else + engine->emit_fini_breadcrumb = gen3_emit_breadcrumb; + engine->set_default_submission = set_default_submission; + + engine->emit_bb_start = gen6_emit_bb_start; }static void setup_rcs (struct intel_engine_cs *engine) { +struct drm_i915_private *i915 = engine->i915; + +if (HAS_L3_DPF (i915)) + engine->irq_keep_mask =GT_RENDER_L3_PARITY_ERROR_INTERRUPT ; + + engine->irq_enable_mask =GT_RENDER_USER_INTERRUPT ; + +if (INTEL_GEN (i915) >=7 ) { + engine->emit_flush = gen7_emit_flush_rcs; + engine->emit_fini_breadcrumb = gen7_emit_breadcrumb_rcs; +if (IS_HASWELL (i915)) + engine->emit_bb_start = hsw_emit_bb_start; + }else { + engine->emit_flush = gen6_emit_flush_rcs; + engine->emit_fini_breadcrumb = gen6_emit_breadcrumb_rcs; + } }static void setup_vcs (struct intel_engine_cs *engine) { + engine->emit_flush = gen6_emit_flush_vcs; + engine->irq_enable_mask =GT_BSD_USER_INTERRUPT ; + +if (IS_GEN (engine->i915,6 )) + engine->fw_domain =FORCEWAKE_ALL ; }static void setup_bcs (struct intel_engine_cs *engine) { + engine->emit_flush = gen6_emit_flush_xcs; + engine->irq_enable_mask =GT_BLT_USER_INTERRUPT ; }static void setup_vecs (struct intel_engine_cs *engine) {GEM_BUG_ON (!IS_HASWELL (engine->i915)); + + engine->emit_flush = gen6_emit_flush_xcs; + engine->irq_enable_mask =PM_VEBOX_USER_INTERRUPT ; + engine->irq_enable = hsw_irq_enable_vecs; + engine->irq_disable = hsw_irq_disable_vecs; }static unsigned int global_ring_size (void )
@@ -677,6 +1034,58 @@ static unsigned int global_ring_size(void)return roundup_pow_of_two (EXECLIST_MAX_PORTS *SZ_16K +SZ_4K ); } +static int gen7_ctx_switch_bb_init (struct intel_engine_cs *engine) +{ +struct drm_i915_gem_object *obj; +struct i915_vma *vma; +int size; +int err; + + size =gen7_setup_clear_gpr_bb (engine,NULL /* probe size */ ); +if (size <=0 ) +return size; + + size =ALIGN (size,PAGE_SIZE ); + obj =i915_gem_object_create_internal (engine->i915, size); +if (IS_ERR (obj)) +return PTR_ERR (obj); + + vma =i915_vma_instance (obj, engine->gt->vm,NULL ); +if (IS_ERR (vma)) { + err =PTR_ERR (vma); + goto err_obj; + } + + vma->private =intel_context_create (engine);/* dummy residuals */ +if (IS_ERR (vma->private)) { + err =PTR_ERR (vma->private); + goto err_obj; + } + + err =i915_vma_pin (vma,0 ,0 ,PIN_USER |PIN_HIGH ); +if (err) + goto err_private; + + err =i915_vma_sync (vma); +if (err) + goto err_unpin; + + size =gen7_setup_clear_gpr_bb (engine, vma); +if (err) + goto err_unpin; + + engine->wa_ctx.vma = vma; +return 0 ; + +err_unpin: +i915_vma_unpin (vma); +err_private: +intel_context_put (vma->private); +err_obj: +i915_gem_object_put (obj); +return err; +} +int intel_ring_scheduler_setup (struct intel_engine_cs *engine) {struct intel_ring *ring;
@@ -720,6 +1129,12 @@ int intel_ring_scheduler_setup(struct intel_engine_cs *engine)GEM_BUG_ON (engine->legacy.ring); engine->legacy.ring = ring; +if (IS_HASWELL (engine->i915) && engine->class ==RENDER_CLASS ) { + err =gen7_ctx_switch_bb_init (engine); +if (err) + goto err_ring_unpin; + } + engine->flags |=I915_ENGINE_HAS_SCHEDULER ; engine->flags |=I915_ENGINE_NEEDS_BREADCRUMB_TASKLET ; engine->flags |=I915_ENGINE_SUPPORTS_STATS ;
@@ -728,6 +1143,8 @@ int intel_ring_scheduler_setup(struct intel_engine_cs *engine) engine->release = ring_release;return 0 ; +err_ring_unpin: +intel_ring_unpin (ring); err_ring:intel_ring_put (ring); err:
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2522,6 +2522,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define RESET_CTL_CAT_ERROR REG_BIT(2)#define RESET_CTL_READY_TO_RESET REG_BIT(1)#define RESET_CTL_REQUEST_RESET REG_BIT(0) +#define RING_RNCID (base) _MMIO((base) + 0x198)#define RING_SEMA_WAIT_POLL (base) _MMIO((base) + 0x24c)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 33/33 drm/i915/gt: Enable ring scheduling for gen6/7
In reply to Chris WilsonSwitch over from FIFO global submission to the priority-sorted topographical scheduler. At the cost of more busy work on the CPU to keep the GPU supplied with the next packet of requests, this allows us to reorder requests around submission stalls.
This also enables the timer based RPS, with the exception of Valleyview who's PCU doesn't take kindly to our interference.
--- drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 ++ drivers/gpu/drm/i915/gt/intel_rps.c | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +1 -1
@@ -94,7 +94,7 @@ static int live_nop_switch(void *arg) rq =i915_request_get (this);i915_request_add (this); } -if (i915_request_wait (rq,0 ,HZ /5 ) <0 ) { +if (i915_request_wait (rq,0 ,HZ ) <0 ) {pr_err ("Failed to populated %d contexts\n" , nctx);intel_gt_set_wedged (&i915->gt);i915_request_put (rq);
drivers/gpu/drm/i915/gt/intel_engine_cs.c +2 -0
@@ -788,6 +788,8 @@ int intel_engines_init(struct intel_gt *gt)if (HAS_EXECLISTS (gt->i915)) setup = intel_execlists_submission_setup; +else if (INTEL_GEN (gt->i915) >=6 ) + setup = intel_ring_scheduler_setup;else setup = intel_ring_submission_setup;
drivers/gpu/drm/i915/gt/intel_rps.c +2 -4
@@ -1052,9 +1052,7 @@ static bool gen6_rps_enable(struct intel_rps *rps)intel_uncore_write_fw (uncore,GEN6_RP_DOWN_TIMEOUT ,50000 );intel_uncore_write_fw (uncore,GEN6_RP_IDLE_HYSTERSIS ,10 ); - rps->pm_events = (GEN6_PM_RP_UP_THRESHOLD | -GEN6_PM_RP_DOWN_THRESHOLD | -GEN6_PM_RP_DOWN_TIMEOUT ); + rps->pm_events =GEN6_PM_RP_UP_THRESHOLD |GEN6_PM_RP_DOWN_THRESHOLD ;return rps_reset (rps); }
@@ -1361,7 +1359,7 @@ void intel_rps_enable(struct intel_rps *rps)GEM_BUG_ON (rps->efficient_freq < rps->min_freq);GEM_BUG_ON (rps->efficient_freq > rps->max_freq); -if (has_busy_stats (rps)) +if (has_busy_stats (rps) && !IS_VALLEYVIEW (i915))intel_rps_set_timer (rps);else if (INTEL_GEN (i915) >=6 )intel_rps_set_interrupts (rps);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/33] drm/i915/gt: Harden the heartbeat against a stuck driver
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [01/33] drm/i915/gt: Harden the heartbeat against a stuck driver
URL : https://patchwork.freedesktop.org/series/78987/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip d499941ea4dc drm/i915/gt: Harden the heartbeat against a stuck driver -:43: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'heartbeat', this function's name, in a string #43: FILE: drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c:135: + "stopped heartbeat on %s",
total: 0 errors, 1 warnings, 0 checks, 35 lines checked6005d22404ee drm/i915/gt: Move the heartbeat into the highprio system wq a88b1324c0e4 drm/i915/gt: Decouple completed requests on unwind6df6651ce794 drm/i915/gt: Check for a completed last request once8a484e67419b drm/i915/gt: Replace direct submit with direct call to tasklet b807a1aa2cc6 drm/i915/gt: Use virtual_engine during execlists_dequeue e0d8e53384b4 drm/i915/gt: Decouple inflight virtual engines07c202c5b553 drm/i915/gt: Defer schedule_out until after the next dequeue 77abad2cc860 drm/i915/gt: Resubmit the virtual engine on schedule-out c20604000873 drm/i915/gt: Simplify virtual engine handling for execlists_hold() 1d3df5a15c70 drm/i915/gt: ce->inflight updates are now serialised9a511c705c10 drm/i915/gt: Drop atomic for engine->fw_active tracking7d0425bc6864 drm/i915/gt: Extract busy-stats for ring-scheduler
-:12: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #12:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 95 lines checked851c723d19be drm/i915/gt: Convert stats.active to plain unsigned intac29cc857205 drm/i915: Lift waiter/signaler iterators796fb1aa036a drm/i915: Strip out internal priorities284c4ee82fb5 drm/i915: Remove I915_USER_PRIORITY_SHIFT67f4f4fadb82 drm/i915: Replace engine->schedule() with a known request operation 5f0a0dc1333b drm/i915/gt: Do not suspend bonded requests if one hangs7d61bb0dd5d2 drm/i915: Teach the i915_dependency to use a double-locka1a69cab81f5 drm/i915: Restructure priority inheritanced7403349647f drm/i915/gt: Remove timeslice suppression2569e0b593e7 drm/i915: Fair low-latency scheduling
-:1548: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #1548:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 1371 lines checked675054b4e9d9 drm/i915/gt: Specify a deadline for the heartbeatcf6941683a97 drm/i915: Replace the priority boosting for the display with a deadline 5af3de0375a1 drm/i915: Move saturated workload detection to the GT
-:22: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #22:
References: 44d89409a12e ("drm/i915: Make the semaphore saturation mask global")
-:22: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 44d89409a12e ("drm/i915: Make the semaphore saturation mask global")' #22:
References: 44d89409a12e ("drm/i915: Make the semaphore saturation mask global")
total: 1 errors, 1 warnings, 0 checks, 82 lines checked5021faa7f115 Restore "drm/i915: drop engine_pin/unpin_breadcrumbs_irq" 7bfc5312e63e drm/i915/gt: Couple tasklet scheduling for all CS interrupts 2dca796d3efe drm/i915/gt: Support creation of 'internal' rings
988103172126 drm/i915/gt: Use client timeline address for seqno writes 8071d6c00487 drm/i915/gt: Infrastructure for ring scheduling
-:79: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #79:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 818 lines checked 86f134b795e6 drm/i915/gt: Implement ring scheduler for gen6/7 -:68: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #68: FILE: drivers/gpu/drm/i915/gt/intel_ring_scheduler.c:177:
+ *cs++ = i915_mmio_reg_offset(
-:70: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #70: FILE: drivers/gpu/drm/i915/gt/intel_ring_scheduler.c:179:
+ *cs++ = _MASKED_BIT_ENABLE(
-:105: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #105: FILE: drivers/gpu/drm/i915/gt/intel_ring_scheduler.c:214:
+ *cs++ = _MASKED_BIT_DISABLE(
total: 0 errors, 0 warnings, 3 checks, 536 lines checked 06d3b687d37c drm/i915/gt: Enable ring scheduling for gen6/7
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [01/33] drm/i915/gt: Harden the heartbeat against a stuck driver
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [01/33] drm/i915/gt: Harden the heartbeat against a stuck driver
URL : https://patchwork.freedesktop.org/series/78987/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.0 Fast mode used, each commit won't be checked separately. +drivers/gpu/drm/i915/display/intel_display.c:1223:22: error: Expected constant expression in case statement +drivers/gpu/drm/i915/display/intel_display.c:1226:22: error: Expected constant expression in case statement +drivers/gpu/drm/i915/display/intel_display.c:1229:22: error: Expected constant expression in case statement +drivers/gpu/drm/i915/display/intel_display.c:1232:22: error: Expected constant expression in case statement +drivers/gpu/drm/i915/gt/intel_reset.c:1326:5: warning: context imbalance in 'intel_gt_reset_trylock' - different lock contexts for basic block +drivers/gpu/drm/i915/gt/sysfs_engines.c:61:10: error: bad integer constant expression +drivers/gpu/drm/i915/gt/sysfs_engines.c:62:10: error: bad integer constant expression +drivers/gpu/drm/i915/gt/sysfs_engines.c:66:10: error: bad integer constant expression +drivers/gpu/drm/i915/gvt/mmio.c:287:23: warning: memcpy with byte count of 279040 +drivers/gpu/drm/i915/i915_perf.c:1425:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/i915_perf.c:1479:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/selftests/i915_syncmap.c:80:54: warning: dubious: x | !y +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_read16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_read32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_read64' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_read8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_write8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen8_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen8_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen8_write8' - different lock contexts for basic block
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [01/33] drm/i915/gt: Harden the heartbeat against a stuck driver
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [01/33] drm/i915/gt: Harden the heartbeat against a stuck driver
URL : https://patchwork.freedesktop.org/series/78987/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8683 -> Patchwork_18054
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/index.html
Known issues
------------
Here are the changes found in Patchwork_18054 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_backlight@basic-brightness:
- fi-whl-u: [PASS][1] -> [DMESG-WARN][2] ([i915#95])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-whl-u/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-whl-u/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-glk-dsi: [PASS][3] -> [DMESG-WARN][4] ([i915#1982])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-glk-dsi/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-glk-dsi/igt@[email protected]
* igt@i915_selftest@live@execlists:
- fi-icl-y: [PASS][5] -> [DMESG-FAIL][6] ([i915#656])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-icl-y/igt@i915_selftest@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-icl-y/igt@i915_selftest@[email protected]
* igt@kms_busy@basic@flip:
- fi-kbl-x1275: [PASS][7] -> [DMESG-WARN][8] ([i915#62] / [i915#92] / [i915#95])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-kbl-x1275/igt@kms_busy@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-kbl-x1275/igt@kms_busy@[email protected]
* igt@kms_cursor_legacy@basic-flip-before-cursor-atomic:
- fi-icl-u2: [PASS][9] -> [DMESG-WARN][10] ([i915#1982])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-icl-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-icl-u2/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s0:
- fi-tgl-u2: [FAIL][11] ([i915#1888]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-tgl-u2/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-tgl-u2/igt@[email protected]
* igt@i915_pm_rpm@basic-pci-d3-state:
- {fi-tgl-dsi}: [DMESG-WARN][13] ([i915#1982]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-tgl-dsi/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-tgl-dsi/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-kbl-guc: [SKIP][15] ([fdo#109271]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-kbl-guc/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-kbl-guc/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-bsw-n3050: [DMESG-WARN][17] ([i915#1982]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-bsw-n3050/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-bsw-n3050/igt@[email protected]
* igt@kms_cursor_legacy@basic-flip-after-cursor-legacy:
- fi-icl-u2: [DMESG-WARN][19] ([i915#1982]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-icl-u2/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-icl-u2/igt@[email protected]
* igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
- fi-tgl-u2: [DMESG-WARN][21] ([i915#402]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-tgl-u2/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-tgl-u2/igt@[email protected]
#### Warnings ####
* igt@gem_exec_suspend@basic-s0:
- fi-kbl-x1275: [DMESG-WARN][23] ([i915#1982] / [i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][24] ([i915#62] / [i915#92] / [i915#95])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-kbl-x1275/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-kbl-x1275/igt@[email protected]
* igt@kms_flip@basic-flip-vs-modeset@a-dp1:
- fi-kbl-x1275: [DMESG-WARN][25] ([i915#62] / [i915#92]) -> [DMESG-WARN][26] ([i915#62] / [i915#92] / [i915#95]) +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-kbl-x1275/igt@kms_flip@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-kbl-x1275/igt@kms_flip@[email protected]
* igt@kms_force_connector_basic@prune-stale-modes:
- fi-kbl-x1275: [DMESG-WARN][27] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][28] ([i915#62] / [i915#92]) +5 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/fi-kbl-x1275/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/fi-kbl-x1275/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (43 -> 37)
------------------------------
Additional (1): fi-snb-2600
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_8683 -> Patchwork_18054
CI-20190529: 20190529
CI_DRM_8683: 55336f177ce2ab9832293770439aa138bc51af07 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5718: af1ef32bfae90bcdbaf1b5d84c61ff4e04368505 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18054: 06d3b687d37cf1d86cd205ebe076c7cc670b301f @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
06d3b687d37c drm/i915/gt: Enable ring scheduling for gen6/7 86f134b795e6 drm/i915/gt: Implement ring scheduler for gen6/7 8071d6c00487 drm/i915/gt: Infrastructure for ring scheduling 988103172126 drm/i915/gt: Use client timeline address for seqno writes 2dca796d3efe drm/i915/gt: Support creation of 'internal' rings 7bfc5312e63e drm/i915/gt: Couple tasklet scheduling for all CS interrupts 5021faa7f115 Restore "drm/i915: drop engine_pin/unpin_breadcrumbs_irq" 5af3de0375a1 drm/i915: Move saturated workload detection to the GT cf6941683a97 drm/i915: Replace the priority boosting for the display with a deadline 675054b4e9d9 drm/i915/gt: Specify a deadline for the heartbeat 2569e0b593e7 drm/i915: Fair low-latency schedulingd7403349647f drm/i915/gt: Remove timeslice suppressiona1a69cab81f5 drm/i915: Restructure priority inheritance7d61bb0dd5d2 drm/i915: Teach the i915_dependency to use a double-lock 5f0a0dc1333b drm/i915/gt: Do not suspend bonded requests if one hangs 67f4f4fadb82 drm/i915: Replace engine->schedule() with a known request operation 284c4ee82fb5 drm/i915: Remove I915_USER_PRIORITY_SHIFT796fb1aa036a drm/i915: Strip out internal prioritiesac29cc857205 drm/i915: Lift waiter/signaler iterators851c723d19be drm/i915/gt: Convert stats.active to plain unsigned int 7d0425bc6864 drm/i915/gt: Extract busy-stats for ring-scheduler 9a511c705c10 drm/i915/gt: Drop atomic for engine->fw_active tracking 1d3df5a15c70 drm/i915/gt: ce->inflight updates are now serialised c20604000873 drm/i915/gt: Simplify virtual engine handling for execlists_hold() 77abad2cc860 drm/i915/gt: Resubmit the virtual engine on schedule-out 07c202c5b553 drm/i915/gt: Defer schedule_out until after the next dequeue e0d8e53384b4 drm/i915/gt: Decouple inflight virtual engines b807a1aa2cc6 drm/i915/gt: Use virtual_engine during execlists_dequeue 8a484e67419b drm/i915/gt: Replace direct submit with direct call to tasklet 6df6651ce794 drm/i915/gt: Check for a completed last request once a88b1324c0e4 drm/i915/gt: Decouple completed requests on unwind 6005d22404ee drm/i915/gt: Move the heartbeat into the highprio system wq d499941ea4dc drm/i915/gt: Harden the heartbeat against a stuck driver
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [01/33] drm/i915/gt: Harden the heartbeat against a stuck driver
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [01/33] drm/i915/gt: Harden the heartbeat against a stuck driver
URL : https://patchwork.freedesktop.org/series/78987/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8683_full -> Patchwork_18054_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_18054_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_18054_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_18054_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_ctx_exec@basic-nohangcheck:
- shard-tglb: [PASS][1] -> [FAIL][2] +5 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb1/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb8/igt@[email protected]
* igt@gem_exec_schedule@reorder-wide@bcs0:
- shard-skl: [PASS][3] -> [FAIL][4] +3 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl10/igt@gem_exec_schedule@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl5/igt@gem_exec_schedule@[email protected]
* igt@gem_exec_schedule@reorder-wide@rcs0:
- shard-hsw: NOTRUN -> [FAIL][5] +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-hsw4/igt@gem_exec_schedule@[email protected]
- shard-apl: [PASS][6] -> [FAIL][7] +3 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl8/igt@gem_exec_schedule@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl2/igt@gem_exec_schedule@[email protected]
- shard-glk: [PASS][8] -> [FAIL][9] +3 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-glk9/igt@gem_exec_schedule@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-glk3/igt@gem_exec_schedule@[email protected]
- shard-snb: NOTRUN -> [FAIL][10] +1 similar issue
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-snb1/igt@gem_exec_schedule@[email protected]
* igt@gem_exec_schedule@reorder-wide@vcs0:
- shard-iclb: [PASS][11] -> [FAIL][12] +3 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-iclb7/igt@gem_exec_schedule@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-iclb4/igt@gem_exec_schedule@[email protected]
* igt@gem_exec_schedule@reorder-wide@vcs1:
- shard-kbl: [PASS][13] -> [FAIL][14] +4 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl6/igt@gem_exec_schedule@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl2/igt@gem_exec_schedule@[email protected]
- shard-iclb: NOTRUN -> [FAIL][15]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-iclb4/igt@gem_exec_schedule@[email protected]
New tests
---------
New tests have been introduced between CI_DRM_8683_full and Patchwork_18054_full:
### New IGT tests (1) ###
* igt@i915_selftest@mock@scheduler:
- Statuses : 2 pass(s)
- Exec time: [0.21, 1.04] s
Known issues
------------
Here are the changes found in Patchwork_18054_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_param@set-priority-not-supported:
- shard-snb: [PASS][16] -> [SKIP][17] ([fdo#109271])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-snb6/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-snb6/igt@[email protected]
- shard-hsw: [PASS][18] -> [SKIP][19] ([fdo#109271])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-hsw7/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-hsw7/igt@[email protected]
* igt@gem_exec_balancer@smoke:
- shard-kbl: [PASS][20] -> [TIMEOUT][21] ([i915#2119]) +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl2/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl6/igt@[email protected]
* igt@gem_exec_schedule@preempt-engines@bcs0:
- shard-kbl: [PASS][22] -> [INCOMPLETE][23] ([i915#2119])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl1/igt@gem_exec_schedule@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl7/igt@gem_exec_schedule@[email protected]
- shard-apl: [PASS][24] -> [INCOMPLETE][25] ([i915#1635] / [i915#2119])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl6/igt@gem_exec_schedule@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl1/igt@gem_exec_schedule@[email protected]
* igt@gem_exec_schedule@preempt-engines@rcs0:
- shard-tglb: [PASS][26] -> [INCOMPLETE][27] ([i915#2119])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb1/igt@gem_exec_schedule@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb8/igt@gem_exec_schedule@[email protected]
- shard-skl: [PASS][28] -> [INCOMPLETE][29] ([i915#2119])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl6/igt@gem_exec_schedule@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl9/igt@gem_exec_schedule@[email protected]
- shard-glk: [PASS][30] -> [INCOMPLETE][31] ([i915#2119] / [i915#58] / [k.org#198133])
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-glk5/igt@gem_exec_schedule@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-glk9/igt@gem_exec_schedule@[email protected]
* igt@gem_mmap_gtt@ptrace:
- shard-apl: [PASS][32] -> [DMESG-WARN][33] ([i915#1635] / [i915#95]) +15 similar issues
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl1/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl8/igt@[email protected]
* igt@gen9_exec_parse@allowed-all:
- shard-skl: [PASS][34] -> [DMESG-WARN][35] ([i915#1436] / [i915#716])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl9/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl8/igt@[email protected]
* igt@kms_cursor_crc@pipe-b-cursor-64x64-random:
- shard-kbl: [PASS][36] -> [DMESG-WARN][37] ([i915#93] / [i915#95]) +2 similar issues
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl3/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl4/igt@[email protected]
* igt@kms_cursor_edge_walk@pipe-a-256x256-right-edge:
- shard-skl: [PASS][38] -> [DMESG-WARN][39] ([i915#1982]) +10 similar issues
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl5/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl7/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-edp1:
- shard-skl: [PASS][40] -> [FAIL][41] ([i915#79])
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl8/igt@kms_flip@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl5/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-expired-vblank@c-edp1:
- shard-skl: [PASS][42] -> [FAIL][43] ([i915#46])
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl6/igt@kms_flip@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl2/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-suspend@a-dp1:
- shard-kbl: [PASS][44] -> [DMESG-WARN][45] ([i915#180]) +3 similar issues
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl3/igt@kms_flip@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl1/igt@kms_flip@[email protected]
* igt@kms_flip@plain-flip-fb-recreate-interruptible@a-edp1:
- shard-skl: [PASS][46] -> [FAIL][47] ([i915#1928])
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl4/igt@kms_flip@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl5/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc:
- shard-tglb: [PASS][48] -> [TIMEOUT][49] ([i915#2119]) +2 similar issues
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc.html
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb5/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc.html
* igt@kms_frontbuffer_tracking@psr-farfromfence:
- shard-tglb: [PASS][50] -> [DMESG-WARN][51] ([i915#1982])
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb5/igt@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [PASS][52] -> [DMESG-FAIL][53] ([fdo#108145] / [i915#1982])
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl4/igt@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl5/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [PASS][54] -> [FAIL][55] ([fdo#108145] / [i915#265]) +1 similar issue
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl2/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl3/igt@[email protected]
* igt@kms_prime@basic-crc@second-to-first:
- shard-kbl: [PASS][56] -> [DMESG-FAIL][57] ([i915#95])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl7/igt@kms_prime@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl3/igt@kms_prime@[email protected]
* igt@kms_psr@psr2_cursor_plane_move:
- shard-iclb: [PASS][58] -> [SKIP][59] ([fdo#109441]) +1 similar issue
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-iclb2/igt@kms_psr@psr2_cursor_plane_move.html
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-iclb4/igt@kms_psr@psr2_cursor_plane_move.html
* igt@kms_setmode@basic:
- shard-kbl: [PASS][60] -> [FAIL][61] ([i915#31])
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl6/igt@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl2/igt@[email protected]
* igt@perf@blocking:
- shard-glk: [PASS][62] -> [DMESG-WARN][63] ([i915#118] / [i915#95]) +1 similar issue
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-glk6/igt@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-glk5/igt@[email protected]
* igt@perf_pmu@module-unload:
- shard-tglb: [PASS][64] -> [DMESG-WARN][65] ([i915#402])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb5/igt@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb7/igt@[email protected]
* igt@perf_pmu@semaphore-busy@rcs0:
- shard-kbl: [PASS][66] -> [FAIL][67] ([i915#1820])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl6/igt@perf_pmu@[email protected]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl2/igt@perf_pmu@[email protected]
#### Possible fixes ####
* igt@gem_exec_reloc@basic-concurrent0:
- shard-glk: [FAIL][68] ([i915#1930]) -> [PASS][69]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-glk3/igt@[email protected]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-glk7/igt@[email protected]
* igt@gem_exec_whisper@basic-contexts-priority-all:
- shard-hsw: [SKIP][70] ([fdo#109271]) -> [PASS][71] +22 similar issues
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-hsw1/igt@[email protected]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-hsw1/igt@[email protected]
* igt@gem_exec_whisper@basic-fds-priority-all:
- shard-glk: [DMESG-WARN][72] ([i915#118] / [i915#95]) -> [PASS][73]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-glk4/igt@[email protected]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-glk6/igt@[email protected]
* igt@gem_fenced_exec_thrash@no-spare-fences-interruptible:
- shard-snb: [TIMEOUT][74] ([i915#1958] / [i915#2119]) -> [PASS][75] +3 similar issues
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-snb4/igt@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-snb1/igt@[email protected]
* igt@gem_mmap_gtt@cpuset-big-copy-odd:
- shard-skl: [DMESG-WARN][76] ([i915#1982]) -> [PASS][77] +6 similar issues
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl7/igt@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl6/igt@[email protected]
* igt@gen9_exec_parse@allowed-all:
- shard-apl: [DMESG-WARN][78] ([i915#1436] / [i915#716]) -> [PASS][79]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl6/igt@[email protected]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl3/igt@[email protected]
* igt@i915_suspend@sysfs-reader:
- shard-kbl: [DMESG-WARN][80] ([i915#180]) -> [PASS][81] +3 similar issues
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl4/igt@[email protected]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl4/igt@[email protected]
* igt@kms_addfb_basic@invalid-set-prop:
- shard-tglb: [DMESG-WARN][82] ([i915#402]) -> [PASS][83] +2 similar issues
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb3/igt@[email protected]
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb6/igt@[email protected]
* igt@kms_big_fb@x-tiled-64bpp-rotate-180:
- shard-glk: [DMESG-FAIL][84] ([i915#118] / [i915#95]) -> [PASS][85]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-glk8/igt@[email protected]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-glk4/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-skl: [FAIL][86] ([IGT#5]) -> [PASS][87]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
* igt@kms_flip@2x-single-buffer-flip-vs-dpms-off-vs-modeset@ab-vga1-hdmi-a1:
- shard-hsw: [DMESG-WARN][88] ([i915#1982]) -> [PASS][89]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-hsw6/igt@kms_flip@2x-single-buffer-flip-vs-dpms-off-vs-modeset@ab-vga1-hdmi-a1.html
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-hsw2/igt@kms_flip@2x-single-buffer-flip-vs-dpms-off-vs-modeset@ab-vga1-hdmi-a1.html
* igt@kms_flip@flip-vs-suspend-interruptible@d-edp1:
- shard-tglb: [INCOMPLETE][90] -> [PASS][91]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb7/igt@kms_flip@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb8/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbc-rgb565-draw-blt:
- shard-kbl: [DMESG-WARN][92] ([i915#93] / [i915#95]) -> [PASS][93]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl4/igt@[email protected]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl4/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-indfb-fliptrack:
- shard-tglb: [DMESG-WARN][94] ([i915#1982]) -> [PASS][95]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb5/igt@[email protected]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb7/igt@[email protected]
* igt@kms_hdr@bpc-switch-suspend:
- shard-skl: [FAIL][96] ([i915#1188]) -> [PASS][97] +1 similar issue
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl4/igt@[email protected]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl10/igt@[email protected]
* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-snb: [SKIP][98] ([fdo#109271]) -> [PASS][99] +20 similar issues
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-snb6/igt@[email protected]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-snb2/igt@[email protected]
* igt@kms_plane_scaling@pipe-a-scaler-with-clipping-clamping:
- shard-iclb: [DMESG-WARN][100] ([i915#1982]) -> [PASS][101] +1 similar issue
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-iclb3/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-iclb6/igt@[email protected]
* igt@kms_psr@psr2_no_drrs:
- shard-iclb: [SKIP][102] ([fdo#109441]) -> [PASS][103] +3 similar issues
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-iclb5/igt@kms_psr@psr2_no_drrs.html
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-iclb2/igt@kms_psr@psr2_no_drrs.html
* igt@kms_psr@psr2_primary_mmap_gtt:
- shard-tglb: [SKIP][104] ([i915#668]) -> [PASS][105] +4 similar issues
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb7/igt@kms_psr@psr2_primary_mmap_gtt.html
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb8/igt@kms_psr@psr2_primary_mmap_gtt.html
* igt@kms_vblank@pipe-b-accuracy-idle:
- shard-apl: [DMESG-WARN][106] ([i915#1635] / [i915#95]) -> [PASS][107] +6 similar issues
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl4/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl2/igt@[email protected]
* igt@kms_vblank@pipe-c-wait-idle:
- shard-kbl: [DMESG-WARN][108] ([i915#1982]) -> [PASS][109]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl3/igt@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl7/igt@[email protected]
* igt@perf@polling-parameterized:
- shard-iclb: [FAIL][110] ([i915#1542]) -> [PASS][111]
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-iclb8/igt@[email protected]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-iclb2/igt@[email protected]
#### Warnings ####
* igt@gem_exec_reloc@basic-concurrent16:
- shard-snb: [TIMEOUT][112] ([i915#1958] / [i915#2119]) -> [FAIL][113] ([i915#1930])
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-snb4/igt@[email protected]
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-snb1/igt@[email protected]
- shard-iclb: [INCOMPLETE][114] ([i915#1958]) -> [TIMEOUT][115] ([i915#1958] / [i915#2119])
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-iclb5/igt@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-iclb8/igt@[email protected]
- shard-skl: [INCOMPLETE][116] ([i915#1958]) -> [TIMEOUT][117] ([i915#1958] / [i915#2119])
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl3/igt@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl4/igt@[email protected]
- shard-kbl: [INCOMPLETE][118] ([i915#1958]) -> [TIMEOUT][119] ([i915#1958] / [i915#2119])
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl6/igt@[email protected]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl2/igt@[email protected]
- shard-apl: [INCOMPLETE][120] ([i915#1635] / [i915#1958]) -> [TIMEOUT][121] ([i915#1635] / [i915#1958] / [i915#2119])
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl2/igt@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl3/igt@[email protected]
- shard-tglb: [INCOMPLETE][122] ([i915#1958]) -> [TIMEOUT][123] ([i915#1958] / [i915#2119])
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb5/igt@[email protected]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb7/igt@[email protected]
- shard-glk: [INCOMPLETE][124] ([i915#1958] / [i915#58] / [k.org#198133]) -> [TIMEOUT][125] ([i915#1958] / [i915#2119])
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-glk6/igt@[email protected]
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-glk8/igt@[email protected]
* igt@gem_exec_reloc@basic-spin-others@vcs0:
- shard-snb: [WARN][126] ([i915#2021]) -> [WARN][127] ([i915#2036])
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-snb1/igt@gem_exec_reloc@[email protected]
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-snb4/igt@gem_exec_reloc@[email protected]
* igt@kms_color_chamelium@pipe-b-ctm-0-75:
- shard-apl: [SKIP][128] ([fdo#109271] / [fdo#111827] / [i915#1635]) -> [SKIP][129] ([fdo#109271] / [fdo#111827])
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl1/igt@[email protected]
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl8/igt@[email protected]
* igt@kms_content_protection@srm:
- shard-kbl: [TIMEOUT][130] ([i915#1319] / [i915#1958] / [i915#2119]) -> [TIMEOUT][131] ([i915#1319] / [i915#2119])
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl7/igt@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl3/igt@[email protected]
* igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-ytiled:
- shard-snb: [TIMEOUT][132] ([i915#1958] / [i915#2119]) -> [SKIP][133] ([fdo#109271]) +1 similar issue
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-snb4/igt@[email protected]
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-snb1/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-indfb-draw-blt:
- shard-kbl: [SKIP][134] ([fdo#109271]) -> [TIMEOUT][135] ([i915#2119]) +1 similar issue
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl2/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-indfb-draw-blt.html
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl6/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-indfb-draw-blt.html
* igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-cur-indfb-draw-mmap-wc:
- shard-apl: [SKIP][136] ([fdo#109271] / [i915#1635]) -> [SKIP][137] ([fdo#109271]) +2 similar issues
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl4/igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-cur-indfb-draw-mmap-wc.html
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl2/igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-cur-indfb-draw-mmap-wc.html
* igt@kms_frontbuffer_tracking@psr-1p-rte:
- shard-apl: [SKIP][138] ([fdo#109271]) -> [SKIP][139] ([fdo#109271] / [i915#1635]) +4 similar issues
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl4/igt@[email protected]
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl2/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-suspend:
- shard-tglb: [SKIP][140] ([i915#668]) -> [DMESG-WARN][141] ([i915#1982])
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-tglb7/igt@[email protected]
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-tglb8/igt@[email protected]
* igt@kms_hdr@bpc-switch-suspend:
- shard-kbl: [DMESG-WARN][142] ([i915#93] / [i915#95]) -> [DMESG-WARN][143] ([i915#180] / [i915#93] / [i915#95])
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-kbl2/igt@[email protected]
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-kbl4/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-coverage-vs-premult-vs-constant:
- shard-apl: [DMESG-FAIL][144] ([fdo#108145] / [i915#1635] / [i915#1982] / [i915#95]) -> [DMESG-FAIL][145] ([fdo#108145] / [i915#1635] / [i915#95])
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl1/igt@kms_plane_alpha_blend@pipe-a-coverage-vs-premult-vs-constant.html
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl6/igt@kms_plane_alpha_blend@pipe-a-coverage-vs-premult-vs-constant.html
* igt@kms_plane_alpha_blend@pipe-b-alpha-7efc:
- shard-skl: [FAIL][146] ([fdo#108145] / [i915#265]) -> [DMESG-FAIL][147] ([fdo#108145] / [i915#1982])
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-skl7/igt@[email protected]
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-skl6/igt@[email protected]
* igt@runner@aborted:
- shard-apl: ([FAIL][148], [FAIL][149]) ([fdo#109271] / [i915#1635] / [i915#716]) -> [FAIL][150] ([i915#1635])
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl6/igt@[email protected]
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8683/shard-apl3/igt@[email protected]
[150]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/shard-apl8/igt@[email protected]
[IGT#5]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/5
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1820]: https://gitlab.freedesktop.org/drm/intel/issues/1820
[i915#1928]: https://gitlab.freedesktop.org/drm/intel/issues/1928
[i915#1930]: h
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18054/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 5 lines · Chris Wilson
If the driver get stuck holding the kernel timeline, we cannot issue a heartbeat and so fail to discover that the driver is indeed stuck and do not issue a GPU reset (which would hopefully unstick the driver!). Switch to using a trylock so that we can query if the heartbeat's timelin mutex is locked elsewhere, and then use the timer to probe if it
timeline
Quoted 30 lines
remains stuck at the same spot for consecutive heartbeats, indicating that the mutex has not been released and the engine has not progressed.
Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 14 ++++++++++++-- drivers/gpu/drm/i915/gt/intel_engine_types.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +3
-1@@ -65,6 +65,7 @@ static void heartbeat(struct work_struct *wrk)container_of (wrk,typeof (*engine), heartbeat.work.work);struct intel_context *ce = engine->kernel_context;struct i915_request *rq; +unsigned long serial;/* Just in case everything has gone horribly wrong, give it a kick */ intel_engine_flush_submission (engine);@@ -122,10 +123,19 @@ static void heartbeat(struct work_struct *wrk) goto out; } -if (engine->wakeref_serial == engine->serial) + serial =READ_ONCE (engine->serial); +if (engine->wakeref_serial == serial) goto out;
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c static void heartbeat(struct work_struct *wrk) · line 138
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +9
-1-mutex_lock (&ce->timeline->mutex); +if (!mutex_trylock (&ce->timeline->mutex)) { +/* Unable to lock the kernel timeline, is the engine stuck? */ +if (xchg (&engine->heartbeat.blocked, serial) == serial) +intel_gt_handle_error (engine->gt, engine->mask, +I915_ERROR_CAPTURE , +"stopped heartbeat on %s" , + engine->name); + goto out; + }
This should do the trick. I was worried on the submit signal (fence) block being empty above in this function that what happens if we never manage to submit.
But this should cover that case also.
Quoted 22 lines
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +0
-0intel_context_enter (ce); rq =__i915_request_create (ce,GFP_NOWAIT | __GFP_NOWARN);drivers/gpu/drm/i915/gt/intel_engine_types.h +1
-0@@ -348,6 +348,7 @@ struct intel_engine_cs {struct {struct delayed_work work;struct i915_request *systole; +unsigned long blocked; } heartbeat;unsigned long serial;Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx