Endless busyness, the forecoming
Subsystems (2)
Please kindly review. Same old patches.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/8 drm/i915: Keep contexts pinned until after the next kernel context switch
We need to keep the context image pinned in memory until after the GPU has finished writing into it. Since it continues to write as we signal the final breadcrumb, we need to keep it pinned until the request after it is complete. Currently we know the order in which requests execute on each engine, and so to remove that presumption we need to identify a request/context-switch we know must occur after our completion. Any request queued after the signal must imply a context switch, for simplicity we use a fresh request from the kernel context.
--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++---- drivers/gpu/drm/i915/gem/i915_gem_context.h | 1 - drivers/gpu/drm/i915/gem/i915_gem_pm.c | 20 ++++- drivers/gpu/drm/i915/gt/intel_context.c | 80 ++++++++++++++++--- drivers/gpu/drm/i915/gt/intel_context.h | 3 + drivers/gpu/drm/i915/gt/intel_context_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_engine.h | 2 - drivers/gpu/drm/i915/gt/intel_engine_cs.c | 23 +----- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 + drivers/gpu/drm/i915/gt/intel_engine_types.h | 13 +-- drivers/gpu/drm/i915/gt/intel_lrc.c | 62 ++------------ drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 44 +--------- drivers/gpu/drm/i915/gt/mock_engine.c | 11 +-- drivers/gpu/drm/i915/i915_active.c | 80 ++++++++++++++++++- drivers/gpu/drm/i915/i915_active.h | 5 ++ drivers/gpu/drm/i915/i915_active_types.h | 3 + drivers/gpu/drm/i915/i915_gem.c | 4 - drivers/gpu/drm/i915/i915_request.c | 15 ---- .../gpu/drm/i915/selftests/mock_gem_device.c | 1 - 19 files changed, 214 insertions(+), 185 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +6 -18
@@ -692,17 +692,6 @@ int i915_gem_contexts_init(struct drm_i915_private *dev_priv)return 0 ; } -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv) -{ -struct intel_engine_cs *engine; -enum intel_engine_id id; - -lockdep_assert_held (&dev_priv->drm.struct_mutex); - -for_each_engine (engine, dev_priv, id) -intel_engine_lost_context (engine); -} -void i915_gem_contexts_fini (struct drm_i915_private *i915) {lockdep_assert_held (&i915->drm.struct_mutex);
@@ -1203,10 +1192,6 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)if (ret) goto out_add; - ret =gen8_emit_rpcs_config (rq, ce, sseu); -if (ret) - goto out_add; -/* * Guarantee context image and the timeline remains pinned until the * modifying request is retired by setting the ce activity tracker.
@@ -1214,9 +1199,12 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)* But we only need to take one pin on the account of it. Or in other * words transfer the pinned ce object to tracked active request. */ -if (!i915_active_request_isset (&ce->active_tracker)) -__intel_context_pin (ce); -__i915_active_request_set (&ce->active_tracker, rq); +GEM_BUG_ON (i915_active_is_idle (&ce->active)); + ret =i915_active_ref (&ce->active, rq->fence.context, rq); +if (ret) + goto out_add; + + ret =gen8_emit_rpcs_config (rq, ce, sseu); out_add:i915_request_add (rq);
drivers/gpu/drm/i915/gem/i915_gem_context.h +0 -1
@@ -134,7 +134,6 @@ static inline bool i915_gem_context_is_kernel(struct i915_gem_context *ctx)/* i915_gem_context.c */ int __must_check i915_gem_contexts_init (struct drm_i915_private *dev_priv); -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv);void i915_gem_contexts_fini (struct drm_i915_private *dev_priv); int i915_gem_context_open(struct drm_i915_private *i915,
drivers/gpu/drm/i915/gem/i915_gem_pm.c +19 -1
@@ -10,6 +10,22 @@#include "i915_drv.h" #include "i915_globals.h" +static void call_idle_barriers (struct intel_engine_cs *engine) +{ +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) { +struct i915_active_request *active = +container_of ((struct list_head *)node, +typeof (*active), link); + +INIT_LIST_HEAD (&active->link); +RCU_INIT_POINTER (active->request,NULL ); + + active->retire (active,NULL ); + } +} +static void i915_gem_park (struct drm_i915_private *i915) {struct intel_engine_cs *engine;
@@ -17,8 +33,10 @@ static void i915_gem_park(struct drm_i915_private *i915)lockdep_assert_held (&i915->drm.struct_mutex); -for_each_engine (engine, i915, id) +for_each_engine (engine, i915, id) { +call_idle_barriers (engine);/* cleanup after wedging */ i915_gem_batch_pool_fini (&engine->batch_pool); + }i915_timelines_park (i915);i915_vma_parked (i915);
drivers/gpu/drm/i915/gt/intel_context.c +71 -9
106 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_context.h +3 -0
@@ -102,6 +102,9 @@ static inline void intel_context_exit(struct intel_context *ce) ce->ops->exit (ce); } +int intel_context_active (struct intel_context *ce,unsigned long flags); +void intel_context_inactive (struct intel_context *ce); +static inline struct intel_context *intel_context_get (struct intel_context *ce) {kref_get (&ce->ref);
drivers/gpu/drm/i915/gt/intel_context_types.h +3 -3
@@ -56,10 +56,10 @@ struct intel_context {intel_engine_mask_t saturated;/* submitting semaphores too late? */ /** -* active_tracker: Active tracker for the external rq activity -* on this intel_context object. +* active: Active tracker for the rq activity (inc. external) on this +* intel_context object. */ -struct i915_active_request active_tracker; +struct i915_active active;const struct intel_context_ops *ops;
drivers/gpu/drm/i915/gt/intel_engine.h +0 -2
@@ -466,8 +466,6 @@ static inline void intel_engine_reset(struct intel_engine_cs *engine,bool intel_engine_is_idle (struct intel_engine_cs *engine);bool intel_engines_are_idle (struct drm_i915_private *dev_priv); -void intel_engine_lost_context (struct intel_engine_cs *engine); -void intel_engines_reset_default_submission (struct drm_i915_private *i915);unsigned int intel_engines_has_context_isolation (struct drm_i915_private *i915);
drivers/gpu/drm/i915/gt/intel_engine_cs.c +3 -20
@@ -611,6 +611,8 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine) {int err; +init_llist_head (&engine->barrier_tasks); + err =init_status_page (engine);if (err)return err;
@@ -870,6 +872,7 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)if (engine->preempt_context)intel_context_unpin (engine->preempt_context);intel_context_unpin (engine->kernel_context); +GEM_BUG_ON (!llist_empty (&engine->barrier_tasks));i915_timeline_fini (&engine->timeline);
@@ -1201,26 +1204,6 @@ void intel_engines_reset_default_submission(struct drm_i915_private *i915) engine->set_default_submission (engine); } -/** -* intel_engine_lost_context: called when the GPU is reset into unknown state -* @engine: the engine -* -* We have either reset the GPU or otherwise about to lose state tracking of -* the current GPU logical state (e.g. suspend). On next use, it is therefore -* imperative that we make no presumptions about the current state and load -* from scratch. -*/ -void intel_engine_lost_context (struct intel_engine_cs *engine) -{ -struct intel_context *ce; - -lockdep_assert_held (&engine->i915->drm.struct_mutex); - - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -} -bool intel_engine_can_store_dword (struct intel_engine_cs *engine) {switch (INTEL_GEN (engine->i915)) {
drivers/gpu/drm/i915/gt/intel_engine_pm.c +2 -0
@@ -88,6 +88,8 @@ static bool switch_to_kernel_context(struct intel_engine_cs *engine)/* Check again on the next retirement. */ engine->wakeref_serial = engine->serial +1 ; + +i915_request_add_barriers (rq);__i915_request_commit (rq);return false;
drivers/gpu/drm/i915/gt/intel_engine_types.h +2 -11
@@ -11,6 +11,7 @@#include <linux/irq_work.h> #include <linux/kref.h> #include <linux/list.h> +#include <linux/llist.h> #include <linux/types.h> #include "i915_gem.h"
@@ -288,6 +289,7 @@ struct intel_engine_cs {struct intel_ring *buffer;struct i915_timeline timeline; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */ struct intel_context *preempt_context;/* pinned; optional */
@@ -435,17 +437,6 @@ struct intel_engine_cs {struct intel_engine_execlists execlists; -/* Contexts are pinned whilst they are active on the GPU. The last -* context executed remains active whilst the GPU is idle - the -* switch away and write to the context object only occurs on the -* next execution. Contexts are only unpinned on retirement of the -* following request ensuring that we can always write to the object -* on the context switch even after idling. Across suspend, we switch -* to the kernel context and trash it as the save may not happen -* before the hardware is powered down. -*/ -struct intel_context *last_retired_context; -/* status_notifier: list of callbacks for context-switch changes */ struct atomic_notifier_head context_status_notifier;
drivers/gpu/drm/i915/gt/intel_lrc.c +8 -54
90 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_ringbuffer.c +4 -40
67 lines not on this page · raw message
drivers/gpu/drm/i915/gt/mock_engine.c +6 -5
@@ -146,12 +146,18 @@ static void mock_context_destroy(struct kref *ref)static int mock_context_pin (struct intel_context *ce) { +int ret; +if (!ce->ring) { ce->ring =mock_ring (ce->engine);if (!ce->ring)return -ENOMEM ; } + ret =intel_context_active (ce,PIN_HIGH ); +if (ret) +return ret; +mock_timeline_pin (ce->ring->timeline);return 0 ; }
@@ -328,14 +334,9 @@ void mock_engine_free(struct intel_engine_cs *engine) {struct mock_engine *mock =container_of (engine,typeof (*mock), base); -struct intel_context *ce;GEM_BUG_ON (timer_pending (&mock->hw_delay)); - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine);
drivers/gpu/drm/i915/i915_active.c +79 -1
98 lines not on this page · raw message
drivers/gpu/drm/i915/i915_active.h +5 -0
@@ -406,4 +406,9 @@ void i915_active_fini(struct i915_active *ref);static inline void i915_active_fini (struct i915_active *ref) { }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine); +void i915_active_acquire_barrier (struct i915_active *ref); +void i915_request_add_barriers (struct i915_request *rq); +#endif /* _I915_ACTIVE_H_ */
drivers/gpu/drm/i915/i915_active_types.h +3 -0
@@ -7,6 +7,7 @@#ifndef _I915_ACTIVE_TYPES_H_#define _I915_ACTIVE_TYPES_H_ +#include <linux/llist.h> #include <linux/rbtree.h> #include <linux/rcupdate.h>
@@ -31,6 +32,8 @@ struct i915_active {unsigned int count;void (*retire)(struct i915_active *ref); + + struct llist_head barriers; };#endif /* _I915_ACTIVE_TYPES_H_ */
drivers/gpu/drm/i915/i915_gem.c +0 -4
@@ -1197,10 +1197,6 @@ void i915_gem_sanitize(struct drm_i915_private *i915)intel_uncore_forcewake_put (&i915->uncore,FORCEWAKE_ALL );intel_runtime_pm_put (i915, wakeref); - -mutex_lock (&i915->drm.struct_mutex); -i915_gem_contexts_lost (i915); -mutex_unlock (&i915->drm.struct_mutex); }void i915_gem_init_swizzling (struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/i915_request.c +0 -15
@@ -213,18 +213,6 @@ static void __retire_engine_request(struct intel_engine_cs *engine,spin_unlock (&rq->lock);local_irq_enable (); - -/* -* The backing object for the context is done after switching to the -* *next* context. Therefore we cannot retire the previous context until -* the next context has already started running. However, since we -* cannot take the required locks at i915_request_submit() we -* defer the unpinning of the active context to now, retirement of -* the subsequent request. -*/ -if (engine->last_retired_context) -intel_context_unpin (engine->last_retired_context); - engine->last_retired_context = rq->hw_context; } static void __retire_engine_upto(struct intel_engine_cs *engine,
@@ -759,9 +747,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) rq->infix = rq->ring->emit;/* end of header; start of user payload */ -/* Keep a second pin for the dual retirement along engine and ring */ -__intel_context_pin (ce); -intel_context_mark_active (ce);return rq;
drivers/gpu/drm/i915/selftests/mock_gem_device.c +0 -1
@@ -56,7 +56,6 @@ static void mock_device_release(struct drm_device *dev)mutex_lock (&i915->drm.struct_mutex);mock_device_flush (i915); -i915_gem_contexts_lost (i915);mutex_unlock (&i915->drm.struct_mutex);flush_work (&i915->gem.idle_work);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
Quoted 66 lines · Chris Wilson
We need to keep the context image pinned in memory until after the GPU has finished writing into it. Since it continues to write as we signal the final breadcrumb, we need to keep it pinned until the request after it is complete. Currently we know the order in which requests execute on each engine, and so to remove that presumption we need to identify a request/context-switch we know must occur after our completion. Any request queued after the signal must imply a context switch, for simplicity we use a fresh request from the kernel context.
Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++---- drivers/gpu/drm/i915/gem/i915_gem_context.h | 1 - drivers/gpu/drm/i915/gem/i915_gem_pm.c | 20 ++++- drivers/gpu/drm/i915/gt/intel_context.c | 80 ++++++++++++++++--- drivers/gpu/drm/i915/gt/intel_context.h | 3 + drivers/gpu/drm/i915/gt/intel_context_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_engine.h | 2 - drivers/gpu/drm/i915/gt/intel_engine_cs.c | 23 +----- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 + drivers/gpu/drm/i915/gt/intel_engine_types.h | 13 +-- drivers/gpu/drm/i915/gt/intel_lrc.c | 62 ++------------ drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 44 +--------- drivers/gpu/drm/i915/gt/mock_engine.c | 11 +-- drivers/gpu/drm/i915/i915_active.c | 80 ++++++++++++++++++- drivers/gpu/drm/i915/i915_active.h | 5 ++ drivers/gpu/drm/i915/i915_active_types.h | 3 + drivers/gpu/drm/i915/i915_gem.c | 4 - drivers/gpu/drm/i915/i915_request.c | 15 ---- .../gpu/drm/i915/selftests/mock_gem_device.c | 1 - 19 files changed, 214 insertions(+), 185 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_context.c +0
-15@@ -692,17 +692,6 @@ int i915_gem_contexts_init(struct drm_i915_private *dev_priv)return 0 ; } -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv) -{ -struct intel_engine_cs *engine; -enum intel_engine_id id; - -lockdep_assert_held (&dev_priv->drm.struct_mutex); - -for_each_engine (engine, dev_priv, id) -intel_engine_lost_context (engine); -} -void i915_gem_contexts_fini (struct drm_i915_private *i915) {lockdep_assert_held (&i915->drm.struct_mutex);@@ -1203,10 +1192,6 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)if (ret) goto out_add; - ret =gen8_emit_rpcs_config (rq, ce, sseu); -if (ret) - goto out_add; -/* * Guarantee context image and the timeline remains pinned until the * modifying request is retired by setting the ce activity tracker.
drivers/gpu/drm/i915/gem/i915_gem_context.c gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu) · line 1203
Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +2
-3@@ -1214,9 +1199,12 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)* But we only need to take one pin on the account of it. Or in other * words transfer the pinned ce object to tracked active request. */ -if (!i915_active_request_isset (&ce->active_tracker)) -__intel_context_pin (ce); -__i915_active_request_set (&ce->active_tracker, rq); +GEM_BUG_ON (i915_active_is_idle (&ce->active)); + ret =i915_active_ref (&ce->active, rq->fence.context, rq);
Why the place to keep the context alive is this function?
In other words, if the sseu state is not changed, we bail out early and don't setup the tracker and thus fail in promise for keeping it alive.
Quoted 123 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +4
-0+if (ret) + goto out_add; + + ret =gen8_emit_rpcs_config (rq, ce, sseu); out_add:i915_request_add (rq);drivers/gpu/drm/i915/gem/i915_gem_context.h +0
-1@@ -134,7 +134,6 @@ static inline bool i915_gem_context_is_kernel(struct i915_gem_context *ctx)/* i915_gem_context.c */ int __must_check i915_gem_contexts_init (struct drm_i915_private *dev_priv); -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv);void i915_gem_contexts_fini (struct drm_i915_private *dev_priv); int i915_gem_context_open(struct drm_i915_private *i915,drivers/gpu/drm/i915/gem/i915_gem_pm.c +19
-1@@ -10,6 +10,22 @@#include "i915_drv.h" #include "i915_globals.h" +static void call_idle_barriers (struct intel_engine_cs *engine) +{ +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) { +struct i915_active_request *active = +container_of ((struct list_head *)node, +typeof (*active), link); + +INIT_LIST_HEAD (&active->link); +RCU_INIT_POINTER (active->request,NULL ); + + active->retire (active,NULL ); + } +} +static void i915_gem_park (struct drm_i915_private *i915) {struct intel_engine_cs *engine;@@ -17,8 +33,10 @@ static void i915_gem_park(struct drm_i915_private *i915)lockdep_assert_held (&i915->drm.struct_mutex); -for_each_engine (engine, i915, id) +for_each_engine (engine, i915, id) { +call_idle_barriers (engine);/* cleanup after wedging */ i915_gem_batch_pool_fini (&engine->batch_pool); + }i915_timelines_park (i915);i915_vma_parked (i915);drivers/gpu/drm/i915/gt/intel_context.c +31
-7@@ -61,7 +61,6 @@ int __intel_context_do_pin(struct intel_context *ce)i915_gem_context_get (ce->gem_context);/* for ctx->ppgtt */ -intel_context_get (ce);smp_mb__before_atomic ();/* flush pin before it is visible */ }@@ -89,20 +88,45 @@ void intel_context_unpin(struct intel_context *ce) ce->ops->unpin (ce);i915_gem_context_put (ce->gem_context); -intel_context_put (ce); +intel_context_inactive (ce); }mutex_unlock (&ce->pin_mutex);intel_context_put (ce); } -static void intel_context_retire (struct i915_active_request *active, -struct i915_request *rq) +static int __context_pin_state (struct i915_vma *vma,unsigned long flags) { -struct intel_context *ce = -container_of (active,typeof (*ce), active_tracker); +int err; -intel_context_unpin (ce); + err =i915_vma_pin (vma,0 ,0 , flags |PIN_GLOBAL ); +if (err) +return err; + +/* +* And mark it as a globally pinned object to let the shrinker know +* it cannot reclaim the object until we release it. +*/ + vma->obj->pin_global++; + vma->obj->mm.dirty = true; + +return 0 ; +} + +static void __context_unpin_state (struct i915_vma *vma) +{ + vma->obj->pin_global--; +__i915_vma_unpin (vma); +} + +static void intel_context_retire (struct i915_active *active) +{ +struct intel_context *ce =container_of (active,typeof (*ce), active); + +if (ce->state) +__context_unpin_state (ce->state); + +intel_context_put (ce); }void
drivers/gpu/drm/i915/gt/intel_context.c intel_context_init(struct intel_context *ce, · line 155
Quoted 9 lines
drivers/gpu/drm/i915/gt/intel_context.c +4
-2@@ -125,8 +149,46 @@ intel_context_init(struct intel_context *ce,mutex_init (&ce->pin_mutex); -i915_active_request_init (&ce->active_tracker, -NULL , intel_context_retire); +i915_active_init (ctx->i915, &ce->active, intel_context_retire); +} + +int intel_context_active (struct intel_context *ce,unsigned long flags)
I can digest this but was missing the verb in this and thought intel_context_activate|deactivate.
Quoted 397 lines
drivers/gpu/drm/i915/gt/intel_context.c +36
-0+{ +int err; + +if (!i915_active_acquire (&ce->active)) +return 0 ; + +intel_context_get (ce); + +if (!ce->state) +return 0 ; + + err =__context_pin_state (ce->state, flags); +if (err) { +i915_active_cancel (&ce->active); +intel_context_put (ce); +return err; + } + +/* Preallocate tracking nodes */ +if (!i915_gem_context_is_kernel (ce->gem_context)) { + err =i915_active_acquire_preallocate_barrier (&ce->active, + ce->engine); +if (err) { +i915_active_release (&ce->active); +return err; + } + } + +return 0 ; +} + +void intel_context_inactive (struct intel_context *ce) +{ +/* Nodes preallocated in intel_context_active() */ +i915_active_acquire_barrier (&ce->active); +i915_active_release (&ce->active); }static void i915_global_context_shrink (void )drivers/gpu/drm/i915/gt/intel_context.h +3
-0@@ -102,6 +102,9 @@ static inline void intel_context_exit(struct intel_context *ce) ce->ops->exit (ce); } +int intel_context_active (struct intel_context *ce,unsigned long flags); +void intel_context_inactive (struct intel_context *ce); +static inline struct intel_context *intel_context_get (struct intel_context *ce) {kref_get (&ce->ref);drivers/gpu/drm/i915/gt/intel_context_types.h +3
-3@@ -56,10 +56,10 @@ struct intel_context {intel_engine_mask_t saturated;/* submitting semaphores too late? */ /** -* active_tracker: Active tracker for the external rq activity -* on this intel_context object. +* active: Active tracker for the rq activity (inc. external) on this +* intel_context object. */ -struct i915_active_request active_tracker; +struct i915_active active;const struct intel_context_ops *ops;drivers/gpu/drm/i915/gt/intel_engine.h +0
-2@@ -466,8 +466,6 @@ static inline void intel_engine_reset(struct intel_engine_cs *engine,bool intel_engine_is_idle (struct intel_engine_cs *engine);bool intel_engines_are_idle (struct drm_i915_private *dev_priv); -void intel_engine_lost_context (struct intel_engine_cs *engine); -void intel_engines_reset_default_submission (struct drm_i915_private *i915);unsigned int intel_engines_has_context_isolation (struct drm_i915_private *i915);drivers/gpu/drm/i915/gt/intel_engine_cs.c +3
-20@@ -611,6 +611,8 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine) {int err; +init_llist_head (&engine->barrier_tasks); + err =init_status_page (engine);if (err)return err;@@ -870,6 +872,7 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)if (engine->preempt_context)intel_context_unpin (engine->preempt_context);intel_context_unpin (engine->kernel_context); +GEM_BUG_ON (!llist_empty (&engine->barrier_tasks));i915_timeline_fini (&engine->timeline);@@ -1201,26 +1204,6 @@ void intel_engines_reset_default_submission(struct drm_i915_private *i915) engine->set_default_submission (engine); } -/** -* intel_engine_lost_context: called when the GPU is reset into unknown state -* @engine: the engine -* -* We have either reset the GPU or otherwise about to lose state tracking of -* the current GPU logical state (e.g. suspend). On next use, it is therefore -* imperative that we make no presumptions about the current state and load -* from scratch. -*/ -void intel_engine_lost_context (struct intel_engine_cs *engine) -{ -struct intel_context *ce; - -lockdep_assert_held (&engine->i915->drm.struct_mutex); - - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -} -bool intel_engine_can_store_dword (struct intel_engine_cs *engine) {switch (INTEL_GEN (engine->i915)) {drivers/gpu/drm/i915/gt/intel_engine_pm.c +2
-0@@ -88,6 +88,8 @@ static bool switch_to_kernel_context(struct intel_engine_cs *engine)/* Check again on the next retirement. */ engine->wakeref_serial = engine->serial +1 ; + +i915_request_add_barriers (rq);__i915_request_commit (rq);return false;drivers/gpu/drm/i915/gt/intel_engine_types.h +2
-11@@ -11,6 +11,7 @@#include <linux/irq_work.h> #include <linux/kref.h> #include <linux/list.h> +#include <linux/llist.h> #include <linux/types.h> #include "i915_gem.h" @@ -288,6 +289,7 @@ struct intel_engine_cs {struct intel_ring *buffer;struct i915_timeline timeline; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */ struct intel_context *preempt_context;/* pinned; optional */ @@ -435,17 +437,6 @@ struct intel_engine_cs {struct intel_engine_execlists execlists; -/* Contexts are pinned whilst they are active on the GPU. The last -* context executed remains active whilst the GPU is idle - the -* switch away and write to the context object only occurs on the -* next execution. Contexts are only unpinned on retirement of the -* following request ensuring that we can always write to the object -* on the context switch even after idling. Across suspend, we switch -* to the kernel context and trash it as the save may not happen -* before the hardware is powered down. -*/ -struct intel_context *last_retired_context; -/* status_notifier: list of callbacks for context-switch changes */ struct atomic_notifier_head context_status_notifier;drivers/gpu/drm/i915/gt/intel_lrc.c +8
-54@@ -1422,60 +1422,11 @@ static void execlists_context_destroy(struct kref *kref)intel_context_free (ce); } -static int __context_pin (struct i915_vma *vma) -{ -unsigned int flags; -int err; - - flags =PIN_GLOBAL |PIN_HIGH ; - flags |=PIN_OFFSET_BIAS |i915_ggtt_pin_bias (vma); - - err =i915_vma_pin (vma,0 ,0 , flags); -if (err) -return err; - - vma->obj->pin_global++; - vma->obj->mm.dirty = true; - -return 0 ; -} - -static void __context_unpin (struct i915_vma *vma) -{ - vma->obj->pin_global--; -__i915_vma_unpin (vma); -} -static void execlists_context_unpin (struct intel_context *ce) { -struct intel_engine_cs *engine; - -/* -* The tasklet may still be using a pointer to our state, via an -* old request. However, since we know we only unpin the context -* on retirement of the following request, we know that the last -* request referencing us will have had a completion CS interrupt. -* If we see that it is still active, it means that the tasklet hasn't -* had the chance to run yet; let it run before we teardown the -* reference it may use. -*/ - engine =READ_ONCE (ce->inflight); -if (unlikely (engine)) { -unsigned long flags; - -spin_lock_irqsave (&engine->timeline.lock, flags); -process_csb (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); - -GEM_BUG_ON (READ_ONCE (ce->inflight)); - } -i915_gem_context_unpin_hw_id (ce->gem_context); - -intel_ring_unpin (ce->ring); -i915_gem_object_unpin_map (ce->state->obj); -__context_unpin (ce->state); +intel_ring_unpin (ce->ring); } static void@@ -1512,7 +1463,10 @@ __execlists_context_pin(struct intel_context *ce, goto err;GEM_BUG_ON (!ce->state); - ret =__context_pin (ce->state); + ret =intel_context_active (ce, + engine->i915->ggtt.pin_bias | +PIN_OFFSET_BIAS | +PIN_HIGH );if (ret) goto err;@@ -1521,7 +1475,7 @@ __execlists_context_pin(struct intel_context *ce, I915_MAP_OVERRIDE);if (IS_ERR (vaddr)) { ret =PTR_ERR (vaddr); - goto unpin_vma; + goto unpin_active; } ret =intel_ring_pin (ce->ring);@@ -1542,8 +1496,8 @@ __execlists_context_pin(struct intel_context *ce,intel_ring_unpin (ce->ring); unpin_map:i915_gem_object_unpin_map (ce->state->obj); -unpin_vma: -__context_unpin (ce->state); +unpin_active: +intel_context_inactive (ce); err:return ret; }drivers/gpu/drm/i915/gt/intel_ringbuffer.c +4
-40@@ -1349,45 +1349,9 @@ static void __context_unpin_ppgtt(struct i915_gem_context *ctx)gen6_ppgtt_unpin (i915_vm_to_ppgtt (vm)); } -static int __context_pin (struct intel_context *ce) -{ -struct i915_vma *vma; -int err; - - vma = ce->state; -if (!vma) -return 0 ; - - err =i915_vma_pin (vma,0 ,0 ,PIN_GLOBAL |PIN_HIGH ); -if (err) -return err; - -/* -* And mark is as a globally pinned object to let the shrinker know -* it cannot reclaim the object until we release it. -*/ - vma->obj->pin_global++; - vma->obj->mm.dirty = true; - -return 0 ; -} - -static void __context_unpin (struct intel_context *ce) -{ -struct i915_vma *vma; - - vma = ce->state; -if (!vma) -return ; - - vma->obj->pin_global--; -i915_vma_unpin (vma); -} -static void ring_context_unpin (struct intel_context *ce) {__context_unpin_ppgtt (ce->gem_context); -__context_unpin (ce); } static struct i915_vma *@@ -1477,18 +1441,18 @@ static int ring_context_pin(struct intel_context *ce) ce->state = vma; } - err =__context_pin (ce); + err =intel_context_active (ce,PIN_HIGH );if (err)return err; err =__context_pin_ppgtt (ce->gem_context);if (err) - goto err_unpin; + goto err_active;return 0 ; -err_unpin: -__context_unpin (ce); +err_active: +intel_context_inactive (ce);return err; }drivers/gpu/drm/i915/gt/mock_engine.c +6
-5@@ -146,12 +146,18 @@ static void mock_context_destroy(struct kref *ref)static int mock_context_pin (struct intel_context *ce) { +int ret; +if (!ce->ring) { ce->ring =mock_ring (ce->engine);if (!ce->ring)return -ENOMEM ; } + ret =intel_context_active (ce,PIN_HIGH ); +if (ret) +return ret; +mock_timeline_pin (ce->ring->timeline);return 0 ; }@@ -328,14 +334,9 @@ void mock_engine_free(struct intel_engine_cs *engine) {struct mock_engine *mock =container_of (engine,typeof (*mock), base); -struct intel_context *ce;GEM_BUG_ON (timer_pending (&mock->hw_delay)); - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine);drivers/gpu/drm/i915/i915_active.c +0
-0
drivers/gpu/drm/i915/i915_active.c active_instance(struct i915_active *ref, u64 idx) · line 103
Quoted 5 lines
drivers/gpu/drm/i915/i915_active.c +1
-1@@ -100,7 +100,7 @@ active_instance(struct i915_active *ref, u64 idx) parent = *p; node = rb_entry(parent, struct active_node, node); -if (node->timeline == idx) +if (node->timeline == idx && !IS_ERR (node->base.request))
Is this related change?
-Mika
Quoted 197 lines
drivers/gpu/drm/i915/i915_active.c +78
-0goto replace;if (node->timeline < idx)@@ -157,6 +157,7 @@ void i915_active_init(struct drm_i915_private *i915, ref->retire = retire; ref->tree =RB_ROOT ;i915_active_request_init (&ref->last,NULL , last_retire); +init_llist_head (&ref->barriers); ref->count =0 ; }@@ -263,6 +264,83 @@ void i915_active_fini(struct i915_active *ref) }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine) +{ +struct drm_i915_private *i915 = engine->i915; +unsigned long tmp; +int err =0 ; + +GEM_BUG_ON (!engine->mask); +for_each_engine_masked (engine, i915, engine->mask, tmp) { +struct intel_context *kctx = engine->kernel_context; +struct active_node *node; + + node =kmem_cache_alloc (global.slab_cache,GFP_KERNEL ); +if (unlikely (!node)) { + err = -ENOMEM ; +break ; + } + +i915_active_request_init (&node->base, + (void *)engine, node_retire); + node->timeline = kctx->ring->timeline->fence_context; + node->ref = ref; + ref->count++; + +llist_add ((struct llist_node *)&node->base.link, + &ref->barriers); + } + +return err; +} + +void i915_active_acquire_barrier (struct i915_active *ref) +{ +struct llist_node *pos, *next; + +i915_active_acquire (ref); + +llist_for_each_safe (pos, next,llist_del_all (&ref->barriers)) { +struct intel_engine_cs *engine; +struct active_node *node; +struct rb_node **p, *parent; + + node =container_of ((struct list_head *)pos, +typeof (*node), base.link); + + engine = (void *)rcu_access_pointer (node->base.request); +RCU_INIT_POINTER (node->base.request,ERR_PTR (-EAGAIN )); + + parent =NULL ; + p = &ref->tree.rb_node; +while (*p) { + parent = *p; +if (rb_entry (parent, + struct active_node, + node)->timeline < node->timeline) + p = &parent->rb_right; +else + p = &parent->rb_left; + } +rb_link_node (&node->node, parent, p); +rb_insert_color (&node->node, &ref->tree); + +llist_add ((struct llist_node *)&node->base.link, + &engine->barrier_tasks); + } +i915_active_release (ref); +} + +void i915_request_add_barriers (struct i915_request *rq) +{ +struct intel_engine_cs *engine = rq->engine; +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) +list_add_tail ((struct list_head *)node, &rq->active_list); +} +int i915_active_request_set (struct i915_active_request *active,struct i915_request *rq) {drivers/gpu/drm/i915/i915_active.h +5
-0@@ -406,4 +406,9 @@ void i915_active_fini(struct i915_active *ref);static inline void i915_active_fini (struct i915_active *ref) { }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine); +void i915_active_acquire_barrier (struct i915_active *ref); +void i915_request_add_barriers (struct i915_request *rq); +#endif /* _I915_ACTIVE_H_ */ drivers/gpu/drm/i915/i915_active_types.h +3
-0@@ -7,6 +7,7 @@#ifndef _I915_ACTIVE_TYPES_H_#define _I915_ACTIVE_TYPES_H_ +#include <linux/llist.h> #include <linux/rbtree.h> #include <linux/rcupdate.h> @@ -31,6 +32,8 @@ struct i915_active {unsigned int count;void (*retire)(struct i915_active *ref); + + struct llist_head barriers; };#endif /* _I915_ACTIVE_TYPES_H_ */ drivers/gpu/drm/i915/i915_gem.c +0
-4@@ -1197,10 +1197,6 @@ void i915_gem_sanitize(struct drm_i915_private *i915)intel_uncore_forcewake_put (&i915->uncore,FORCEWAKE_ALL );intel_runtime_pm_put (i915, wakeref); - -mutex_lock (&i915->drm.struct_mutex); -i915_gem_contexts_lost (i915); -mutex_unlock (&i915->drm.struct_mutex); }void i915_gem_init_swizzling (struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/i915_request.c +0
-15@@ -213,18 +213,6 @@ static void __retire_engine_request(struct intel_engine_cs *engine,spin_unlock (&rq->lock);local_irq_enable (); - -/* -* The backing object for the context is done after switching to the -* *next* context. Therefore we cannot retire the previous context until -* the next context has already started running. However, since we -* cannot take the required locks at i915_request_submit() we -* defer the unpinning of the active context to now, retirement of -* the subsequent request. -*/ -if (engine->last_retired_context) -intel_context_unpin (engine->last_retired_context); - engine->last_retired_context = rq->hw_context; } static void __retire_engine_upto(struct intel_engine_cs *engine,@@ -759,9 +747,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) rq->infix = rq->ring->emit;/* end of header; start of user payload */ -/* Keep a second pin for the dual retirement along engine and ring */ -__intel_context_pin (ce); -intel_context_mark_active (ce);return rq;drivers/gpu/drm/i915/selftests/mock_gem_device.c +0
-1@@ -56,7 +56,6 @@ static void mock_device_release(struct drm_device *dev)mutex_lock (&i915->drm.struct_mutex);mock_device_flush (i915); -i915_gem_contexts_lost (i915);mutex_unlock (&i915->drm.struct_mutex);flush_work (&i915->gem.idle_work);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: [PATCH 1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
Quoting Mika Kuoppala (2019-06-12 14:29:48)
Quoted 71 lines
Quoted 69 lines · Chris Wilson
We need to keep the context image pinned in memory until after the GPU has finished writing into it. Since it continues to write as we signal the final breadcrumb, we need to keep it pinned until the request after it is complete. Currently we know the order in which requests execute on each engine, and so to remove that presumption we need to identify a request/context-switch we know must occur after our completion. Any request queued after the signal must imply a context switch, for simplicity we use a fresh request from the kernel context.
Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++---- drivers/gpu/drm/i915/gem/i915_gem_context.h | 1 - drivers/gpu/drm/i915/gem/i915_gem_pm.c | 20 ++++- drivers/gpu/drm/i915/gt/intel_context.c | 80 ++++++++++++++++--- drivers/gpu/drm/i915/gt/intel_context.h | 3 + drivers/gpu/drm/i915/gt/intel_context_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_engine.h | 2 - drivers/gpu/drm/i915/gt/intel_engine_cs.c | 23 +----- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 + drivers/gpu/drm/i915/gt/intel_engine_types.h | 13 +-- drivers/gpu/drm/i915/gt/intel_lrc.c | 62 ++------------ drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 44 +--------- drivers/gpu/drm/i915/gt/mock_engine.c | 11 +-- drivers/gpu/drm/i915/i915_active.c | 80 ++++++++++++++++++- drivers/gpu/drm/i915/i915_active.h | 5 ++ drivers/gpu/drm/i915/i915_active_types.h | 3 + drivers/gpu/drm/i915/i915_gem.c | 4 - drivers/gpu/drm/i915/i915_request.c | 15 ---- .../gpu/drm/i915/selftests/mock_gem_device.c | 1 - 19 files changed, 214 insertions(+), 185 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_context.c +0
-15@@ -692,17 +692,6 @@ int i915_gem_contexts_init(struct drm_i915_private *dev_priv)return 0 ; } -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv) -{ -struct intel_engine_cs *engine; -enum intel_engine_id id; - -lockdep_assert_held (&dev_priv->drm.struct_mutex); - -for_each_engine (engine, dev_priv, id) -intel_engine_lost_context (engine); -} -void i915_gem_contexts_fini (struct drm_i915_private *i915) {lockdep_assert_held (&i915->drm.struct_mutex);@@ -1203,10 +1192,6 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)if (ret) goto out_add; - ret =gen8_emit_rpcs_config (rq, ce, sseu); -if (ret) - goto out_add; -/* * Guarantee context image and the timeline remains pinned until the * modifying request is retired by setting the ce activity tracker. @@ -1214,9 +1199,12 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)* But we only need to take one pin on the account of it. Or in other * words transfer the pinned ce object to tracked active request. */
Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu) · line 1203
Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +2
-3-if (!i915_active_request_isset (&ce->active_tracker)) -__intel_context_pin (ce); -__i915_active_request_set (&ce->active_tracker, rq); +GEM_BUG_ON (i915_active_is_idle (&ce->active)); + ret =i915_active_ref (&ce->active, rq->fence.context, rq);Why the place to keep the context alive is this function?
This is a special case where we have one context (the kernel context) writing into the context state object of another. To keep the target context state pinned, we mark the entire context as active.
Quoted 2 lines
In other words, if the sseu state is not changed, we bail out early and don't setup the tracker and thus fail in promise for keeping it alive.
As we don't need to keep it alive for an access that never happened.
Quoted 126 lines
Quoted 126 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +4
-0+if (ret) + goto out_add; + + ret =gen8_emit_rpcs_config (rq, ce, sseu); out_add:i915_request_add (rq);drivers/gpu/drm/i915/gem/i915_gem_context.h +0
-1@@ -134,7 +134,6 @@ static inline bool i915_gem_context_is_kernel(struct i915_gem_context *ctx)/* i915_gem_context.c */ int __must_check i915_gem_contexts_init (struct drm_i915_private *dev_priv); -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv);void i915_gem_contexts_fini (struct drm_i915_private *dev_priv); int i915_gem_context_open(struct drm_i915_private *i915,drivers/gpu/drm/i915/gem/i915_gem_pm.c +19
-1@@ -10,6 +10,22 @@#include "i915_drv.h" #include "i915_globals.h" +static void call_idle_barriers (struct intel_engine_cs *engine) +{ +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) { +struct i915_active_request *active = +container_of ((struct list_head *)node, +typeof (*active), link); + +INIT_LIST_HEAD (&active->link); +RCU_INIT_POINTER (active->request,NULL ); + + active->retire (active,NULL ); + } +} +static void i915_gem_park (struct drm_i915_private *i915) {struct intel_engine_cs *engine;@@ -17,8 +33,10 @@ static void i915_gem_park(struct drm_i915_private *i915)lockdep_assert_held (&i915->drm.struct_mutex); -for_each_engine (engine, i915, id) +for_each_engine (engine, i915, id) { +call_idle_barriers (engine);/* cleanup after wedging */ i915_gem_batch_pool_fini (&engine->batch_pool); + }i915_timelines_park (i915);i915_vma_parked (i915);drivers/gpu/drm/i915/gt/intel_context.c +31
-7@@ -61,7 +61,6 @@ int __intel_context_do_pin(struct intel_context *ce)i915_gem_context_get (ce->gem_context);/* for ctx->ppgtt */ -intel_context_get (ce);smp_mb__before_atomic ();/* flush pin before it is visible */ }@@ -89,20 +88,45 @@ void intel_context_unpin(struct intel_context *ce) ce->ops->unpin (ce);i915_gem_context_put (ce->gem_context); -intel_context_put (ce); +intel_context_inactive (ce); }mutex_unlock (&ce->pin_mutex);intel_context_put (ce); } -static void intel_context_retire (struct i915_active_request *active, -struct i915_request *rq) +static int __context_pin_state (struct i915_vma *vma,unsigned long flags) { -struct intel_context *ce = -container_of (active,typeof (*ce), active_tracker); +int err; -intel_context_unpin (ce); + err =i915_vma_pin (vma,0 ,0 , flags |PIN_GLOBAL ); +if (err) +return err; + +/* +* And mark it as a globally pinned object to let the shrinker know +* it cannot reclaim the object until we release it. +*/ + vma->obj->pin_global++; + vma->obj->mm.dirty = true; + +return 0 ; +} + +static void __context_unpin_state (struct i915_vma *vma) +{ + vma->obj->pin_global--; +__i915_vma_unpin (vma); +} + +static void intel_context_retire (struct i915_active *active) +{ +struct intel_context *ce =container_of (active,typeof (*ce), active); + +if (ce->state) +__context_unpin_state (ce->state); + +intel_context_put (ce); }void @@ -125,8 +149,46 @@ intel_context_init(struct intel_context *ce,mutex_init (&ce->pin_mutex);
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_context.c intel_context_init(struct intel_context *ce, · line 155
Quoted 6 lines
drivers/gpu/drm/i915/gt/intel_context.c +4
-2-i915_active_request_init (&ce->active_tracker, -NULL , intel_context_retire); +i915_active_init (ctx->i915, &ce->active, intel_context_retire); +} + +int intel_context_active (struct intel_context *ce,unsigned long flags)I can digest this but was missing the verb in this and thought intel_context_activate|deactivate.
You will never make me write activ8! Other than inserting mark or make, I don't have a better idea and have grown quite used to over the last several months. I think the intent here is reasonably clear, this is to operate on the ce->active.
Maybe, intel_context_active_acquire() and intel_context_active_release()?
Quoted 399 lines
Quoted 399 lines
drivers/gpu/drm/i915/gt/intel_context.c +36
-0+{ +int err; + +if (!i915_active_acquire (&ce->active)) +return 0 ; + +intel_context_get (ce); + +if (!ce->state) +return 0 ; + + err =__context_pin_state (ce->state, flags); +if (err) { +i915_active_cancel (&ce->active); +intel_context_put (ce); +return err; + } + +/* Preallocate tracking nodes */ +if (!i915_gem_context_is_kernel (ce->gem_context)) { + err =i915_active_acquire_preallocate_barrier (&ce->active, + ce->engine); +if (err) { +i915_active_release (&ce->active); +return err; + } + } + +return 0 ; +} + +void intel_context_inactive (struct intel_context *ce) +{ +/* Nodes preallocated in intel_context_active() */ +i915_active_acquire_barrier (&ce->active); +i915_active_release (&ce->active); }static void i915_global_context_shrink (void )drivers/gpu/drm/i915/gt/intel_context.h +3
-0@@ -102,6 +102,9 @@ static inline void intel_context_exit(struct intel_context *ce) ce->ops->exit (ce); } +int intel_context_active (struct intel_context *ce,unsigned long flags); +void intel_context_inactive (struct intel_context *ce); +static inline struct intel_context *intel_context_get (struct intel_context *ce) {kref_get (&ce->ref);drivers/gpu/drm/i915/gt/intel_context_types.h +3
-3@@ -56,10 +56,10 @@ struct intel_context {intel_engine_mask_t saturated;/* submitting semaphores too late? */ /** -* active_tracker: Active tracker for the external rq activity -* on this intel_context object. +* active: Active tracker for the rq activity (inc. external) on this +* intel_context object. */ -struct i915_active_request active_tracker; +struct i915_active active;const struct intel_context_ops *ops;drivers/gpu/drm/i915/gt/intel_engine.h +0
-2@@ -466,8 +466,6 @@ static inline void intel_engine_reset(struct intel_engine_cs *engine,bool intel_engine_is_idle (struct intel_engine_cs *engine);bool intel_engines_are_idle (struct drm_i915_private *dev_priv); -void intel_engine_lost_context (struct intel_engine_cs *engine); -void intel_engines_reset_default_submission (struct drm_i915_private *i915);unsigned int intel_engines_has_context_isolation (struct drm_i915_private *i915);drivers/gpu/drm/i915/gt/intel_engine_cs.c +3
-20@@ -611,6 +611,8 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine) {int err; +init_llist_head (&engine->barrier_tasks); + err =init_status_page (engine);if (err)return err;@@ -870,6 +872,7 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)if (engine->preempt_context)intel_context_unpin (engine->preempt_context);intel_context_unpin (engine->kernel_context); +GEM_BUG_ON (!llist_empty (&engine->barrier_tasks));i915_timeline_fini (&engine->timeline);@@ -1201,26 +1204,6 @@ void intel_engines_reset_default_submission(struct drm_i915_private *i915) engine->set_default_submission (engine); } -/** -* intel_engine_lost_context: called when the GPU is reset into unknown state -* @engine: the engine -* -* We have either reset the GPU or otherwise about to lose state tracking of -* the current GPU logical state (e.g. suspend). On next use, it is therefore -* imperative that we make no presumptions about the current state and load -* from scratch. -*/ -void intel_engine_lost_context (struct intel_engine_cs *engine) -{ -struct intel_context *ce; - -lockdep_assert_held (&engine->i915->drm.struct_mutex); - - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -} -bool intel_engine_can_store_dword (struct intel_engine_cs *engine) {switch (INTEL_GEN (engine->i915)) {drivers/gpu/drm/i915/gt/intel_engine_pm.c +2
-0@@ -88,6 +88,8 @@ static bool switch_to_kernel_context(struct intel_engine_cs *engine)/* Check again on the next retirement. */ engine->wakeref_serial = engine->serial +1 ; + +i915_request_add_barriers (rq);__i915_request_commit (rq);return false;drivers/gpu/drm/i915/gt/intel_engine_types.h +2
-11@@ -11,6 +11,7 @@#include <linux/irq_work.h> #include <linux/kref.h> #include <linux/list.h> +#include <linux/llist.h> #include <linux/types.h> #include "i915_gem.h" @@ -288,6 +289,7 @@ struct intel_engine_cs {struct intel_ring *buffer;struct i915_timeline timeline; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */ struct intel_context *preempt_context;/* pinned; optional */ @@ -435,17 +437,6 @@ struct intel_engine_cs {struct intel_engine_execlists execlists; -/* Contexts are pinned whilst they are active on the GPU. The last -* context executed remains active whilst the GPU is idle - the -* switch away and write to the context object only occurs on the -* next execution. Contexts are only unpinned on retirement of the -* following request ensuring that we can always write to the object -* on the context switch even after idling. Across suspend, we switch -* to the kernel context and trash it as the save may not happen -* before the hardware is powered down. -*/ -struct intel_context *last_retired_context; -/* status_notifier: list of callbacks for context-switch changes */ struct atomic_notifier_head context_status_notifier;drivers/gpu/drm/i915/gt/intel_lrc.c +8
-54@@ -1422,60 +1422,11 @@ static void execlists_context_destroy(struct kref *kref)intel_context_free (ce); } -static int __context_pin (struct i915_vma *vma) -{ -unsigned int flags; -int err; - - flags =PIN_GLOBAL |PIN_HIGH ; - flags |=PIN_OFFSET_BIAS |i915_ggtt_pin_bias (vma); - - err =i915_vma_pin (vma,0 ,0 , flags); -if (err) -return err; - - vma->obj->pin_global++; - vma->obj->mm.dirty = true; - -return 0 ; -} - -static void __context_unpin (struct i915_vma *vma) -{ - vma->obj->pin_global--; -__i915_vma_unpin (vma); -} -static void execlists_context_unpin (struct intel_context *ce) { -struct intel_engine_cs *engine; - -/* -* The tasklet may still be using a pointer to our state, via an -* old request. However, since we know we only unpin the context -* on retirement of the following request, we know that the last -* request referencing us will have had a completion CS interrupt. -* If we see that it is still active, it means that the tasklet hasn't -* had the chance to run yet; let it run before we teardown the -* reference it may use. -*/ - engine =READ_ONCE (ce->inflight); -if (unlikely (engine)) { -unsigned long flags; - -spin_lock_irqsave (&engine->timeline.lock, flags); -process_csb (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); - -GEM_BUG_ON (READ_ONCE (ce->inflight)); - } -i915_gem_context_unpin_hw_id (ce->gem_context); - -intel_ring_unpin (ce->ring); -i915_gem_object_unpin_map (ce->state->obj); -__context_unpin (ce->state); +intel_ring_unpin (ce->ring); } static void@@ -1512,7 +1463,10 @@ __execlists_context_pin(struct intel_context *ce, goto err;GEM_BUG_ON (!ce->state); - ret =__context_pin (ce->state); + ret =intel_context_active (ce, + engine->i915->ggtt.pin_bias | +PIN_OFFSET_BIAS | +PIN_HIGH );if (ret) goto err;@@ -1521,7 +1475,7 @@ __execlists_context_pin(struct intel_context *ce, I915_MAP_OVERRIDE);if (IS_ERR (vaddr)) { ret =PTR_ERR (vaddr); - goto unpin_vma; + goto unpin_active; } ret =intel_ring_pin (ce->ring);@@ -1542,8 +1496,8 @@ __execlists_context_pin(struct intel_context *ce,intel_ring_unpin (ce->ring); unpin_map:i915_gem_object_unpin_map (ce->state->obj); -unpin_vma: -__context_unpin (ce->state); +unpin_active: +intel_context_inactive (ce); err:return ret; }drivers/gpu/drm/i915/gt/intel_ringbuffer.c +4
-40@@ -1349,45 +1349,9 @@ static void __context_unpin_ppgtt(struct i915_gem_context *ctx)gen6_ppgtt_unpin (i915_vm_to_ppgtt (vm)); } -static int __context_pin (struct intel_context *ce) -{ -struct i915_vma *vma; -int err; - - vma = ce->state; -if (!vma) -return 0 ; - - err =i915_vma_pin (vma,0 ,0 ,PIN_GLOBAL |PIN_HIGH ); -if (err) -return err; - -/* -* And mark is as a globally pinned object to let the shrinker know -* it cannot reclaim the object until we release it. -*/ - vma->obj->pin_global++; - vma->obj->mm.dirty = true; - -return 0 ; -} - -static void __context_unpin (struct intel_context *ce) -{ -struct i915_vma *vma; - - vma = ce->state; -if (!vma) -return ; - - vma->obj->pin_global--; -i915_vma_unpin (vma); -} -static void ring_context_unpin (struct intel_context *ce) {__context_unpin_ppgtt (ce->gem_context); -__context_unpin (ce); } static struct i915_vma *@@ -1477,18 +1441,18 @@ static int ring_context_pin(struct intel_context *ce) ce->state = vma; } - err =__context_pin (ce); + err =intel_context_active (ce,PIN_HIGH );if (err)return err; err =__context_pin_ppgtt (ce->gem_context);if (err) - goto err_unpin; + goto err_active;return 0 ; -err_unpin: -__context_unpin (ce); +err_active: +intel_context_inactive (ce);return err; }drivers/gpu/drm/i915/gt/mock_engine.c +6
-5@@ -146,12 +146,18 @@ static void mock_context_destroy(struct kref *ref)static int mock_context_pin (struct intel_context *ce) { +int ret; +if (!ce->ring) { ce->ring =mock_ring (ce->engine);if (!ce->ring)return -ENOMEM ; } + ret =intel_context_active (ce,PIN_HIGH ); +if (ret) +return ret; +mock_timeline_pin (ce->ring->timeline);return 0 ; }@@ -328,14 +334,9 @@ void mock_engine_free(struct intel_engine_cs *engine) {struct mock_engine *mock =container_of (engine,typeof (*mock), base); -struct intel_context *ce;GEM_BUG_ON (timer_pending (&mock->hw_delay)); - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine);drivers/gpu/drm/i915/i915_active.c +0
-0@@ -100,7 +100,7 @@ active_instance(struct i915_active *ref, u64 idx) parent = *p;
Quoted 5 lines
drivers/gpu/drm/i915/i915_active.c active_instance(struct i915_active *ref, u64 idx) · line 103
Quoted 3 lines
drivers/gpu/drm/i915/i915_active.c +1
-1node = rb_entry(parent, struct active_node, node); -if (node->timeline == idx) +if (node->timeline == idx && !IS_ERR (node->base.request))Is this related change?
It once was (in the next chunk). I used to insert the freshly preallocated node into the tree before it had a valid request. It appears that is no longer the case and the ERR_PTR is kept safely in a list until ready.
Quoted 191 lines
-Mika
Quoted 189 lines
drivers/gpu/drm/i915/i915_active.c +78
-0goto replace;if (node->timeline < idx)@@ -157,6 +157,7 @@ void i915_active_init(struct drm_i915_private *i915, ref->retire = retire; ref->tree =RB_ROOT ;i915_active_request_init (&ref->last,NULL , last_retire); +init_llist_head (&ref->barriers); ref->count =0 ; }@@ -263,6 +264,83 @@ void i915_active_fini(struct i915_active *ref) }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine) +{ +struct drm_i915_private *i915 = engine->i915; +unsigned long tmp; +int err =0 ; + +GEM_BUG_ON (!engine->mask); +for_each_engine_masked (engine, i915, engine->mask, tmp) { +struct intel_context *kctx = engine->kernel_context; +struct active_node *node; + + node =kmem_cache_alloc (global.slab_cache,GFP_KERNEL ); +if (unlikely (!node)) { + err = -ENOMEM ; +break ; + } + +i915_active_request_init (&node->base, + (void *)engine, node_retire); + node->timeline = kctx->ring->timeline->fence_context; + node->ref = ref; + ref->count++; + +llist_add ((struct llist_node *)&node->base.link, + &ref->barriers); + } + +return err; +} + +void i915_active_acquire_barrier (struct i915_active *ref) +{ +struct llist_node *pos, *next; + +i915_active_acquire (ref); + +llist_for_each_safe (pos, next,llist_del_all (&ref->barriers)) { +struct intel_engine_cs *engine; +struct active_node *node; +struct rb_node **p, *parent; + + node =container_of ((struct list_head *)pos, +typeof (*node), base.link); + + engine = (void *)rcu_access_pointer (node->base.request); +RCU_INIT_POINTER (node->base.request,ERR_PTR (-EAGAIN )); + + parent =NULL ; + p = &ref->tree.rb_node; +while (*p) { + parent = *p; +if (rb_entry (parent, + struct active_node, + node)->timeline < node->timeline) + p = &parent->rb_right; +else + p = &parent->rb_left; + } +rb_link_node (&node->node, parent, p); +rb_insert_color (&node->node, &ref->tree); + +llist_add ((struct llist_node *)&node->base.link, + &engine->barrier_tasks); + } +i915_active_release (ref); +} + +void i915_request_add_barriers (struct i915_request *rq) +{ +struct intel_engine_cs *engine = rq->engine; +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) +list_add_tail ((struct list_head *)node, &rq->active_list); +} +int i915_active_request_set (struct i915_active_request *active,struct i915_request *rq) {drivers/gpu/drm/i915/i915_active.h +5
-0@@ -406,4 +406,9 @@ void i915_active_fini(struct i915_active *ref);static inline void i915_active_fini (struct i915_active *ref) { }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine); +void i915_active_acquire_barrier (struct i915_active *ref); +void i915_request_add_barriers (struct i915_request *rq); +#endif /* _I915_ACTIVE_H_ */ drivers/gpu/drm/i915/i915_active_types.h +3
-0@@ -7,6 +7,7 @@#ifndef _I915_ACTIVE_TYPES_H_#define _I915_ACTIVE_TYPES_H_ +#include <linux/llist.h> #include <linux/rbtree.h> #include <linux/rcupdate.h> @@ -31,6 +32,8 @@ struct i915_active {unsigned int count;void (*retire)(struct i915_active *ref); + + struct llist_head barriers; };#endif /* _I915_ACTIVE_TYPES_H_ */ drivers/gpu/drm/i915/i915_gem.c +0
-4@@ -1197,10 +1197,6 @@ void i915_gem_sanitize(struct drm_i915_private *i915)intel_uncore_forcewake_put (&i915->uncore,FORCEWAKE_ALL );intel_runtime_pm_put (i915, wakeref); - -mutex_lock (&i915->drm.struct_mutex); -i915_gem_contexts_lost (i915); -mutex_unlock (&i915->drm.struct_mutex); }void i915_gem_init_swizzling (struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/i915_request.c +0
-15@@ -213,18 +213,6 @@ static void __retire_engine_request(struct intel_engine_cs *engine,spin_unlock (&rq->lock);local_irq_enable (); - -/* -* The backing object for the context is done after switching to the -* *next* context. Therefore we cannot retire the previous context until -* the next context has already started running. However, since we -* cannot take the required locks at i915_request_submit() we -* defer the unpinning of the active context to now, retirement of -* the subsequent request. -*/ -if (engine->last_retired_context) -intel_context_unpin (engine->last_retired_context); - engine->last_retired_context = rq->hw_context; } static void __retire_engine_upto(struct intel_engine_cs *engine,@@ -759,9 +747,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) rq->infix = rq->ring->emit;/* end of header; start of user payload */ -/* Keep a second pin for the dual retirement along engine and ring */ -__intel_context_pin (ce); -intel_context_mark_active (ce);return rq;drivers/gpu/drm/i915/selftests/mock_gem_device.c +0
-1@@ -56,7 +56,6 @@ static void mock_device_release(struct drm_device *dev)mutex_lock (&i915->drm.struct_mutex);mock_device_flush (i915); -i915_gem_contexts_lost (i915);mutex_unlock (&i915->drm.struct_mutex);
Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/selftests/mock_gem_device.c +0
-0flush_work (&i915->gem.idle_work);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: [PATCH 1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
Quoted 227 lines · Chris Wilson
Quoting Mika Kuoppala (2019-06-12 14:29:48)
Quoted 71 lines
Quoted 69 lines · Chris Wilson
We need to keep the context image pinned in memory until after the GPU has finished writing into it. Since it continues to write as we signal the final breadcrumb, we need to keep it pinned until the request after it is complete. Currently we know the order in which requests execute on each engine, and so to remove that presumption we need to identify a request/context-switch we know must occur after our completion. Any request queued after the signal must imply a context switch, for simplicity we use a fresh request from the kernel context.
Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++---- drivers/gpu/drm/i915/gem/i915_gem_context.h | 1 - drivers/gpu/drm/i915/gem/i915_gem_pm.c | 20 ++++- drivers/gpu/drm/i915/gt/intel_context.c | 80 ++++++++++++++++--- drivers/gpu/drm/i915/gt/intel_context.h | 3 + drivers/gpu/drm/i915/gt/intel_context_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_engine.h | 2 - drivers/gpu/drm/i915/gt/intel_engine_cs.c | 23 +----- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 + drivers/gpu/drm/i915/gt/intel_engine_types.h | 13 +-- drivers/gpu/drm/i915/gt/intel_lrc.c | 62 ++------------ drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 44 +--------- drivers/gpu/drm/i915/gt/mock_engine.c | 11 +-- drivers/gpu/drm/i915/i915_active.c | 80 ++++++++++++++++++- drivers/gpu/drm/i915/i915_active.h | 5 ++ drivers/gpu/drm/i915/i915_active_types.h | 3 + drivers/gpu/drm/i915/i915_gem.c | 4 - drivers/gpu/drm/i915/i915_request.c | 15 ---- .../gpu/drm/i915/selftests/mock_gem_device.c | 1 - 19 files changed, 214 insertions(+), 185 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_context.c +0
-15@@ -692,17 +692,6 @@ int i915_gem_contexts_init(struct drm_i915_private *dev_priv)return 0 ; } -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv) -{ -struct intel_engine_cs *engine; -enum intel_engine_id id; - -lockdep_assert_held (&dev_priv->drm.struct_mutex); - -for_each_engine (engine, dev_priv, id) -intel_engine_lost_context (engine); -} -void i915_gem_contexts_fini (struct drm_i915_private *i915) {lockdep_assert_held (&i915->drm.struct_mutex);@@ -1203,10 +1192,6 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)if (ret) goto out_add; - ret =gen8_emit_rpcs_config (rq, ce, sseu); -if (ret) - goto out_add; -/* * Guarantee context image and the timeline remains pinned until the * modifying request is retired by setting the ce activity tracker. @@ -1214,9 +1199,12 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)* But we only need to take one pin on the account of it. Or in other * words transfer the pinned ce object to tracked active request. */ Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu) · line 1203
Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +2
-3-if (!i915_active_request_isset (&ce->active_tracker)) -__intel_context_pin (ce); -__i915_active_request_set (&ce->active_tracker, rq); +GEM_BUG_ON (i915_active_is_idle (&ce->active)); + ret =i915_active_ref (&ce->active, rq->fence.context, rq);Why the place to keep the context alive is this function?
This is a special case where we have one context (the kernel context) writing into the context state object of another. To keep the target context state pinned, we mark the entire context as active.
Quoted 2 lines
In other words, if the sseu state is not changed, we bail out early and don't setup the tracker and thus fail in promise for keeping it alive.
As we don't need to keep it alive for an access that never happened.
Quoted 126 lines
Quoted 126 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +4
-0+if (ret) + goto out_add; + + ret =gen8_emit_rpcs_config (rq, ce, sseu); out_add:i915_request_add (rq);drivers/gpu/drm/i915/gem/i915_gem_context.h +0
-1@@ -134,7 +134,6 @@ static inline bool i915_gem_context_is_kernel(struct i915_gem_context *ctx)/* i915_gem_context.c */ int __must_check i915_gem_contexts_init (struct drm_i915_private *dev_priv); -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv);void i915_gem_contexts_fini (struct drm_i915_private *dev_priv); int i915_gem_context_open(struct drm_i915_private *i915,drivers/gpu/drm/i915/gem/i915_gem_pm.c +19
-1@@ -10,6 +10,22 @@#include "i915_drv.h" #include "i915_globals.h" +static void call_idle_barriers (struct intel_engine_cs *engine) +{ +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) { +struct i915_active_request *active = +container_of ((struct list_head *)node, +typeof (*active), link); + +INIT_LIST_HEAD (&active->link); +RCU_INIT_POINTER (active->request,NULL ); + + active->retire (active,NULL ); + } +} +static void i915_gem_park (struct drm_i915_private *i915) {struct intel_engine_cs *engine;@@ -17,8 +33,10 @@ static void i915_gem_park(struct drm_i915_private *i915)lockdep_assert_held (&i915->drm.struct_mutex); -for_each_engine (engine, i915, id) +for_each_engine (engine, i915, id) { +call_idle_barriers (engine);/* cleanup after wedging */ i915_gem_batch_pool_fini (&engine->batch_pool); + }i915_timelines_park (i915);i915_vma_parked (i915);drivers/gpu/drm/i915/gt/intel_context.c +31
-7@@ -61,7 +61,6 @@ int __intel_context_do_pin(struct intel_context *ce)i915_gem_context_get (ce->gem_context);/* for ctx->ppgtt */ -intel_context_get (ce);smp_mb__before_atomic ();/* flush pin before it is visible */ }@@ -89,20 +88,45 @@ void intel_context_unpin(struct intel_context *ce) ce->ops->unpin (ce);i915_gem_context_put (ce->gem_context); -intel_context_put (ce); +intel_context_inactive (ce); }mutex_unlock (&ce->pin_mutex);intel_context_put (ce); } -static void intel_context_retire (struct i915_active_request *active, -struct i915_request *rq) +static int __context_pin_state (struct i915_vma *vma,unsigned long flags) { -struct intel_context *ce = -container_of (active,typeof (*ce), active_tracker); +int err; -intel_context_unpin (ce); + err =i915_vma_pin (vma,0 ,0 , flags |PIN_GLOBAL ); +if (err) +return err; + +/* +* And mark it as a globally pinned object to let the shrinker know +* it cannot reclaim the object until we release it. +*/ + vma->obj->pin_global++; + vma->obj->mm.dirty = true; + +return 0 ; +} + +static void __context_unpin_state (struct i915_vma *vma) +{ + vma->obj->pin_global--; +__i915_vma_unpin (vma); +} + +static void intel_context_retire (struct i915_active *active) +{ +struct intel_context *ce =container_of (active,typeof (*ce), active); + +if (ce->state) +__context_unpin_state (ce->state); + +intel_context_put (ce); }void @@ -125,8 +149,46 @@ intel_context_init(struct intel_context *ce,mutex_init (&ce->pin_mutex);Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_context.c intel_context_init(struct intel_context *ce, · line 155
Quoted 6 lines
drivers/gpu/drm/i915/gt/intel_context.c +4
-2-i915_active_request_init (&ce->active_tracker, -NULL , intel_context_retire); +i915_active_init (ctx->i915, &ce->active, intel_context_retire); +} + +int intel_context_active (struct intel_context *ce,unsigned long flags)I can digest this but was missing the verb in this and thought intel_context_activate|deactivate.
Quoted 5 lines
You will never make me write activ8! Other than inserting mark or make, I don't have a better idea and have grown quite used to over the last several months. I think the intent here is reasonably clear, this is to operate on the
ce->active.
mark_active was also in my mind.
Quoted 1 line
Maybe,
intel_context_active_acquire()andintel_context_active_release()?
On your note that it is the ce->active we operate on, not the context, the current naming starts to fit.
Quoted 439 lines
Quoted 400 lines
Quoted 400 lines
drivers/gpu/drm/i915/gt/intel_context.c +36
-0+{ +int err; + +if (!i915_active_acquire (&ce->active)) +return 0 ; + +intel_context_get (ce); + +if (!ce->state) +return 0 ; + + err =__context_pin_state (ce->state, flags); +if (err) { +i915_active_cancel (&ce->active); +intel_context_put (ce); +return err; + } + +/* Preallocate tracking nodes */ +if (!i915_gem_context_is_kernel (ce->gem_context)) { + err =i915_active_acquire_preallocate_barrier (&ce->active, + ce->engine); +if (err) { +i915_active_release (&ce->active); +return err; + } + } + +return 0 ; +} + +void intel_context_inactive (struct intel_context *ce) +{ +/* Nodes preallocated in intel_context_active() */ +i915_active_acquire_barrier (&ce->active); +i915_active_release (&ce->active); }static void i915_global_context_shrink (void )drivers/gpu/drm/i915/gt/intel_context.h +3
-0@@ -102,6 +102,9 @@ static inline void intel_context_exit(struct intel_context *ce) ce->ops->exit (ce); } +int intel_context_active (struct intel_context *ce,unsigned long flags); +void intel_context_inactive (struct intel_context *ce); +static inline struct intel_context *intel_context_get (struct intel_context *ce) {kref_get (&ce->ref);drivers/gpu/drm/i915/gt/intel_context_types.h +3
-3@@ -56,10 +56,10 @@ struct intel_context {intel_engine_mask_t saturated;/* submitting semaphores too late? */ /** -* active_tracker: Active tracker for the external rq activity -* on this intel_context object. +* active: Active tracker for the rq activity (inc. external) on this +* intel_context object. */ -struct i915_active_request active_tracker; +struct i915_active active;const struct intel_context_ops *ops;drivers/gpu/drm/i915/gt/intel_engine.h +0
-2@@ -466,8 +466,6 @@ static inline void intel_engine_reset(struct intel_engine_cs *engine,bool intel_engine_is_idle (struct intel_engine_cs *engine);bool intel_engines_are_idle (struct drm_i915_private *dev_priv); -void intel_engine_lost_context (struct intel_engine_cs *engine); -void intel_engines_reset_default_submission (struct drm_i915_private *i915);unsigned int intel_engines_has_context_isolation (struct drm_i915_private *i915);drivers/gpu/drm/i915/gt/intel_engine_cs.c +3
-20@@ -611,6 +611,8 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine) {int err; +init_llist_head (&engine->barrier_tasks); + err =init_status_page (engine);if (err)return err;@@ -870,6 +872,7 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)if (engine->preempt_context)intel_context_unpin (engine->preempt_context);intel_context_unpin (engine->kernel_context); +GEM_BUG_ON (!llist_empty (&engine->barrier_tasks));i915_timeline_fini (&engine->timeline);@@ -1201,26 +1204,6 @@ void intel_engines_reset_default_submission(struct drm_i915_private *i915) engine->set_default_submission (engine); } -/** -* intel_engine_lost_context: called when the GPU is reset into unknown state -* @engine: the engine -* -* We have either reset the GPU or otherwise about to lose state tracking of -* the current GPU logical state (e.g. suspend). On next use, it is therefore -* imperative that we make no presumptions about the current state and load -* from scratch. -*/ -void intel_engine_lost_context (struct intel_engine_cs *engine) -{ -struct intel_context *ce; - -lockdep_assert_held (&engine->i915->drm.struct_mutex); - - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -} -bool intel_engine_can_store_dword (struct intel_engine_cs *engine) {switch (INTEL_GEN (engine->i915)) {drivers/gpu/drm/i915/gt/intel_engine_pm.c +2
-0@@ -88,6 +88,8 @@ static bool switch_to_kernel_context(struct intel_engine_cs *engine)/* Check again on the next retirement. */ engine->wakeref_serial = engine->serial +1 ; + +i915_request_add_barriers (rq);__i915_request_commit (rq);return false;drivers/gpu/drm/i915/gt/intel_engine_types.h +2
-11@@ -11,6 +11,7 @@#include <linux/irq_work.h> #include <linux/kref.h> #include <linux/list.h> +#include <linux/llist.h> #include <linux/types.h> #include "i915_gem.h" @@ -288,6 +289,7 @@ struct intel_engine_cs {struct intel_ring *buffer;struct i915_timeline timeline; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */ struct intel_context *preempt_context;/* pinned; optional */ @@ -435,17 +437,6 @@ struct intel_engine_cs {struct intel_engine_execlists execlists; -/* Contexts are pinned whilst they are active on the GPU. The last -* context executed remains active whilst the GPU is idle - the -* switch away and write to the context object only occurs on the -* next execution. Contexts are only unpinned on retirement of the -* following request ensuring that we can always write to the object -* on the context switch even after idling. Across suspend, we switch -* to the kernel context and trash it as the save may not happen -* before the hardware is powered down. -*/ -struct intel_context *last_retired_context; -/* status_notifier: list of callbacks for context-switch changes */ struct atomic_notifier_head context_status_notifier;drivers/gpu/drm/i915/gt/intel_lrc.c +8
-54@@ -1422,60 +1422,11 @@ static void execlists_context_destroy(struct kref *kref)intel_context_free (ce); } -static int __context_pin (struct i915_vma *vma) -{ -unsigned int flags; -int err; - - flags =PIN_GLOBAL |PIN_HIGH ; - flags |=PIN_OFFSET_BIAS |i915_ggtt_pin_bias (vma); - - err =i915_vma_pin (vma,0 ,0 , flags); -if (err) -return err; - - vma->obj->pin_global++; - vma->obj->mm.dirty = true; - -return 0 ; -} - -static void __context_unpin (struct i915_vma *vma) -{ - vma->obj->pin_global--; -__i915_vma_unpin (vma); -} -static void execlists_context_unpin (struct intel_context *ce) { -struct intel_engine_cs *engine; - -/* -* The tasklet may still be using a pointer to our state, via an -* old request. However, since we know we only unpin the context -* on retirement of the following request, we know that the last -* request referencing us will have had a completion CS interrupt. -* If we see that it is still active, it means that the tasklet hasn't -* had the chance to run yet; let it run before we teardown the -* reference it may use. -*/ - engine =READ_ONCE (ce->inflight); -if (unlikely (engine)) { -unsigned long flags; - -spin_lock_irqsave (&engine->timeline.lock, flags); -process_csb (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); - -GEM_BUG_ON (READ_ONCE (ce->inflight)); - } -i915_gem_context_unpin_hw_id (ce->gem_context); - -intel_ring_unpin (ce->ring); -i915_gem_object_unpin_map (ce->state->obj); -__context_unpin (ce->state); +intel_ring_unpin (ce->ring); } static void@@ -1512,7 +1463,10 @@ __execlists_context_pin(struct intel_context *ce, goto err;GEM_BUG_ON (!ce->state); - ret =__context_pin (ce->state); + ret =intel_context_active (ce, + engine->i915->ggtt.pin_bias | +PIN_OFFSET_BIAS | +PIN_HIGH );if (ret) goto err;@@ -1521,7 +1475,7 @@ __execlists_context_pin(struct intel_context *ce, I915_MAP_OVERRIDE);if (IS_ERR (vaddr)) { ret =PTR_ERR (vaddr); - goto unpin_vma; + goto unpin_active; } ret =intel_ring_pin (ce->ring);@@ -1542,8 +1496,8 @@ __execlists_context_pin(struct intel_context *ce,intel_ring_unpin (ce->ring); unpin_map:i915_gem_object_unpin_map (ce->state->obj); -unpin_vma: -__context_unpin (ce->state); +unpin_active: +intel_context_inactive (ce); err:return ret; }drivers/gpu/drm/i915/gt/intel_ringbuffer.c +4
-40@@ -1349,45 +1349,9 @@ static void __context_unpin_ppgtt(struct i915_gem_context *ctx)gen6_ppgtt_unpin (i915_vm_to_ppgtt (vm)); } -static int __context_pin (struct intel_context *ce) -{ -struct i915_vma *vma; -int err; - - vma = ce->state; -if (!vma) -return 0 ; - - err =i915_vma_pin (vma,0 ,0 ,PIN_GLOBAL |PIN_HIGH ); -if (err) -return err; - -/* -* And mark is as a globally pinned object to let the shrinker know -* it cannot reclaim the object until we release it. -*/ - vma->obj->pin_global++; - vma->obj->mm.dirty = true; - -return 0 ; -} - -static void __context_unpin (struct intel_context *ce) -{ -struct i915_vma *vma; - - vma = ce->state; -if (!vma) -return ; - - vma->obj->pin_global--; -i915_vma_unpin (vma); -} -static void ring_context_unpin (struct intel_context *ce) {__context_unpin_ppgtt (ce->gem_context); -__context_unpin (ce); } static struct i915_vma *@@ -1477,18 +1441,18 @@ static int ring_context_pin(struct intel_context *ce) ce->state = vma; } - err =__context_pin (ce); + err =intel_context_active (ce,PIN_HIGH );if (err)return err; err =__context_pin_ppgtt (ce->gem_context);if (err) - goto err_unpin; + goto err_active;return 0 ; -err_unpin: -__context_unpin (ce); +err_active: +intel_context_inactive (ce);return err; }drivers/gpu/drm/i915/gt/mock_engine.c +6
-5@@ -146,12 +146,18 @@ static void mock_context_destroy(struct kref *ref)static int mock_context_pin (struct intel_context *ce) { +int ret; +if (!ce->ring) { ce->ring =mock_ring (ce->engine);if (!ce->ring)return -ENOMEM ; } + ret =intel_context_active (ce,PIN_HIGH ); +if (ret) +return ret; +mock_timeline_pin (ce->ring->timeline);return 0 ; }@@ -328,14 +334,9 @@ void mock_engine_free(struct intel_engine_cs *engine) {struct mock_engine *mock =container_of (engine,typeof (*mock), base); -struct intel_context *ce;GEM_BUG_ON (timer_pending (&mock->hw_delay)); - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine);drivers/gpu/drm/i915/i915_active.c +0
-0@@ -100,7 +100,7 @@ active_instance(struct i915_active *ref, u64 idx) parent = *p;Quoted 5 lines
drivers/gpu/drm/i915/i915_active.c active_instance(struct i915_active *ref, u64 idx) · line 103
Quoted 3 lines
drivers/gpu/drm/i915/i915_active.c +1
-1node = rb_entry(parent, struct active_node, node); -if (node->timeline == idx) +if (node->timeline == idx && !IS_ERR (node->base.request))Is this related change?
It once was (in the next chunk). I used to insert the freshly preallocated node into the tree before it had a valid request. It appears that is no longer the case and the
ERR_PTRis kept safely in a list until ready.Quoted 29 lines
-Mika
Quoted 27 lines
drivers/gpu/drm/i915/i915_active.c +13
-0goto replace;if (node->timeline < idx)@@ -157,6 +157,7 @@ void i915_active_init(struct drm_i915_private *i915, ref->retire = retire; ref->tree =RB_ROOT ;i915_active_request_init (&ref->last,NULL , last_retire); +init_llist_head (&ref->barriers); ref->count =0 ; }@@ -263,6 +264,83 @@ void i915_active_fini(struct i915_active *ref) }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine) +{ +struct drm_i915_private *i915 = engine->i915; +unsigned long tmp; +int err =0 ; + +GEM_BUG_ON (!engine->mask); +for_each_engine_masked (engine, i915, engine->mask, tmp) { +struct intel_context *kctx = engine->kernel_context; +struct active_node *node; +
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/i915_active.c void i915_active_fini(struct i915_active *ref) · line 286
Quoted 8 lines
drivers/gpu/drm/i915/i915_active.c +8
-0+ node =kmem_cache_alloc (global.slab_cache,GFP_KERNEL ); +if (unlikely (!node)) { + err = -ENOMEM ; +break ; + } + +i915_active_request_init (&node->base, + (void *)engine, node_retire);
In commit you promise that you will queue a request for kernel context. But in here, you seem to use (abuse!?) the active request to make a shadow of a request and use it to call the idle barriers.
So either the commit message needs tweaking or I don't have a slightest idea yet where we are flying in here :)
-Mika
Quoted 158 lines
Quoted 158 lines
Quoted 158 lines
drivers/gpu/drm/i915/i915_active.c +57
-0+ node->timeline = kctx->ring->timeline->fence_context; + node->ref = ref; + ref->count++; + +llist_add ((struct llist_node *)&node->base.link, + &ref->barriers); + } + +return err; +} + +void i915_active_acquire_barrier (struct i915_active *ref) +{ +struct llist_node *pos, *next; + +i915_active_acquire (ref); + +llist_for_each_safe (pos, next,llist_del_all (&ref->barriers)) { +struct intel_engine_cs *engine; +struct active_node *node; +struct rb_node **p, *parent; + + node =container_of ((struct list_head *)pos, +typeof (*node), base.link); + + engine = (void *)rcu_access_pointer (node->base.request); +RCU_INIT_POINTER (node->base.request,ERR_PTR (-EAGAIN )); + + parent =NULL ; + p = &ref->tree.rb_node; +while (*p) { + parent = *p; +if (rb_entry (parent, + struct active_node, + node)->timeline < node->timeline) + p = &parent->rb_right; +else + p = &parent->rb_left; + } +rb_link_node (&node->node, parent, p); +rb_insert_color (&node->node, &ref->tree); + +llist_add ((struct llist_node *)&node->base.link, + &engine->barrier_tasks); + } +i915_active_release (ref); +} + +void i915_request_add_barriers (struct i915_request *rq) +{ +struct intel_engine_cs *engine = rq->engine; +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) +list_add_tail ((struct list_head *)node, &rq->active_list); +} +int i915_active_request_set (struct i915_active_request *active,struct i915_request *rq) {drivers/gpu/drm/i915/i915_active.h +5
-0@@ -406,4 +406,9 @@ void i915_active_fini(struct i915_active *ref);static inline void i915_active_fini (struct i915_active *ref) { }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine); +void i915_active_acquire_barrier (struct i915_active *ref); +void i915_request_add_barriers (struct i915_request *rq); +#endif /* _I915_ACTIVE_H_ */ drivers/gpu/drm/i915/i915_active_types.h +3
-0@@ -7,6 +7,7 @@#ifndef _I915_ACTIVE_TYPES_H_#define _I915_ACTIVE_TYPES_H_ +#include <linux/llist.h> #include <linux/rbtree.h> #include <linux/rcupdate.h> @@ -31,6 +32,8 @@ struct i915_active {unsigned int count;void (*retire)(struct i915_active *ref); + + struct llist_head barriers; };#endif /* _I915_ACTIVE_TYPES_H_ */ drivers/gpu/drm/i915/i915_gem.c +0
-4@@ -1197,10 +1197,6 @@ void i915_gem_sanitize(struct drm_i915_private *i915)intel_uncore_forcewake_put (&i915->uncore,FORCEWAKE_ALL );intel_runtime_pm_put (i915, wakeref); - -mutex_lock (&i915->drm.struct_mutex); -i915_gem_contexts_lost (i915); -mutex_unlock (&i915->drm.struct_mutex); }void i915_gem_init_swizzling (struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/i915_request.c +0
-15@@ -213,18 +213,6 @@ static void __retire_engine_request(struct intel_engine_cs *engine,spin_unlock (&rq->lock);local_irq_enable (); - -/* -* The backing object for the context is done after switching to the -* *next* context. Therefore we cannot retire the previous context until -* the next context has already started running. However, since we -* cannot take the required locks at i915_request_submit() we -* defer the unpinning of the active context to now, retirement of -* the subsequent request. -*/ -if (engine->last_retired_context) -intel_context_unpin (engine->last_retired_context); - engine->last_retired_context = rq->hw_context; } static void __retire_engine_upto(struct intel_engine_cs *engine,@@ -759,9 +747,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) rq->infix = rq->ring->emit;/* end of header; start of user payload */ -/* Keep a second pin for the dual retirement along engine and ring */ -__intel_context_pin (ce); -intel_context_mark_active (ce);return rq;drivers/gpu/drm/i915/selftests/mock_gem_device.c +0
-1@@ -56,7 +56,6 @@ static void mock_device_release(struct drm_device *dev)mutex_lock (&i915->drm.struct_mutex);mock_device_flush (i915); -i915_gem_contexts_lost (i915);mutex_unlock (&i915->drm.struct_mutex);flush_work (&i915->gem.idle_work);Signature · 1 line
2.20.1
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
_______________________________________________
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: [PATCH 1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
Quoting Mika Kuoppala (2019-06-12 15:09:49)
Quoted 17 lines
Quoted 16 lines · Chris Wilson
Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/i915/i915_active.c +16
-0+int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine) +{ +struct drm_i915_private *i915 = engine->i915; +unsigned long tmp; +int err =0 ; + +GEM_BUG_ON (!engine->mask); +for_each_engine_masked (engine, i915, engine->mask, tmp) { +struct intel_context *kctx = engine->kernel_context; +struct active_node *node; + + node =kmem_cache_alloc (global.slab_cache,GFP_KERNEL ); +if (unlikely (!node)) { + err = -ENOMEM ; +break ;
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/i915_active.c void i915_active_fini(struct i915_active *ref) · line 286
Quoted 4 lines
drivers/gpu/drm/i915/i915_active.c +4
-0+ } + +i915_active_request_init (&node->base, + (void *)engine, node_retire);In commit you promise that you will queue a request for kernel context. But in here, you seem to use (abuse!?) the active request to make a shadow of a request and use it to call the idle barriers.
So this is preallocate, because we have to reserve some memory when pinning the context as we cannot allocate during unpinning (which can happen inside the shrinker).
Then on context unpin, we attach this preallocated node onto a list on the engine, all while keeping the context marked as still active.
Later on, when the engine is marked as idle we flush the barriers with a context switch to the kernel, see switch_to_kernel_context() in intel_engine_pm.c, and the i915_request_add_barriers().
The intention is that we also call i915_request_add_barriers() when emitting the heartbeat requests (once we eliminate the struct_mutex interposition) so that there is a regular idling pulse and contexts are not pinned for an eternity.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm/i915: Keep contexts pinned until after the next kernel context switch
In reply to Chris WilsonWe need to keep the context image pinned in memory until after the GPU has finished writing into it. Since it continues to write as we signal the final breadcrumb, we need to keep it pinned until the request after it is complete. Currently we know the order in which requests execute on each engine, and so to remove that presumption we need to identify a request/context-switch we know must occur after our completion. Any request queued after the signal must imply a context switch, for simplicity we use a fresh request from the kernel context.
The sequence of operations for keeping the context pinned until saved is:
- On context activation, we preallocate a node for each physical engine the context may operate on. This is to avoid allocations during unpinning, which may be from inside FS_RECLAIM context (aka the shrinker)
- On context deactivation on retirement of the last active request (which is before we know the context has been saved), we add the preallocated node onto a barrier list on each engine
- On engine idling, we emit a switch to kernel context. When this switch completes, we know that all previous contexts must have been saved, and so on retiring this request we can finally unpin all the contexts that were marked as deactivated prior to the switch.
We can enhance this in future by flushing all the idle contexts on a regular heartbeat pulse of a switch to kernel context, which will also be used to check for hung engines.
v2: intel_context_active_acquire/_release
--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++---- drivers/gpu/drm/i915/gem/i915_gem_context.h | 1 - drivers/gpu/drm/i915/gem/i915_gem_pm.c | 20 ++++- drivers/gpu/drm/i915/gt/intel_context.c | 80 ++++++++++++++++--- drivers/gpu/drm/i915/gt/intel_context.h | 3 + drivers/gpu/drm/i915/gt/intel_context_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_engine.h | 2 - drivers/gpu/drm/i915/gt/intel_engine_cs.c | 23 +----- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 + drivers/gpu/drm/i915/gt/intel_engine_types.h | 13 +-- drivers/gpu/drm/i915/gt/intel_lrc.c | 62 ++------------ drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 44 +--------- drivers/gpu/drm/i915/gt/mock_engine.c | 11 +-- drivers/gpu/drm/i915/i915_active.c | 78 ++++++++++++++++++ drivers/gpu/drm/i915/i915_active.h | 5 ++ drivers/gpu/drm/i915/i915_active_types.h | 3 + drivers/gpu/drm/i915/i915_gem.c | 4 - drivers/gpu/drm/i915/i915_request.c | 15 ---- .../gpu/drm/i915/selftests/mock_gem_device.c | 1 - 19 files changed, 213 insertions(+), 184 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +6 -18
@@ -692,17 +692,6 @@ int i915_gem_contexts_init(struct drm_i915_private *dev_priv)return 0 ; } -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv) -{ -struct intel_engine_cs *engine; -enum intel_engine_id id; - -lockdep_assert_held (&dev_priv->drm.struct_mutex); - -for_each_engine (engine, dev_priv, id) -intel_engine_lost_context (engine); -} -void i915_gem_contexts_fini (struct drm_i915_private *i915) {lockdep_assert_held (&i915->drm.struct_mutex);
@@ -1203,10 +1192,6 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)if (ret) goto out_add; - ret =gen8_emit_rpcs_config (rq, ce, sseu); -if (ret) - goto out_add; -/* * Guarantee context image and the timeline remains pinned until the * modifying request is retired by setting the ce activity tracker.
@@ -1214,9 +1199,12 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)* But we only need to take one pin on the account of it. Or in other * words transfer the pinned ce object to tracked active request. */ -if (!i915_active_request_isset (&ce->active_tracker)) -__intel_context_pin (ce); -__i915_active_request_set (&ce->active_tracker, rq); +GEM_BUG_ON (i915_active_is_idle (&ce->active)); + ret =i915_active_ref (&ce->active, rq->fence.context, rq); +if (ret) + goto out_add; + + ret =gen8_emit_rpcs_config (rq, ce, sseu); out_add:i915_request_add (rq);
drivers/gpu/drm/i915/gem/i915_gem_context.h +0 -1
@@ -134,7 +134,6 @@ static inline bool i915_gem_context_is_kernel(struct i915_gem_context *ctx)/* i915_gem_context.c */ int __must_check i915_gem_contexts_init (struct drm_i915_private *dev_priv); -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv);void i915_gem_contexts_fini (struct drm_i915_private *dev_priv); int i915_gem_context_open(struct drm_i915_private *i915,
drivers/gpu/drm/i915/gem/i915_gem_pm.c +19 -1
@@ -10,6 +10,22 @@#include "i915_drv.h" #include "i915_globals.h" +static void call_idle_barriers (struct intel_engine_cs *engine) +{ +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) { +struct i915_active_request *active = +container_of ((struct list_head *)node, +typeof (*active), link); + +INIT_LIST_HEAD (&active->link); +RCU_INIT_POINTER (active->request,NULL ); + + active->retire (active,NULL ); + } +} +static void i915_gem_park (struct drm_i915_private *i915) {struct intel_engine_cs *engine;
@@ -17,8 +33,10 @@ static void i915_gem_park(struct drm_i915_private *i915)lockdep_assert_held (&i915->drm.struct_mutex); -for_each_engine (engine, i915, id) +for_each_engine (engine, i915, id) { +call_idle_barriers (engine);/* cleanup after wedging */ i915_gem_batch_pool_fini (&engine->batch_pool); + }i915_timelines_park (i915);i915_vma_parked (i915);
drivers/gpu/drm/i915/gt/intel_context.c +71 -9
106 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_context.h +3 -0
@@ -102,6 +102,9 @@ static inline void intel_context_exit(struct intel_context *ce) ce->ops->exit (ce); } +int intel_context_active_acquire (struct intel_context *ce,unsigned long flags); +void intel_context_active_release (struct intel_context *ce); +static inline struct intel_context *intel_context_get (struct intel_context *ce) {kref_get (&ce->ref);
drivers/gpu/drm/i915/gt/intel_context_types.h +3 -3
@@ -56,10 +56,10 @@ struct intel_context {intel_engine_mask_t saturated;/* submitting semaphores too late? */ /** -* active_tracker: Active tracker for the external rq activity -* on this intel_context object. +* active: Active tracker for the rq activity (inc. external) on this +* intel_context object. */ -struct i915_active_request active_tracker; +struct i915_active active;const struct intel_context_ops *ops;
drivers/gpu/drm/i915/gt/intel_engine.h +0 -2
@@ -466,8 +466,6 @@ static inline void intel_engine_reset(struct intel_engine_cs *engine,bool intel_engine_is_idle (struct intel_engine_cs *engine);bool intel_engines_are_idle (struct drm_i915_private *dev_priv); -void intel_engine_lost_context (struct intel_engine_cs *engine); -void intel_engines_reset_default_submission (struct drm_i915_private *i915);unsigned int intel_engines_has_context_isolation (struct drm_i915_private *i915);
drivers/gpu/drm/i915/gt/intel_engine_cs.c +3 -20
@@ -611,6 +611,8 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine) {int err; +init_llist_head (&engine->barrier_tasks); + err =init_status_page (engine);if (err)return err;
@@ -870,6 +872,7 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)if (engine->preempt_context)intel_context_unpin (engine->preempt_context);intel_context_unpin (engine->kernel_context); +GEM_BUG_ON (!llist_empty (&engine->barrier_tasks));i915_timeline_fini (&engine->timeline);
@@ -1201,26 +1204,6 @@ void intel_engines_reset_default_submission(struct drm_i915_private *i915) engine->set_default_submission (engine); } -/** -* intel_engine_lost_context: called when the GPU is reset into unknown state -* @engine: the engine -* -* We have either reset the GPU or otherwise about to lose state tracking of -* the current GPU logical state (e.g. suspend). On next use, it is therefore -* imperative that we make no presumptions about the current state and load -* from scratch. -*/ -void intel_engine_lost_context (struct intel_engine_cs *engine) -{ -struct intel_context *ce; - -lockdep_assert_held (&engine->i915->drm.struct_mutex); - - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -} -bool intel_engine_can_store_dword (struct intel_engine_cs *engine) {switch (INTEL_GEN (engine->i915)) {
drivers/gpu/drm/i915/gt/intel_engine_pm.c +2 -0
@@ -88,6 +88,8 @@ static bool switch_to_kernel_context(struct intel_engine_cs *engine)/* Check again on the next retirement. */ engine->wakeref_serial = engine->serial +1 ; + +i915_request_add_barriers (rq);__i915_request_commit (rq);return false;
drivers/gpu/drm/i915/gt/intel_engine_types.h +2 -11
@@ -11,6 +11,7 @@#include <linux/irq_work.h> #include <linux/kref.h> #include <linux/list.h> +#include <linux/llist.h> #include <linux/types.h> #include "i915_gem.h"
@@ -288,6 +289,7 @@ struct intel_engine_cs {struct intel_ring *buffer;struct i915_timeline timeline; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */ struct intel_context *preempt_context;/* pinned; optional */
@@ -435,17 +437,6 @@ struct intel_engine_cs {struct intel_engine_execlists execlists; -/* Contexts are pinned whilst they are active on the GPU. The last -* context executed remains active whilst the GPU is idle - the -* switch away and write to the context object only occurs on the -* next execution. Contexts are only unpinned on retirement of the -* following request ensuring that we can always write to the object -* on the context switch even after idling. Across suspend, we switch -* to the kernel context and trash it as the save may not happen -* before the hardware is powered down. -*/ -struct intel_context *last_retired_context; -/* status_notifier: list of callbacks for context-switch changes */ struct atomic_notifier_head context_status_notifier;
drivers/gpu/drm/i915/gt/intel_lrc.c +8 -54
90 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_ringbuffer.c +4 -40
67 lines not on this page · raw message
drivers/gpu/drm/i915/gt/mock_engine.c +6 -5
@@ -146,12 +146,18 @@ static void mock_context_destroy(struct kref *ref)static int mock_context_pin (struct intel_context *ce) { +int ret; +if (!ce->ring) { ce->ring =mock_ring (ce->engine);if (!ce->ring)return -ENOMEM ; } + ret =intel_context_active_acquire (ce,PIN_HIGH ); +if (ret) +return ret; +mock_timeline_pin (ce->ring->timeline);return 0 ; }
@@ -328,14 +334,9 @@ void mock_engine_free(struct intel_engine_cs *engine) {struct mock_engine *mock =container_of (engine,typeof (*mock), base); -struct intel_context *ce;GEM_BUG_ON (timer_pending (&mock->hw_delay)); - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine);
drivers/gpu/drm/i915/i915_active.c +78 -0
90 lines not on this page · raw message
drivers/gpu/drm/i915/i915_active.h +5 -0
@@ -406,4 +406,9 @@ void i915_active_fini(struct i915_active *ref);static inline void i915_active_fini (struct i915_active *ref) { }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine); +void i915_active_acquire_barrier (struct i915_active *ref); +void i915_request_add_barriers (struct i915_request *rq); +#endif /* _I915_ACTIVE_H_ */
drivers/gpu/drm/i915/i915_active_types.h +3 -0
@@ -7,6 +7,7 @@#ifndef _I915_ACTIVE_TYPES_H_#define _I915_ACTIVE_TYPES_H_ +#include <linux/llist.h> #include <linux/rbtree.h> #include <linux/rcupdate.h>
@@ -31,6 +32,8 @@ struct i915_active {unsigned int count;void (*retire)(struct i915_active *ref); + + struct llist_head barriers; };#endif /* _I915_ACTIVE_TYPES_H_ */
drivers/gpu/drm/i915/i915_gem.c +0 -4
@@ -1197,10 +1197,6 @@ void i915_gem_sanitize(struct drm_i915_private *i915)intel_uncore_forcewake_put (&i915->uncore,FORCEWAKE_ALL );intel_runtime_pm_put (i915, wakeref); - -mutex_lock (&i915->drm.struct_mutex); -i915_gem_contexts_lost (i915); -mutex_unlock (&i915->drm.struct_mutex); }void i915_gem_init_swizzling (struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/i915_request.c +0 -15
@@ -213,18 +213,6 @@ static void __retire_engine_request(struct intel_engine_cs *engine,spin_unlock (&rq->lock);local_irq_enable (); - -/* -* The backing object for the context is done after switching to the -* *next* context. Therefore we cannot retire the previous context until -* the next context has already started running. However, since we -* cannot take the required locks at i915_request_submit() we -* defer the unpinning of the active context to now, retirement of -* the subsequent request. -*/ -if (engine->last_retired_context) -intel_context_unpin (engine->last_retired_context); - engine->last_retired_context = rq->hw_context; } static void __retire_engine_upto(struct intel_engine_cs *engine,
@@ -759,9 +747,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) rq->infix = rq->ring->emit;/* end of header; start of user payload */ -/* Keep a second pin for the dual retirement along engine and ring */ -__intel_context_pin (ce); -intel_context_mark_active (ce);return rq;
drivers/gpu/drm/i915/selftests/mock_gem_device.c +0 -1
@@ -56,7 +56,6 @@ static void mock_device_release(struct drm_device *dev)mutex_lock (&i915->drm.struct_mutex);mock_device_flush (i915); -i915_gem_contexts_lost (i915);mutex_unlock (&i915->drm.struct_mutex);flush_work (&i915->gem.idle_work);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2] drm/i915: Keep contexts pinned until after the next kernel context switch
Quoted 121 lines · Chris Wilson
We need to keep the context image pinned in memory until after the GPU has finished writing into it. Since it continues to write as we signal the final breadcrumb, we need to keep it pinned until the request after it is complete. Currently we know the order in which requests execute on each engine, and so to remove that presumption we need to identify a request/context-switch we know must occur after our completion. Any request queued after the signal must imply a context switch, for simplicity we use a fresh request from the kernel context.
The sequence of operations for keeping the context pinned until saved is:
- On context activation, we preallocate a node for each physical engine the context may operate on. This is to avoid allocations during unpinning, which may be from inside
FS_RECLAIMcontext (aka the shrinker)- On context deactivation on retirement of the last active request (which is before we know the context has been saved), we add the preallocated node onto a barrier list on each engine
- On engine idling, we emit a switch to kernel context. When this switch completes, we know that all previous contexts must have been saved, and so on retiring this request we can finally unpin all the contexts that were marked as deactivated prior to the switch.
We can enhance this in future by flushing all the idle contexts on a regular heartbeat pulse of a switch to kernel context, which will also be used to check for hung engines.
v2: intel_context_active_acquire/_release
Signed-off-by Chris Wilson <[email protected]>Cc Mika Kuoppala <[email protected]>--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++---- drivers/gpu/drm/i915/gem/i915_gem_context.h | 1 - drivers/gpu/drm/i915/gem/i915_gem_pm.c | 20 ++++- drivers/gpu/drm/i915/gt/intel_context.c | 80 ++++++++++++++++--- drivers/gpu/drm/i915/gt/intel_context.h | 3 + drivers/gpu/drm/i915/gt/intel_context_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_engine.h | 2 - drivers/gpu/drm/i915/gt/intel_engine_cs.c | 23 +----- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 + drivers/gpu/drm/i915/gt/intel_engine_types.h | 13 +-- drivers/gpu/drm/i915/gt/intel_lrc.c | 62 ++------------ drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 44 +--------- drivers/gpu/drm/i915/gt/mock_engine.c | 11 +-- drivers/gpu/drm/i915/i915_active.c | 78 ++++++++++++++++++ drivers/gpu/drm/i915/i915_active.h | 5 ++ drivers/gpu/drm/i915/i915_active_types.h | 3 + drivers/gpu/drm/i915/i915_gem.c | 4 - drivers/gpu/drm/i915/i915_request.c | 15 ---- .../gpu/drm/i915/selftests/mock_gem_device.c | 1 - 19 files changed, 213 insertions(+), 184 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_context.c +6
-18@@ -692,17 +692,6 @@ int i915_gem_contexts_init(struct drm_i915_private *dev_priv)return 0 ; } -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv) -{ -struct intel_engine_cs *engine; -enum intel_engine_id id; - -lockdep_assert_held (&dev_priv->drm.struct_mutex); - -for_each_engine (engine, dev_priv, id) -intel_engine_lost_context (engine); -} -void i915_gem_contexts_fini (struct drm_i915_private *i915) {lockdep_assert_held (&i915->drm.struct_mutex);@@ -1203,10 +1192,6 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)if (ret) goto out_add; - ret =gen8_emit_rpcs_config (rq, ce, sseu); -if (ret) - goto out_add; -/* * Guarantee context image and the timeline remains pinned until the * modifying request is retired by setting the ce activity tracker. @@ -1214,9 +1199,12 @@ gen8_modify_rpcs(struct intel_context *ce, struct intel_sseu sseu)* But we only need to take one pin on the account of it. Or in other * words transfer the pinned ce object to tracked active request. */ -if (!i915_active_request_isset (&ce->active_tracker)) -__intel_context_pin (ce); -__i915_active_request_set (&ce->active_tracker, rq); +GEM_BUG_ON (i915_active_is_idle (&ce->active)); + ret =i915_active_ref (&ce->active, rq->fence.context, rq); +if (ret) + goto out_add; + + ret =gen8_emit_rpcs_config (rq, ce, sseu); out_add:i915_request_add (rq);drivers/gpu/drm/i915/gem/i915_gem_context.h +0
-1@@ -134,7 +134,6 @@ static inline bool i915_gem_context_is_kernel(struct i915_gem_context *ctx)/* i915_gem_context.c */ int __must_check i915_gem_contexts_init (struct drm_i915_private *dev_priv); -void i915_gem_contexts_lost (struct drm_i915_private *dev_priv);void i915_gem_contexts_fini (struct drm_i915_private *dev_priv); int i915_gem_context_open(struct drm_i915_private *i915,drivers/gpu/drm/i915/gem/i915_gem_pm.c +0
-0
drivers/gpu/drm/i915/gem/i915_gem_pm.c line 17
Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_pm.c +5
-0@@ -10,6 +10,22 @@#include "i915_drv.h" #include "i915_globals.h" +static void call_idle_barriers (struct intel_engine_cs *engine) +{ +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) {
Seems to be null safe.
Quoted 39 lines
drivers/gpu/drm/i915/gem/i915_gem_pm.c +14
-1+struct i915_active_request *active = +container_of ((struct list_head *)node, +typeof (*active), link); + +INIT_LIST_HEAD (&active->link); +RCU_INIT_POINTER (active->request,NULL ); + + active->retire (active,NULL ); + } +} +static void i915_gem_park (struct drm_i915_private *i915) {struct intel_engine_cs *engine;@@ -17,8 +33,10 @@ static void i915_gem_park(struct drm_i915_private *i915)lockdep_assert_held (&i915->drm.struct_mutex); -for_each_engine (engine, i915, id) +for_each_engine (engine, i915, id) { +call_idle_barriers (engine);/* cleanup after wedging */ i915_gem_batch_pool_fini (&engine->batch_pool); + }i915_timelines_park (i915);i915_vma_parked (i915);drivers/gpu/drm/i915/gt/intel_context.c +0
-1@@ -61,7 +61,6 @@ int __intel_context_do_pin(struct intel_context *ce)i915_gem_context_get (ce->gem_context);/* for ctx->ppgtt */ -intel_context_get (ce);smp_mb__before_atomic ();/* flush pin before it is visible */ }
drivers/gpu/drm/i915/gt/intel_context.c void intel_context_unpin(struct intel_context *ce) · line 91
Quoted 5 lines
drivers/gpu/drm/i915/gt/intel_context.c +1
-1@@ -89,20 +88,45 @@ void intel_context_unpin(struct intel_context *ce) ce->ops->unpin (ce);i915_gem_context_put (ce->gem_context); -intel_context_put (ce); +intel_context_active_release (ce);
Not going to insist any change in naming but I was thinking here that we arm the barriers.
drivers/gpu/drm/i915/gt/intel_context.c void intel_context_unpin(struct intel_context *ce) · line 100
Quoted 13 lines
drivers/gpu/drm/i915/gt/intel_context.c +2
-4}mutex_unlock (&ce->pin_mutex);intel_context_put (ce); } -static void intel_context_retire (struct i915_active_request *active, -struct i915_request *rq) +static int __context_pin_state (struct i915_vma *vma,unsigned long flags) { -struct intel_context *ce = -container_of (active,typeof (*ce), active_tracker); +int err;
Why not ret? I have started to removing errs. Am I swimming in upstream? :P
Quoted 57 lines
drivers/gpu/drm/i915/gt/intel_context.c +46
-3-intel_context_unpin (ce); + err =i915_vma_pin (vma,0 ,0 , flags |PIN_GLOBAL ); +if (err) +return err; + +/* +* And mark it as a globally pinned object to let the shrinker know +* it cannot reclaim the object until we release it. +*/ + vma->obj->pin_global++; + vma->obj->mm.dirty = true; + +return 0 ; +} + +static void __context_unpin_state (struct i915_vma *vma) +{ + vma->obj->pin_global--; +__i915_vma_unpin (vma); +} + +static void intel_context_retire (struct i915_active *active) +{ +struct intel_context *ce =container_of (active,typeof (*ce), active); + +if (ce->state) +__context_unpin_state (ce->state); + +intel_context_put (ce); }void @@ -125,8 +149,46 @@ intel_context_init(struct intel_context *ce,mutex_init (&ce->pin_mutex); -i915_active_request_init (&ce->active_tracker, -NULL , intel_context_retire); +i915_active_init (ctx->i915, &ce->active, intel_context_retire); +} + +int intel_context_active_acquire (struct intel_context *ce,unsigned long flags) +{ +int err; + +if (!i915_active_acquire (&ce->active)) +return 0 ; + +intel_context_get (ce); + +if (!ce->state) +return 0 ; + + err =__context_pin_state (ce->state, flags); +if (err) { +i915_active_cancel (&ce->active);
drivers/gpu/drm/i915/gt/intel_context.c intel_context_init(struct intel_context *ce, · line 179
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_context.c +10
-0+intel_context_put (ce); +return err; + } + +/* Preallocate tracking nodes */ +if (!i915_gem_context_is_kernel (ce->gem_context)) { + err =i915_active_acquire_preallocate_barrier (&ce->active, + ce->engine); +if (err) { +i915_active_release (&ce->active);
For me it looks like we are missing context put in here.
Quoted 491 lines
drivers/gpu/drm/i915/gt/intel_context.c +12
-0+return err; + } + } + +return 0 ; +} + +void intel_context_active_release (struct intel_context *ce) +{ +/* Nodes preallocated in intel_context_active() */ +i915_active_acquire_barrier (&ce->active); +i915_active_release (&ce->active); }static void i915_global_context_shrink (void )drivers/gpu/drm/i915/gt/intel_context.h +3
-0@@ -102,6 +102,9 @@ static inline void intel_context_exit(struct intel_context *ce) ce->ops->exit (ce); } +int intel_context_active_acquire (struct intel_context *ce,unsigned long flags); +void intel_context_active_release (struct intel_context *ce); +static inline struct intel_context *intel_context_get (struct intel_context *ce) {kref_get (&ce->ref);drivers/gpu/drm/i915/gt/intel_context_types.h +3
-3@@ -56,10 +56,10 @@ struct intel_context {intel_engine_mask_t saturated;/* submitting semaphores too late? */ /** -* active_tracker: Active tracker for the external rq activity -* on this intel_context object. +* active: Active tracker for the rq activity (inc. external) on this +* intel_context object. */ -struct i915_active_request active_tracker; +struct i915_active active;const struct intel_context_ops *ops;drivers/gpu/drm/i915/gt/intel_engine.h +0
-2@@ -466,8 +466,6 @@ static inline void intel_engine_reset(struct intel_engine_cs *engine,bool intel_engine_is_idle (struct intel_engine_cs *engine);bool intel_engines_are_idle (struct drm_i915_private *dev_priv); -void intel_engine_lost_context (struct intel_engine_cs *engine); -void intel_engines_reset_default_submission (struct drm_i915_private *i915);unsigned int intel_engines_has_context_isolation (struct drm_i915_private *i915);drivers/gpu/drm/i915/gt/intel_engine_cs.c +3
-20@@ -611,6 +611,8 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine) {int err; +init_llist_head (&engine->barrier_tasks); + err =init_status_page (engine);if (err)return err;@@ -870,6 +872,7 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)if (engine->preempt_context)intel_context_unpin (engine->preempt_context);intel_context_unpin (engine->kernel_context); +GEM_BUG_ON (!llist_empty (&engine->barrier_tasks));i915_timeline_fini (&engine->timeline);@@ -1201,26 +1204,6 @@ void intel_engines_reset_default_submission(struct drm_i915_private *i915) engine->set_default_submission (engine); } -/** -* intel_engine_lost_context: called when the GPU is reset into unknown state -* @engine: the engine -* -* We have either reset the GPU or otherwise about to lose state tracking of -* the current GPU logical state (e.g. suspend). On next use, it is therefore -* imperative that we make no presumptions about the current state and load -* from scratch. -*/ -void intel_engine_lost_context (struct intel_engine_cs *engine) -{ -struct intel_context *ce; - -lockdep_assert_held (&engine->i915->drm.struct_mutex); - - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -} -bool intel_engine_can_store_dword (struct intel_engine_cs *engine) {switch (INTEL_GEN (engine->i915)) {drivers/gpu/drm/i915/gt/intel_engine_pm.c +2
-0@@ -88,6 +88,8 @@ static bool switch_to_kernel_context(struct intel_engine_cs *engine)/* Check again on the next retirement. */ engine->wakeref_serial = engine->serial +1 ; + +i915_request_add_barriers (rq);__i915_request_commit (rq);return false;drivers/gpu/drm/i915/gt/intel_engine_types.h +2
-11@@ -11,6 +11,7 @@#include <linux/irq_work.h> #include <linux/kref.h> #include <linux/list.h> +#include <linux/llist.h> #include <linux/types.h> #include "i915_gem.h" @@ -288,6 +289,7 @@ struct intel_engine_cs {struct intel_ring *buffer;struct i915_timeline timeline; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */ struct intel_context *preempt_context;/* pinned; optional */ @@ -435,17 +437,6 @@ struct intel_engine_cs {struct intel_engine_execlists execlists; -/* Contexts are pinned whilst they are active on the GPU. The last -* context executed remains active whilst the GPU is idle - the -* switch away and write to the context object only occurs on the -* next execution. Contexts are only unpinned on retirement of the -* following request ensuring that we can always write to the object -* on the context switch even after idling. Across suspend, we switch -* to the kernel context and trash it as the save may not happen -* before the hardware is powered down. -*/ -struct intel_context *last_retired_context; -/* status_notifier: list of callbacks for context-switch changes */ struct atomic_notifier_head context_status_notifier;drivers/gpu/drm/i915/gt/intel_lrc.c +8
-54@@ -1422,60 +1422,11 @@ static void execlists_context_destroy(struct kref *kref)intel_context_free (ce); } -static int __context_pin (struct i915_vma *vma) -{ -unsigned int flags; -int err; - - flags =PIN_GLOBAL |PIN_HIGH ; - flags |=PIN_OFFSET_BIAS |i915_ggtt_pin_bias (vma); - - err =i915_vma_pin (vma,0 ,0 , flags); -if (err) -return err; - - vma->obj->pin_global++; - vma->obj->mm.dirty = true; - -return 0 ; -} - -static void __context_unpin (struct i915_vma *vma) -{ - vma->obj->pin_global--; -__i915_vma_unpin (vma); -} -static void execlists_context_unpin (struct intel_context *ce) { -struct intel_engine_cs *engine; - -/* -* The tasklet may still be using a pointer to our state, via an -* old request. However, since we know we only unpin the context -* on retirement of the following request, we know that the last -* request referencing us will have had a completion CS interrupt. -* If we see that it is still active, it means that the tasklet hasn't -* had the chance to run yet; let it run before we teardown the -* reference it may use. -*/ - engine =READ_ONCE (ce->inflight); -if (unlikely (engine)) { -unsigned long flags; - -spin_lock_irqsave (&engine->timeline.lock, flags); -process_csb (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); - -GEM_BUG_ON (READ_ONCE (ce->inflight)); - } -i915_gem_context_unpin_hw_id (ce->gem_context); - -intel_ring_unpin (ce->ring); -i915_gem_object_unpin_map (ce->state->obj); -__context_unpin (ce->state); +intel_ring_unpin (ce->ring); } static void@@ -1512,7 +1463,10 @@ __execlists_context_pin(struct intel_context *ce, goto err;GEM_BUG_ON (!ce->state); - ret =__context_pin (ce->state); + ret =intel_context_active_acquire (ce, + engine->i915->ggtt.pin_bias | +PIN_OFFSET_BIAS | +PIN_HIGH );if (ret) goto err;@@ -1521,7 +1475,7 @@ __execlists_context_pin(struct intel_context *ce, I915_MAP_OVERRIDE);if (IS_ERR (vaddr)) { ret =PTR_ERR (vaddr); - goto unpin_vma; + goto unpin_active; } ret =intel_ring_pin (ce->ring);@@ -1542,8 +1496,8 @@ __execlists_context_pin(struct intel_context *ce,intel_ring_unpin (ce->ring); unpin_map:i915_gem_object_unpin_map (ce->state->obj); -unpin_vma: -__context_unpin (ce->state); +unpin_active: +intel_context_active_release (ce); err:return ret; }drivers/gpu/drm/i915/gt/intel_ringbuffer.c +4
-40@@ -1349,45 +1349,9 @@ static void __context_unpin_ppgtt(struct i915_gem_context *ctx)gen6_ppgtt_unpin (i915_vm_to_ppgtt (vm)); } -static int __context_pin (struct intel_context *ce) -{ -struct i915_vma *vma; -int err; - - vma = ce->state; -if (!vma) -return 0 ; - - err =i915_vma_pin (vma,0 ,0 ,PIN_GLOBAL |PIN_HIGH ); -if (err) -return err; - -/* -* And mark is as a globally pinned object to let the shrinker know -* it cannot reclaim the object until we release it. -*/ - vma->obj->pin_global++; - vma->obj->mm.dirty = true; - -return 0 ; -} - -static void __context_unpin (struct intel_context *ce) -{ -struct i915_vma *vma; - - vma = ce->state; -if (!vma) -return ; - - vma->obj->pin_global--; -i915_vma_unpin (vma); -} -static void ring_context_unpin (struct intel_context *ce) {__context_unpin_ppgtt (ce->gem_context); -__context_unpin (ce); } static struct i915_vma *@@ -1477,18 +1441,18 @@ static int ring_context_pin(struct intel_context *ce) ce->state = vma; } - err =__context_pin (ce); + err =intel_context_active_acquire (ce,PIN_HIGH );if (err)return err; err =__context_pin_ppgtt (ce->gem_context);if (err) - goto err_unpin; + goto err_active;return 0 ; -err_unpin: -__context_unpin (ce); +err_active: +intel_context_active_release (ce);return err; }drivers/gpu/drm/i915/gt/mock_engine.c +6
-5@@ -146,12 +146,18 @@ static void mock_context_destroy(struct kref *ref)static int mock_context_pin (struct intel_context *ce) { +int ret; +if (!ce->ring) { ce->ring =mock_ring (ce->engine);if (!ce->ring)return -ENOMEM ; } + ret =intel_context_active_acquire (ce,PIN_HIGH ); +if (ret) +return ret; +mock_timeline_pin (ce->ring->timeline);return 0 ; }@@ -328,14 +334,9 @@ void mock_engine_free(struct intel_engine_cs *engine) {struct mock_engine *mock =container_of (engine,typeof (*mock), base); -struct intel_context *ce;GEM_BUG_ON (timer_pending (&mock->hw_delay)); - ce =fetch_and_zero (&engine->last_retired_context); -if (ce) -intel_context_unpin (ce); -intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine);drivers/gpu/drm/i915/i915_active.c +78
-0@@ -157,6 +157,7 @@ void i915_active_init(struct drm_i915_private *i915, ref->retire = retire; ref->tree =RB_ROOT ;i915_active_request_init (&ref->last,NULL , last_retire); +init_llist_head (&ref->barriers); ref->count =0 ; }@@ -263,6 +264,83 @@ void i915_active_fini(struct i915_active *ref) }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine) +{ +struct drm_i915_private *i915 = engine->i915; +unsigned long tmp; +int err =0 ; + +GEM_BUG_ON (!engine->mask); +for_each_engine_masked (engine, i915, engine->mask, tmp) { +struct intel_context *kctx = engine->kernel_context; +struct active_node *node; + + node =kmem_cache_alloc (global.slab_cache,GFP_KERNEL ); +if (unlikely (!node)) { + err = -ENOMEM ; +break ; + } + +i915_active_request_init (&node->base, + (void *)engine, node_retire); + node->timeline = kctx->ring->timeline->fence_context; + node->ref = ref; + ref->count++; + +llist_add ((struct llist_node *)&node->base.link, + &ref->barriers); + } + +return err; +} + +void i915_active_acquire_barrier (struct i915_active *ref) +{ +struct llist_node *pos, *next; + +i915_active_acquire (ref); + +llist_for_each_safe (pos, next,llist_del_all (&ref->barriers)) { +struct intel_engine_cs *engine; +struct active_node *node; +struct rb_node **p, *parent; + + node =container_of ((struct list_head *)pos, +typeof (*node), base.link); + + engine = (void *)rcu_access_pointer (node->base.request); +RCU_INIT_POINTER (node->base.request,ERR_PTR (-EAGAIN )); + + parent =NULL ; + p = &ref->tree.rb_node; +while (*p) { + parent = *p; +if (rb_entry (parent, + struct active_node, + node)->timeline < node->timeline) + p = &parent->rb_right; +else + p = &parent->rb_left; + } +rb_link_node (&node->node, parent, p); +rb_insert_color (&node->node, &ref->tree); + +llist_add ((struct llist_node *)&node->base.link, + &engine->barrier_tasks); + } +i915_active_release (ref); +} + +void i915_request_add_barriers (struct i915_request *rq) +{ +struct intel_engine_cs *engine = rq->engine; +struct llist_node *node, *next; + +llist_for_each_safe (node, next,llist_del_all (&engine->barrier_tasks)) +list_add_tail ((struct list_head *)node, &rq->active_list); +} +int i915_active_request_set (struct i915_active_request *active,struct i915_request *rq) {drivers/gpu/drm/i915/i915_active.h +5
-0@@ -406,4 +406,9 @@ void i915_active_fini(struct i915_active *ref);static inline void i915_active_fini (struct i915_active *ref) { }#endif +int i915_active_acquire_preallocate_barrier (struct i915_active *ref, +struct intel_engine_cs *engine); +void i915_active_acquire_barrier (struct i915_active *ref); +void i915_request_add_barriers (struct i915_request *rq); +#endif /* _I915_ACTIVE_H_ */ drivers/gpu/drm/i915/i915_active_types.h +1
-0@@ -7,6 +7,7 @@#ifndef _I915_ACTIVE_TYPES_H_#define _I915_ACTIVE_TYPES_H_ +#include <linux/llist.h> #include <linux/rbtree.h> #include <linux/rcupdate.h>
drivers/gpu/drm/i915/i915_active_types.h struct i915_active { · line 36
Quoted 5 lines
drivers/gpu/drm/i915/i915_active_types.h +2
-0@@ -31,6 +32,8 @@ struct i915_active {unsigned int count;void (*retire)(struct i915_active *ref); + +struct llist_head barriers;
This looks like it is generic. Are you planning to extend?
/* Preallocated slots of per engine barriers */
-Mika
Quoted 65 lines
drivers/gpu/drm/i915/i915_active_types.h +0
-0};#endif /* _I915_ACTIVE_TYPES_H_ */ drivers/gpu/drm/i915/i915_gem.c +0
-4@@ -1197,10 +1197,6 @@ void i915_gem_sanitize(struct drm_i915_private *i915)intel_uncore_forcewake_put (&i915->uncore,FORCEWAKE_ALL );intel_runtime_pm_put (i915, wakeref); - -mutex_lock (&i915->drm.struct_mutex); -i915_gem_contexts_lost (i915); -mutex_unlock (&i915->drm.struct_mutex); }void i915_gem_init_swizzling (struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/i915_request.c +0
-15@@ -213,18 +213,6 @@ static void __retire_engine_request(struct intel_engine_cs *engine,spin_unlock (&rq->lock);local_irq_enable (); - -/* -* The backing object for the context is done after switching to the -* *next* context. Therefore we cannot retire the previous context until -* the next context has already started running. However, since we -* cannot take the required locks at i915_request_submit() we -* defer the unpinning of the active context to now, retirement of -* the subsequent request. -*/ -if (engine->last_retired_context) -intel_context_unpin (engine->last_retired_context); - engine->last_retired_context = rq->hw_context; } static void __retire_engine_upto(struct intel_engine_cs *engine,@@ -759,9 +747,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) rq->infix = rq->ring->emit;/* end of header; start of user payload */ -/* Keep a second pin for the dual retirement along engine and ring */ -__intel_context_pin (ce); -intel_context_mark_active (ce);return rq;drivers/gpu/drm/i915/selftests/mock_gem_device.c +0
-1@@ -56,7 +56,6 @@ static void mock_device_release(struct drm_device *dev)mutex_lock (&i915->drm.struct_mutex);mock_device_flush (i915); -i915_gem_contexts_lost (i915);mutex_unlock (&i915->drm.struct_mutex);flush_work (&i915->gem.idle_work);Signature · 1 line
2.20.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2] drm/i915: Keep contexts pinned until after the next kernel context switch
Quoting Mika Kuoppala (2019-06-14 10:22:16)
Quoted 16 lines
Quoted 15 lines · Chris Wilson
drivers/gpu/drm/i915/gt/intel_context.c +0
-1@@ -61,7 +61,6 @@ int __intel_context_do_pin(struct intel_context *ce)i915_gem_context_get (ce->gem_context);/* for ctx->ppgtt */ -intel_context_get (ce);smp_mb__before_atomic ();/* flush pin before it is visible */ }@@ -89,20 +88,45 @@ void intel_context_unpin(struct intel_context *ce) ce->ops->unpin (ce);
Quoted 6 lines
drivers/gpu/drm/i915/gt/intel_context.c void intel_context_unpin(struct intel_context *ce) · line 91
Quoted 3 lines
drivers/gpu/drm/i915/gt/intel_context.c +1
-1i915_gem_context_put (ce->gem_context); -intel_context_put (ce); +intel_context_active_release (ce);Not going to insist any change in naming but I was thinking here that we arm the barriers.
Not keen, not for changing just _release as we end up with _acquire/_arm and that does not seem symmetrical.
_release_deferred() _release_barrier() perhaps, but no need to differentiate yet. _release_barrier() winning so far.
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/gt/intel_context.c +0
-0mutex_unlock (&ce->pin_mutex);intel_context_put (ce); }
Quoted 9 lines
drivers/gpu/drm/i915/gt/intel_context.c void intel_context_unpin(struct intel_context *ce) · line 100
Quoted 7 lines
drivers/gpu/drm/i915/gt/intel_context.c +2
-4-static void intel_context_retire (struct i915_active_request *active, -struct i915_request *rq) +static int __context_pin_state (struct i915_vma *vma,unsigned long flags) { -struct intel_context *ce = -container_of (active,typeof (*ce), active_tracker); +int err;Why not ret? I have started to removing errs. Am I swimming in upstream? :P
We've been replacing ret with err (where it makes more sense to ask "if (error) do error_path;) for a few years. :-p
Quoted 34 lines
Quoted 34 lines
drivers/gpu/drm/i915/gt/intel_context.c +32
-1-intel_context_unpin (ce); + err =i915_vma_pin (vma,0 ,0 , flags |PIN_GLOBAL ); +if (err) +return err; + +/* +* And mark it as a globally pinned object to let the shrinker know +* it cannot reclaim the object until we release it. +*/ + vma->obj->pin_global++; + vma->obj->mm.dirty = true; + +return 0 ; +} +int intel_context_active_acquire (struct intel_context *ce,unsigned long flags) +{ +int err; + +if (!i915_active_acquire (&ce->active)) +return 0 ; + +intel_context_get (ce); + +if (!ce->state) +return 0 ; + + err =__context_pin_state (ce->state, flags); +if (err) { +i915_active_cancel (&ce->active); +intel_context_put (ce); +return err; + } +
Quoted 8 lines
drivers/gpu/drm/i915/gt/intel_context.c intel_context_init(struct intel_context *ce, · line 179
Quoted 6 lines
drivers/gpu/drm/i915/gt/intel_context.c +6
-0+/* Preallocate tracking nodes */ +if (!i915_gem_context_is_kernel (ce->gem_context)) { + err =i915_active_acquire_preallocate_barrier (&ce->active, + ce->engine); +if (err) { +i915_active_release (&ce->active);For me it looks like we are missing context put in here.
Crazy huh :) We are at the point where it is safer to release than unwind; i915_active_cancel is quite ugly.
It does get a bit simpler later on when we rewrite i915_active and drive this as an acquire callback.
Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/i915/i915_active_types.h +1
-0@@ -7,6 +7,7 @@#ifndef _I915_ACTIVE_TYPES_H_#define _I915_ACTIVE_TYPES_H_ +#include <linux/llist.h> #include <linux/rbtree.h> #include <linux/rcupdate.h>
Quoted 8 lines
drivers/gpu/drm/i915/i915_active_types.h struct i915_active { · line 36
Quoted 6 lines
drivers/gpu/drm/i915/i915_active_types.h +2
-0@@ -31,6 +32,8 @@ struct i915_active {unsigned int count;void (*retire)(struct i915_active *ref); + +struct llist_head barriers;This looks like it is generic. Are you planning to extend?
Only user so far far. But i915_active is our answer to reservation_object on steroids, so itself should be quite generic. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Mika Kuoppala
Reviewed-byRe: [PATCH v2] drm/i915: Keep contexts pinned until after the next kernel context switch
Quoted 90 lines · Chris Wilson
Quoting Mika Kuoppala (2019-06-14 10:22:16)
Quoted 16 lines
Quoted 15 lines · Chris Wilson
drivers/gpu/drm/i915/gt/intel_context.c +0
-1@@ -61,7 +61,6 @@ int __intel_context_do_pin(struct intel_context *ce)i915_gem_context_get (ce->gem_context);/* for ctx->ppgtt */ -intel_context_get (ce);smp_mb__before_atomic ();/* flush pin before it is visible */ }@@ -89,20 +88,45 @@ void intel_context_unpin(struct intel_context *ce) ce->ops->unpin (ce);Quoted 6 lines
drivers/gpu/drm/i915/gt/intel_context.c void intel_context_unpin(struct intel_context *ce) · line 91
Quoted 3 lines
drivers/gpu/drm/i915/gt/intel_context.c +1
-1i915_gem_context_put (ce->gem_context); -intel_context_put (ce); +intel_context_active_release (ce);Not going to insist any change in naming but I was thinking here that we arm the barriers.
Not keen, not for changing just
_releaseas we end up with _acquire/_arm and that does not seem symmetrical.
_release_deferred()_release_barrier()perhaps, but no need to differentiate yet._release_barrier()winning so far.Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/gt/intel_context.c +0
-0mutex_unlock (&ce->pin_mutex);intel_context_put (ce); }Quoted 9 lines
drivers/gpu/drm/i915/gt/intel_context.c void intel_context_unpin(struct intel_context *ce) · line 100
Quoted 7 lines
drivers/gpu/drm/i915/gt/intel_context.c +2
-4-static void intel_context_retire (struct i915_active_request *active, -struct i915_request *rq) +static int __context_pin_state (struct i915_vma *vma,unsigned long flags) { -struct intel_context *ce = -container_of (active,typeof (*ce), active_tracker); +int err;Why not ret? I have started to removing errs. Am I swimming in upstream? :P
We've been replacing ret with err (where it makes more sense to ask "if (error) do
error_path;) for a few years. :-pQuoted 34 lines
Quoted 34 lines
drivers/gpu/drm/i915/gt/intel_context.c +32
-1-intel_context_unpin (ce); + err =i915_vma_pin (vma,0 ,0 , flags |PIN_GLOBAL ); +if (err) +return err; + +/* +* And mark it as a globally pinned object to let the shrinker know +* it cannot reclaim the object until we release it. +*/ + vma->obj->pin_global++; + vma->obj->mm.dirty = true; + +return 0 ; +} +int intel_context_active_acquire (struct intel_context *ce,unsigned long flags) +{ +int err; + +if (!i915_active_acquire (&ce->active)) +return 0 ; + +intel_context_get (ce); + +if (!ce->state) +return 0 ; + + err =__context_pin_state (ce->state, flags); +if (err) { +i915_active_cancel (&ce->active); +intel_context_put (ce); +return err; + } +Quoted 8 lines
drivers/gpu/drm/i915/gt/intel_context.c intel_context_init(struct intel_context *ce, · line 179
Quoted 6 lines
drivers/gpu/drm/i915/gt/intel_context.c +6
-0+/* Preallocate tracking nodes */ +if (!i915_gem_context_is_kernel (ce->gem_context)) { + err =i915_active_acquire_preallocate_barrier (&ce->active, + ce->engine); +if (err) { +i915_active_release (&ce->active);For me it looks like we are missing context put in here.
Quoted 3 lines
Crazy huh :) We are at the point where it is safer to release than unwind;
i915_active_cancelis quite ugly.
Ok so the retirement of active releases the context ref we have.
And you add to the ref->count on moving to the barriers list so partially done engine masks should still be covered.
Quoted 24 lines
It does get a bit simpler later on when we rewrite
i915_activeand drive this as an acquire callback.Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/i915/i915_active_types.h +1
-0@@ -7,6 +7,7 @@#ifndef _I915_ACTIVE_TYPES_H_#define _I915_ACTIVE_TYPES_H_ +#include <linux/llist.h> #include <linux/rbtree.h> #include <linux/rcupdate.h> Quoted 8 lines
drivers/gpu/drm/i915/i915_active_types.h struct i915_active { · line 36
Quoted 6 lines
drivers/gpu/drm/i915/i915_active_types.h +2
-0@@ -31,6 +32,8 @@ struct i915_active {unsigned int count;void (*retire)(struct i915_active *ref); + +struct llist_head barriers;This looks like it is generic. Are you planning to extend?
Quoted 3 lines
Only user so far far. But
i915_activeis our answer toreservation_objecton steroids, so itself should be quite generic. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/8 drm/i915: Stop retiring along engine
In reply to Chris WilsonWe no longer track the execution order along the engine and so no longer need to enforce ordering of retire along the engine.
--- drivers/gpu/drm/i915/i915_request.c | 128 +++++++++++----------------- 1 file changed, 52 insertions(+), 76 deletions(-)
drivers/gpu/drm/i915/i915_request.c +52 -76
@@ -183,72 +183,23 @@ static void free_capture_list(struct i915_request *request) } } -static void __retire_engine_request (struct intel_engine_cs *engine, -struct i915_request *rq) -{ -GEM_TRACE ("%s(%s) fence %llx:%lld, current %d\n" , - __func__, engine->name, - rq->fence.context, rq->fence.seqno, -hwsp_seqno (rq)); - -GEM_BUG_ON (!i915_request_completed (rq)); - -local_irq_disable (); - -spin_lock (&engine->timeline.lock); -GEM_BUG_ON (!list_is_first (&rq->link, &engine->timeline.requests)); -list_del_init (&rq->link); -spin_unlock (&engine->timeline.lock); - -spin_lock (&rq->lock); -i915_request_mark_complete (rq); -if (!i915_request_signaled (rq)) -dma_fence_signal_locked (&rq->fence); -if (test_bit (DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT , &rq->fence.flags)) -i915_request_cancel_breadcrumb (rq); -if (rq->waitboost) { -GEM_BUG_ON (!atomic_read (&rq->i915->gt_pm.rps.num_waiters)); -atomic_dec (&rq->i915->gt_pm.rps.num_waiters); - } -spin_unlock (&rq->lock); - -local_irq_enable (); -} - -static void __retire_engine_upto (struct intel_engine_cs *engine, -struct i915_request *rq) -{ -struct i915_request *tmp; - -if (list_empty (&rq->link)) -return ; - -do { - tmp =list_first_entry (&engine->timeline.requests, -typeof (*tmp), link); - -GEM_BUG_ON (tmp->engine != engine); -__retire_engine_request (engine, tmp); - }while (tmp != rq); -} - -static void i915_request_retire (struct i915_request *request) +static bool i915_request_retire (struct i915_request *rq) {struct i915_active_request *active, *next; -GEM_TRACE ("%s fence %llx:%lld, current %d\n" , - request->engine->name, - request->fence.context, request->fence.seqno, -hwsp_seqno (request)); +lockdep_assert_held (&rq->i915->drm.struct_mutex); +if (!i915_request_completed (rq)) +return false; -lockdep_assert_held (&request->i915->drm.struct_mutex); -GEM_BUG_ON (!i915_sw_fence_signaled (&request->submit)); -GEM_BUG_ON (!i915_request_completed (request)); +GEM_TRACE ("%s fence %llx:%lld, current %d\n" , + rq->engine->name, + rq->fence.context, rq->fence.seqno, +hwsp_seqno (rq)); -trace_i915_request_retire (request); +GEM_BUG_ON (!i915_sw_fence_signaled (&rq->submit)); +trace_i915_request_retire (rq); -advance_ring (request); -free_capture_list (request); +advance_ring (rq);/* * Walk through the active list, calling retire on each. This allows
@@ -260,7 +211,7 @@ static void i915_request_retire(struct i915_request *request)* pass along the auxiliary information (to avoid dereferencing * the node after the callback). */ -list_for_each_entry_safe (active, next, &request->active_list, link) { +list_for_each_entry_safe (active, next, &rq->active_list, link) {/* * In microbenchmarks or focusing upon time inside the kernel, * we may spend an inordinate amount of time simply handling
@@ -276,18 +227,39 @@ static void i915_request_retire(struct i915_request *request)INIT_LIST_HEAD (&active->link);RCU_INIT_POINTER (active->request,NULL ); - active->retire (active, request); + active->retire (active, rq); + } + +local_irq_disable (); + +spin_lock (&rq->engine->timeline.lock); +list_del (&rq->link); +spin_unlock (&rq->engine->timeline.lock); + +spin_lock (&rq->lock); +i915_request_mark_complete (rq); +if (!i915_request_signaled (rq)) +dma_fence_signal_locked (&rq->fence); +if (test_bit (DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT , &rq->fence.flags)) +i915_request_cancel_breadcrumb (rq); +if (rq->waitboost) { +GEM_BUG_ON (!atomic_read (&rq->i915->gt_pm.rps.num_waiters)); +atomic_dec (&rq->i915->gt_pm.rps.num_waiters); } +spin_unlock (&rq->lock); + +local_irq_enable (); -i915_request_remove_from_client (request); +intel_context_exit (rq->hw_context); +intel_context_unpin (rq->hw_context); -__retire_engine_upto (request->engine, request); +i915_request_remove_from_client (rq); -intel_context_exit (request->hw_context); -intel_context_unpin (request->hw_context); +free_capture_list (rq); +i915_sched_node_fini (&rq->sched); +i915_request_put (rq); -i915_sched_node_fini (&request->sched); -i915_request_put (request); +return true; }void i915_request_retire_upto (struct i915_request *rq)
@@ -309,9 +281,7 @@ void i915_request_retire_upto(struct i915_request *rq)do { tmp =list_first_entry (&ring->request_list,typeof (*tmp), ring_link); - -i915_request_retire (tmp); - }while (tmp != rq); + }while (i915_request_retire (tmp) && tmp != rq); }static void irq_execute_cb (struct irq_work *wrk)
@@ -600,12 +570,9 @@ static void ring_retire_requests(struct intel_ring *ring) {struct i915_request *rq, *rn; -list_for_each_entry_safe (rq, rn, &ring->request_list, ring_link) { -if (!i915_request_completed (rq)) +list_for_each_entry_safe (rq, rn, &ring->request_list, ring_link) +if (!i915_request_retire (rq))break ; - -i915_request_retire (rq); - } } static noinline struct i915_request *
@@ -620,6 +587,15 @@ request_alloc_slow(struct intel_context *ce, gfp_t gfp)if (!gfpflags_allow_blocking (gfp)) goto out; +/* Move our oldest request to the slab-cache (if not in use!) */ + rq =list_first_entry (&ring->request_list,typeof (*rq), ring_link); +i915_request_retire (rq); + + rq =kmem_cache_alloc (global.slab_requests, + gfp | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); +if (rq) +return rq; +/* Ratelimit ourselves to prevent oom from malicious clients */ rq =list_last_entry (&ring->request_list,typeof (*rq), ring_link);cond_synchronize_rcu (rq->rcustate);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/8] drm/i915: Stop retiring along engine
Quoted 153 lines · Chris Wilson
We no longer track the execution order along the engine and so no longer need to enforce ordering of retire along the engine.
Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/i915_request.c | 128 +++++++++++----------------- 1 file changed, 52 insertions(+), 76 deletions(-)drivers/gpu/drm/i915/i915_request.c +40
-68@@ -183,72 +183,23 @@ static void free_capture_list(struct i915_request *request) } } -static void __retire_engine_request (struct intel_engine_cs *engine, -struct i915_request *rq) -{ -GEM_TRACE ("%s(%s) fence %llx:%lld, current %d\n" , - __func__, engine->name, - rq->fence.context, rq->fence.seqno, -hwsp_seqno (rq)); - -GEM_BUG_ON (!i915_request_completed (rq)); - -local_irq_disable (); - -spin_lock (&engine->timeline.lock); -GEM_BUG_ON (!list_is_first (&rq->link, &engine->timeline.requests)); -list_del_init (&rq->link); -spin_unlock (&engine->timeline.lock); - -spin_lock (&rq->lock); -i915_request_mark_complete (rq); -if (!i915_request_signaled (rq)) -dma_fence_signal_locked (&rq->fence); -if (test_bit (DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT , &rq->fence.flags)) -i915_request_cancel_breadcrumb (rq); -if (rq->waitboost) { -GEM_BUG_ON (!atomic_read (&rq->i915->gt_pm.rps.num_waiters)); -atomic_dec (&rq->i915->gt_pm.rps.num_waiters); - } -spin_unlock (&rq->lock); - -local_irq_enable (); -} - -static void __retire_engine_upto (struct intel_engine_cs *engine, -struct i915_request *rq) -{ -struct i915_request *tmp; - -if (list_empty (&rq->link)) -return ; - -do { - tmp =list_first_entry (&engine->timeline.requests, -typeof (*tmp), link); - -GEM_BUG_ON (tmp->engine != engine); -__retire_engine_request (engine, tmp); - }while (tmp != rq); -} - -static void i915_request_retire (struct i915_request *request) +static bool i915_request_retire (struct i915_request *rq) {struct i915_active_request *active, *next; -GEM_TRACE ("%s fence %llx:%lld, current %d\n" , - request->engine->name, - request->fence.context, request->fence.seqno, -hwsp_seqno (request)); +lockdep_assert_held (&rq->i915->drm.struct_mutex); +if (!i915_request_completed (rq)) +return false; -lockdep_assert_held (&request->i915->drm.struct_mutex); -GEM_BUG_ON (!i915_sw_fence_signaled (&request->submit)); -GEM_BUG_ON (!i915_request_completed (request)); +GEM_TRACE ("%s fence %llx:%lld, current %d\n" , + rq->engine->name, + rq->fence.context, rq->fence.seqno, +hwsp_seqno (rq)); -trace_i915_request_retire (request); +GEM_BUG_ON (!i915_sw_fence_signaled (&rq->submit)); +trace_i915_request_retire (rq); -advance_ring (request); -free_capture_list (request); +advance_ring (rq);/* * Walk through the active list, calling retire on each. This allows @@ -260,7 +211,7 @@ static void i915_request_retire(struct i915_request *request)* pass along the auxiliary information (to avoid dereferencing * the node after the callback). */ -list_for_each_entry_safe (active, next, &request->active_list, link) { +list_for_each_entry_safe (active, next, &rq->active_list, link) {/* * In microbenchmarks or focusing upon time inside the kernel, * we may spend an inordinate amount of time simply handling @@ -276,18 +227,39 @@ static void i915_request_retire(struct i915_request *request)INIT_LIST_HEAD (&active->link);RCU_INIT_POINTER (active->request,NULL ); - active->retire (active, request); + active->retire (active, rq); + } + +local_irq_disable (); + +spin_lock (&rq->engine->timeline.lock); +list_del (&rq->link); +spin_unlock (&rq->engine->timeline.lock); + +spin_lock (&rq->lock); +i915_request_mark_complete (rq); +if (!i915_request_signaled (rq)) +dma_fence_signal_locked (&rq->fence); +if (test_bit (DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT , &rq->fence.flags)) +i915_request_cancel_breadcrumb (rq); +if (rq->waitboost) { +GEM_BUG_ON (!atomic_read (&rq->i915->gt_pm.rps.num_waiters)); +atomic_dec (&rq->i915->gt_pm.rps.num_waiters); } +spin_unlock (&rq->lock); + +local_irq_enable (); -i915_request_remove_from_client (request); +intel_context_exit (rq->hw_context); +intel_context_unpin (rq->hw_context); -__retire_engine_upto (request->engine, request); +i915_request_remove_from_client (rq); -intel_context_exit (request->hw_context); -intel_context_unpin (request->hw_context); +free_capture_list (rq); +i915_sched_node_fini (&rq->sched); +i915_request_put (rq); -i915_sched_node_fini (&request->sched); -i915_request_put (request); +return true; }void i915_request_retire_upto (struct i915_request *rq)
drivers/gpu/drm/i915/i915_request.c void i915_request_retire_upto(struct i915_request *rq) · line 284
Quoted 7 lines
drivers/gpu/drm/i915/i915_request.c +1
-3@@ -309,9 +281,7 @@ void i915_request_retire_upto(struct i915_request *rq)do { tmp =list_first_entry (&ring->request_list,typeof (*tmp), ring_link); - -i915_request_retire (tmp); - }while (tmp != rq); + }while (i915_request_retire (tmp) && tmp != rq);
The semantics does change a little for this function. But looking at the callsites it doesn't matter.
Quoted 19 lines
drivers/gpu/drm/i915/i915_request.c +2
-5}static void irq_execute_cb (struct irq_work *wrk)@@ -600,12 +570,9 @@ static void ring_retire_requests(struct intel_ring *ring) {struct i915_request *rq, *rn; -list_for_each_entry_safe (rq, rn, &ring->request_list, ring_link) { -if (!i915_request_completed (rq)) +list_for_each_entry_safe (rq, rn, &ring->request_list, ring_link) +if (!i915_request_retire (rq))break ; - -i915_request_retire (rq); - } } static noinline struct i915_request *
drivers/gpu/drm/i915/i915_request.c request_alloc_slow(struct intel_context *ce, gfp_t gfp) · line 592
Quoted 6 lines
drivers/gpu/drm/i915/i915_request.c +3
-0@@ -620,6 +587,15 @@ request_alloc_slow(struct intel_context *ce, gfp_t gfp)if (!gfpflags_allow_blocking (gfp)) goto out; +/* Move our oldest request to the slab-cache (if not in use!) */ + rq =list_first_entry (&ring->request_list,typeof (*rq), ring_link); +i915_request_retire (rq);
Ok this is just for kick.
drivers/gpu/drm/i915/i915_request.c request_alloc_slow(struct intel_context *ce, gfp_t gfp) · line 595
Quoted 3 lines
drivers/gpu/drm/i915/i915_request.c +3
-0+ + rq =kmem_cache_alloc (global.slab_requests, + gfp | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
Only one callsite for this so you go cleaner by using gfp only if you so desire.
Quoted 13 lines
drivers/gpu/drm/i915/i915_request.c +3
-0+if (rq) +return rq; +/* Ratelimit ourselves to prevent oom from malicious clients */ rq =list_last_entry (&ring->request_list,typeof (*rq), ring_link);cond_synchronize_rcu (rq->rcustate);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/8 drm/i915: Replace engine->timeline with a plain list
In reply to Chris WilsonTo continue the onslaught of removing the assumption of a global execution ordering, another casualty is the engine->timeline. Without an actual timeline to track, it is overkill and we can replace it with a much less grand plain list. We still need a list of requests inflight, for the simple purpose of finding inflight requests (for retiring, resetting, preemption etc).
--- drivers/gpu/drm/i915/gt/intel_engine.h | 6 ++ drivers/gpu/drm/i915/gt/intel_engine_cs.c | 62 ++++++------ drivers/gpu/drm/i915/gt/intel_engine_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 95 ++++++++++--------- drivers/gpu/drm/i915/gt/intel_reset.c | 10 +- drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 15 ++- drivers/gpu/drm/i915/gt/mock_engine.c | 18 ++-- drivers/gpu/drm/i915/i915_gpu_error.c | 5 +- drivers/gpu/drm/i915/i915_request.c | 43 +++------ drivers/gpu/drm/i915/i915_request.h | 2 +- drivers/gpu/drm/i915/i915_scheduler.c | 38 ++++---- drivers/gpu/drm/i915/i915_timeline.c | 1 - drivers/gpu/drm/i915/i915_timeline.h | 19 ---- drivers/gpu/drm/i915/i915_timeline_types.h | 4 - drivers/gpu/drm/i915/intel_guc_submission.c | 16 ++-- .../gpu/drm/i915/selftests/mock_timeline.c | 1 - 16 files changed, 153 insertions(+), 188 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine.h +6 -0
@@ -564,4 +564,10 @@ static inline bool inject_preempt_hang(struct intel_engine_execlists *execlists)#endif +void intel_engine_init_active (struct intel_engine_cs *engine, +unsigned int subclass); +#define ENGINE_PHYSICAL 0 +#define ENGINE_MOCK 1 +#define ENGINE_VIRTUAL 2 +#endif /* _INTEL_RINGBUFFER_H_ */
drivers/gpu/drm/i915/gt/intel_engine_cs.c +31 -31
127 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_engine_types.h +5 -1
@@ -288,7 +288,11 @@ struct intel_engine_cs {struct intel_ring *buffer; -struct i915_timeline timeline; +struct { +spinlock_t lock; +struct list_head requests; + } active; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */
drivers/gpu/drm/i915/gt/intel_lrc.c +50 -45
320 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_reset.c +5 -5
@@ -49,12 +49,12 @@ static void engine_skip_context(struct i915_request *rq)struct intel_engine_cs *engine = rq->engine;struct i915_gem_context *hung_ctx = rq->gem_context; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);if (!i915_request_is_active (rq))return ; -list_for_each_entry_continue (rq, &engine->timeline.requests, link) +list_for_each_entry_continue (rq, &engine->active.requests, sched.link)if (rq->gem_context == hung_ctx)i915_request_skip (rq, -EIO ); }
@@ -130,7 +130,7 @@ void i915_reset_request(struct i915_request *rq, bool guilty) rq->fence.seqno, yesno(guilty)); -lockdep_assert_held (&rq->engine->timeline.lock); +lockdep_assert_held (&rq->engine->active.lock);GEM_BUG_ON (i915_request_completed (rq));if (guilty) {
@@ -785,10 +785,10 @@ static void nop_submit_request(struct i915_request *request) engine->name, request->fence.context, request->fence.seqno);dma_fence_set_error (&request->fence, -EIO ); -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__i915_request_submit (request);i915_request_mark_complete (request); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags);intel_engine_queue_breadcrumbs (engine); }
drivers/gpu/drm/i915/gt/intel_ringbuffer.c +6 -9
@@ -730,14 +730,13 @@ static void reset_prepare(struct intel_engine_cs *engine)static void reset_ring (struct intel_engine_cs *engine,bool stalled) { -struct i915_timeline *tl = &engine->timeline;struct i915_request *pos, *rq;unsigned long flags;u32 head; rq =NULL ; -spin_lock_irqsave (&tl->lock, flags); -list_for_each_entry (pos, &tl->requests, link) { +spin_lock_irqsave (&engine->active.lock, flags); +list_for_each_entry (pos, &engine->active.requests, sched.link) {if (!i915_request_completed (pos)) { rq = pos;break ;
@@ -791,7 +790,7 @@ static void reset_ring(struct intel_engine_cs *engine, bool stalled) } engine->buffer->head =intel_ring_wrap (engine->buffer, head); -spin_unlock_irqrestore (&tl->lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void reset_finish (struct intel_engine_cs *engine)
@@ -877,10 +876,10 @@ static void cancel_requests(struct intel_engine_cs *engine)struct i915_request *request;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Mark all submitted requests as skipped. */ -list_for_each_entry (request, &engine->timeline.requests, link) { +list_for_each_entry (request, &engine->active.requests, sched.link) {if (!i915_request_signaled (request))dma_fence_set_error (&request->fence, -EIO );
@@ -889,7 +888,7 @@ static void cancel_requests(struct intel_engine_cs *engine)/* Remaining _unready_ requests will be nop'ed when submitted */ -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void i9xx_submit_request (struct i915_request *request)
@@ -1267,8 +1266,6 @@ intel_engine_create_ring(struct intel_engine_cs *engine,GEM_BUG_ON (!is_power_of_2 (size));GEM_BUG_ON (RING_CTL_SIZE (size) & ~RING_NR_PAGES ); -GEM_BUG_ON (timeline == &engine->timeline); -lockdep_assert_held (&engine->i915->drm.struct_mutex); ring =kzalloc (sizeof (*ring),GFP_KERNEL );if (!ring)
drivers/gpu/drm/i915/gt/mock_engine.c +6 -12
@@ -229,17 +229,17 @@ static void mock_cancel_requests(struct intel_engine_cs *engine)struct i915_request *request;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Mark all submitted requests as skipped. */ -list_for_each_entry (request, &engine->timeline.requests, sched.link) { +list_for_each_entry (request, &engine->active.requests, sched.link) {if (!i915_request_signaled (request))dma_fence_set_error (&request->fence, -EIO );i915_request_mark_complete (request); } -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); } struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
@@ -285,28 +285,23 @@ int mock_engine_init(struct intel_engine_cs *engine)struct drm_i915_private *i915 = engine->i915;int err; +intel_engine_init_active (engine,ENGINE_MOCK );intel_engine_init_breadcrumbs (engine);intel_engine_init_execlists (engine);intel_engine_init__pm (engine); -if (i915_timeline_init (i915, &engine->timeline,NULL )) - goto err_breadcrumbs; -i915_timeline_set_subclass (&engine->timeline,TIMELINE_ENGINE ); - engine->kernel_context =i915_gem_context_get_engine (i915->kernel_context, engine->id);if (IS_ERR (engine->kernel_context)) - goto err_timeline; + goto err_breadcrumbs; err =intel_context_pin (engine->kernel_context);intel_context_put (engine->kernel_context);if (err) - goto err_timeline; + goto err_breadcrumbs;return 0 ; -err_timeline: -i915_timeline_fini (&engine->timeline); err_breadcrumbs:intel_engine_fini_breadcrumbs (engine);return -ENOMEM ;
@@ -340,7 +335,6 @@ void mock_engine_free(struct intel_engine_cs *engine)intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine); -i915_timeline_fini (&engine->timeline);kfree (engine); }
drivers/gpu/drm/i915/i915_gpu_error.c +3 -2
@@ -1275,7 +1275,7 @@ static void engine_record_requests(struct intel_engine_cs *engine, count =0 ; request = first; -list_for_each_entry_from (request, &engine->timeline.requests, link) +list_for_each_entry_from (request, &engine->active.requests, sched.link) count++;if (!count)return ;
@@ -1288,7 +1288,8 @@ static void engine_record_requests(struct intel_engine_cs *engine, count =0 ; request = first; -list_for_each_entry_from (request, &engine->timeline.requests, link) { +list_for_each_entry_from (request, + &engine->active.requests, sched.link) {if (count >= ee->num_requests) {/* * If the ring request list was changed in
drivers/gpu/drm/i915/i915_request.c +13 -30
125 lines not on this page · raw message
drivers/gpu/drm/i915/i915_request.h +1 -1
@@ -217,7 +217,7 @@ struct i915_request {bool waitboost; -/** engine->request_list entry for this request */ +/** timeline->request entry for this request */ struct list_head link;/** ring->request_list entry for this request */
drivers/gpu/drm/i915/i915_scheduler.c +19 -19
@@ -77,7 +77,7 @@ i915_sched_lookup_priolist(struct intel_engine_cs *engine, int prio)bool first = true;int idx, i; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);assert_priolists (execlists);/* buckets sorted from highest [in slot 0] to lowest priority */
@@ -162,9 +162,9 @@ sched_lock_engine(const struct i915_sched_node *node,* check that the rq still belongs to the newly locked engine. */ while (locked != (engine =READ_ONCE (rq->engine))) { -spin_unlock (&locked->timeline.lock); +spin_unlock (&locked->active.lock);memset (cache,0 ,sizeof (*cache)); -spin_lock (&engine->timeline.lock); +spin_lock (&engine->active.lock); locked = engine; }
@@ -189,7 +189,7 @@ static void kick_submission(struct intel_engine_cs *engine, int prio)* tasklet, i.e. we have not change the priority queue * sufficiently to oust the running context. */ -if (inflight && !i915_scheduler_need_preempt (prio,rq_prio (inflight))) +if (!inflight || !i915_scheduler_need_preempt (prio,rq_prio (inflight)))return ;tasklet_hi_schedule (&engine->execlists.tasklet);
@@ -278,7 +278,7 @@ static void __i915_schedule(struct i915_sched_node *node,memset (&cache,0 ,sizeof (cache)); engine =node_to_request (node)->engine; -spin_lock (&engine->timeline.lock); +spin_lock (&engine->active.lock);/* Fifo and depth-first replacement ensure our deps execute before us */ engine =sched_lock_engine (node, engine, &cache);
@@ -287,7 +287,7 @@ static void __i915_schedule(struct i915_sched_node *node, node = dep->signaler; engine =sched_lock_engine (node, engine, &cache); -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);/* Recheck after acquiring the engine->timeline.lock */ if (prio <= node->attr.priority ||node_signaled (node))
@@ -296,14 +296,8 @@ static void __i915_schedule(struct i915_sched_node *node,GEM_BUG_ON (node_to_request (node)->engine != engine); node->attr.priority = prio; -if (!list_empty (&node->link)) { -GEM_BUG_ON (intel_engine_is_virtual (engine)); -if (!cache.priolist) - cache.priolist = -i915_sched_lookup_priolist (engine, - prio); -list_move_tail (&node->link, cache.priolist); - }else { + +if (list_empty (&node->link)) {/* * If the request is not in the priolist queue because * it is not yet runnable, then it doesn't contribute
@@ -312,8 +306,16 @@ static void __i915_schedule(struct i915_sched_node *node,* queue; but in that case we may still need to reorder * the inflight requests. */ -if (!i915_sw_fence_done (&node_to_request (node)->submit)) -continue ; +continue ; + } + +if (!intel_engine_is_virtual (engine) && + !i915_request_is_active (node_to_request (node))) { +if (!cache.priolist) + cache.priolist = +i915_sched_lookup_priolist (engine, + prio); +list_move_tail (&node->link, cache.priolist); }if (prio <= engine->execlists.queue_priority_hint)
@@ -325,7 +327,7 @@ static void __i915_schedule(struct i915_sched_node *node,kick_submission (engine, prio); } -spin_unlock (&engine->timeline.lock); +spin_unlock (&engine->active.lock); }void i915_schedule (struct i915_request *rq,const struct i915_sched_attr *attr)
@@ -439,8 +441,6 @@ void i915_sched_node_fini(struct i915_sched_node *node) {struct i915_dependency *dep, *tmp; -GEM_BUG_ON (!list_empty (&node->link)); -spin_lock_irq (&schedule_lock);/*
drivers/gpu/drm/i915/i915_timeline.c +0 -1
@@ -251,7 +251,6 @@ int i915_timeline_init(struct drm_i915_private *i915, timeline->fence_context =dma_fence_context_alloc (1 ); -spin_lock_init (&timeline->lock);mutex_init (&timeline->mutex);INIT_ACTIVE_REQUEST (&timeline->last_request);
drivers/gpu/drm/i915/i915_timeline.h +0 -19
@@ -36,25 +36,6 @@ int i915_timeline_init(struct drm_i915_private *i915, struct i915_vma *hwsp);void i915_timeline_fini (struct i915_timeline *tl); -static inline void -i915_timeline_set_subclass (struct i915_timeline *timeline, -unsigned int subclass) -{ -lockdep_set_subclass (&timeline->lock, subclass); - -/* -* Due to an interesting quirk in lockdep's internal debug tracking, -* after setting a subclass we must ensure the lock is used. Otherwise, -* nr_unused_locks is incremented once too often. -*/ -#ifdef CONFIG_DEBUG_LOCK_ALLOC -local_irq_disable (); -lock_map_acquire (&timeline->lock.dep_map); -lock_map_release (&timeline->lock.dep_map); -local_irq_enable (); -#endif -} -struct i915_timeline *i915_timeline_create (struct drm_i915_private *i915,struct i915_vma *global_hwsp);
drivers/gpu/drm/i915/i915_timeline_types.h +0 -4
@@ -23,10 +23,6 @@ struct i915_timeline {u64 fence_context;u32 seqno; -spinlock_t lock; -#define TIMELINE_CLIENT 0/* default subclass */ -#define TIMELINE_ENGINE 1 -#define TIMELINE_VIRTUAL 2struct mutex mutex;/* protects the flow of requests */ unsigned int pin_count;
drivers/gpu/drm/i915/intel_guc_submission.c +8 -8
@@ -740,7 +740,7 @@ static bool __guc_dequeue(struct intel_engine_cs *engine)bool submit = false;struct rb_node *rb; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);if (port_isset (port)) {if (intel_engine_has_preemption (engine)) {
@@ -822,7 +822,7 @@ static void guc_submission_tasklet(unsigned long data)struct i915_request *rq;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags); rq =port_request (port);while (rq &&i915_request_completed (rq)) {
@@ -847,7 +847,7 @@ static void guc_submission_tasklet(unsigned long data)if (!execlists_is_active (execlists,EXECLISTS_ACTIVE_PREEMPT ))guc_dequeue (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_reset_prepare (struct intel_engine_cs *engine)
@@ -884,7 +884,7 @@ static void guc_reset(struct intel_engine_cs *engine, bool stalled)struct i915_request *rq;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);execlists_cancel_port_requests (execlists);
@@ -900,7 +900,7 @@ static void guc_reset(struct intel_engine_cs *engine, bool stalled)intel_lr_context_reset (engine, rq->hw_context, rq->head, stalled); out_unlock: -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_cancel_requests (struct intel_engine_cs *engine)
@@ -926,13 +926,13 @@ static void guc_cancel_requests(struct intel_engine_cs *engine)* submission's irq state, we also wish to remind ourselves that * it is irq state.) */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Cancel the requests on the HW and clear the ELSP tracker. */ execlists_cancel_port_requests (execlists);/* Mark all executing requests as skipped. */ -list_for_each_entry (rq, &engine->timeline.requests, link) { +list_for_each_entry (rq, &engine->active.requests, sched.link) {if (!i915_request_signaled (rq))dma_fence_set_error (&rq->fence, -EIO );
@@ -961,7 +961,7 @@ static void guc_cancel_requests(struct intel_engine_cs *engine) execlists->queue =RB_ROOT_CACHED ;GEM_BUG_ON (port_isset (execlists->port)); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_reset_finish (struct intel_engine_cs *engine)
drivers/gpu/drm/i915/selftests/mock_timeline.c +0 -1
@@ -13,7 +13,6 @@ void mock_timeline_init(struct i915_timeline *timeline, u64 context) timeline->i915 =NULL ; timeline->fence_context = context; -spin_lock_init (&timeline->lock);mutex_init (&timeline->mutex);INIT_ACTIVE_REQUEST (&timeline->last_request);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/8] drm/i915: Replace engine->timeline with a plain list
Quoted 921 lines · Chris Wilson
To continue the onslaught of removing the assumption of a global execution ordering, another casualty is the
engine->timeline. Without an actual timeline to track, it is overkill and we can replace it with a much less grand plain list. We still need a list of requests inflight, for the simple purpose of finding inflight requests (for retiring, resetting, preemption etc).Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/gt/intel_engine.h | 6 ++ drivers/gpu/drm/i915/gt/intel_engine_cs.c | 62 ++++++------ drivers/gpu/drm/i915/gt/intel_engine_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 95 ++++++++++--------- drivers/gpu/drm/i915/gt/intel_reset.c | 10 +- drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 15 ++- drivers/gpu/drm/i915/gt/mock_engine.c | 18 ++-- drivers/gpu/drm/i915/i915_gpu_error.c | 5 +- drivers/gpu/drm/i915/i915_request.c | 43 +++------ drivers/gpu/drm/i915/i915_request.h | 2 +- drivers/gpu/drm/i915/i915_scheduler.c | 38 ++++---- drivers/gpu/drm/i915/i915_timeline.c | 1 - drivers/gpu/drm/i915/i915_timeline.h | 19 ---- drivers/gpu/drm/i915/i915_timeline_types.h | 4 - drivers/gpu/drm/i915/intel_guc_submission.c | 16 ++-- .../gpu/drm/i915/selftests/mock_timeline.c | 1 - 16 files changed, 153 insertions(+), 188 deletions(-)drivers/gpu/drm/i915/gt/intel_engine.h +6
-0@@ -564,4 +564,10 @@ static inline bool inject_preempt_hang(struct intel_engine_execlists *execlists)#endif +void intel_engine_init_active (struct intel_engine_cs *engine, +unsigned int subclass); +#define ENGINE_PHYSICAL 0 +#define ENGINE_MOCK 1 +#define ENGINE_VIRTUAL 2 +#endif /* _INTEL_RINGBUFFER_H_ */ drivers/gpu/drm/i915/gt/intel_engine_cs.c +31
-31@@ -617,14 +617,7 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine)if (err)return err; - err =i915_timeline_init (engine->i915, - &engine->timeline, - engine->status_page.vma); -if (err) - goto err_hwsp; - -i915_timeline_set_subclass (&engine->timeline,TIMELINE_ENGINE ); - +intel_engine_init_active (engine,ENGINE_PHYSICAL );intel_engine_init_breadcrumbs (engine);intel_engine_init_execlists (engine);intel_engine_init_hangcheck (engine);@@ -637,10 +630,6 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine)intel_sseu_from_device_info (&RUNTIME_INFO (engine->i915)->sseu);return 0 ; - -err_hwsp: -cleanup_status_page (engine); -return err; }/** @@ -797,6 +786,27 @@ static int pin_context(struct i915_gem_context *ctx,return 0 ; } +void +intel_engine_init_active (struct intel_engine_cs *engine,unsigned int subclass) +{ +INIT_LIST_HEAD (&engine->active.requests); + +spin_lock_init (&engine->active.lock); +lockdep_set_subclass (&engine->active.lock, subclass); + +/* +* Due to an interesting quirk in lockdep's internal debug tracking, +* after setting a subclass we must ensure the lock is used. Otherwise, +* nr_unused_locks is incremented once too often. +*/ +#ifdef CONFIG_DEBUG_LOCK_ALLOC +local_irq_disable (); +lock_map_acquire (&engine->active.lock.dep_map); +lock_map_release (&engine->active.lock.dep_map); +local_irq_enable (); +#endif +} +/** * intel_engines_init_common - initialize cengine state which might require hw access * @engine: Engine to initialize. @@ -860,6 +870,8 @@ int intel_engine_init_common(struct intel_engine_cs *engine)*/ void intel_engine_cleanup_common (struct intel_engine_cs *engine) { +GEM_BUG_ON (!list_empty (&engine->active.requests)); +cleanup_status_page (engine);intel_engine_fini_breadcrumbs (engine);@@ -874,8 +886,6 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)intel_context_unpin (engine->kernel_context);GEM_BUG_ON (!llist_empty (&engine->barrier_tasks)); -i915_timeline_fini (&engine->timeline); -intel_wa_list_free (&engine->ctx_wa_list);intel_wa_list_free (&engine->wa_list);intel_wa_list_free (&engine->whitelist);@@ -1482,16 +1492,6 @@ void intel_engine_dump(struct intel_engine_cs *engine,drm_printf (m,"\tRequests:\n" ); - rq =list_first_entry (&engine->timeline.requests, - struct i915_request, link); -if (&rq->link != &engine->timeline.requests) -print_request (m, rq,"\t\tfirst " ); - - rq =list_last_entry (&engine->timeline.requests, - struct i915_request, link); -if (&rq->link != &engine->timeline.requests) -print_request (m, rq,"\t\tlast " ); - rq =intel_engine_find_active_request (engine);if (rq) {print_request (m, rq,"\t\tactive " );@@ -1572,7 +1572,7 @@ int intel_enable_engine_stats(struct intel_engine_cs *engine)if (!intel_engine_supports_stats (engine))return -ENODEV ; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);write_seqlock (&engine->stats.lock);if (unlikely (engine->stats.enabled == ~0 )) {@@ -1598,7 +1598,7 @@ int intel_enable_engine_stats(struct intel_engine_cs *engine) unlock:write_sequnlock (&engine->stats.lock); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags);return err; }@@ -1683,22 +1683,22 @@ intel_engine_find_active_request(struct intel_engine_cs *engine)* At all other times, we must assume the GPU is still running, but * we only care about the snapshot of this moment. */ -spin_lock_irqsave (&engine->timeline.lock, flags); -list_for_each_entry (request, &engine->timeline.requests, link) { +spin_lock_irqsave (&engine->active.lock, flags); +list_for_each_entry (request, &engine->active.requests, sched.link) {if (i915_request_completed (request))continue ;if (!i915_request_started (request)) -break ; +continue ;/* More than one preemptible request may match! */ if (!match_ring (request)) -break ; +continue ; active = request;break ; } -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags);return active; }drivers/gpu/drm/i915/gt/intel_engine_types.h +5
-1@@ -288,7 +288,11 @@ struct intel_engine_cs {struct intel_ring *buffer; -struct i915_timeline timeline; +struct { +spinlock_t lock; +struct list_head requests; + } active; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */ drivers/gpu/drm/i915/gt/intel_lrc.c +50
-45@@ -298,8 +298,8 @@ static inline bool need_preempt(const struct intel_engine_cs *engine,* Check against the first request in ELSP[1], it will, thanks to the * power of PI, be the highest priority of that context. */ -if (!list_is_last (&rq->link, &engine->timeline.requests) && -rq_prio (list_next_entry (rq, link)) > last_prio) +if (!list_is_last (&rq->sched.link, &engine->active.requests) && +rq_prio (list_next_entry (rq, sched.link)) > last_prio)return true;if (rb) {@@ -434,11 +434,11 @@ __unwind_incomplete_requests(struct intel_engine_cs *engine)struct list_head *uninitialized_var (pl );int prio =I915_PRIORITY_INVALID ; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);list_for_each_entry_safe_reverse (rq, rn, - &engine->timeline.requests, - link) { + &engine->active.requests, + sched.link) {struct intel_engine_cs *owner;if (i915_request_completed (rq))@@ -465,7 +465,7 @@ __unwind_incomplete_requests(struct intel_engine_cs *engine) }GEM_BUG_ON (RB_EMPTY_ROOT (&engine->execlists.queue.rb_root)); -list_add (&rq->sched.link, pl); +list_move (&rq->sched.link, pl); active = rq; }else { rq->engine = owner;@@ -933,11 +933,11 @@ static void execlists_dequeue(struct intel_engine_cs *engine)rb_entry (rb,typeof (*ve), nodes[engine->id].rb);struct i915_request *rq; -spin_lock (&ve->base.timeline.lock); +spin_lock (&ve->base.active.lock); rq = ve->request;if (unlikely (!rq)) {/* lost the race to a sibling */ -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock);rb_erase_cached (rb, &execlists->virtual);RB_CLEAR_NODE (rb); rb =rb_first_cached (&execlists->virtual);@@ -950,13 +950,13 @@ static void execlists_dequeue(struct intel_engine_cs *engine)if (rq_prio (rq) >=queue_prio (execlists)) {if (!virtual_matches (ve, rq, engine)) { -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock); rb =rb_next (rb);continue ; }if (last && !can_merge_rq (last, rq)) { -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock);return ;/* leave this rq for another engine */ }@@ -1011,7 +1011,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) last = rq; } -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock);break ; }@@ -1068,8 +1068,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine)GEM_BUG_ON (port_isset (port)); } -list_del_init (&rq->sched.link); -__i915_request_submit (rq);trace_i915_request_in (rq,port_index (port, execlists));@@ -1170,7 +1168,7 @@ static void process_csb(struct intel_engine_cs *engine)const u8 num_entries = execlists->csb_size;u8 head, tail; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);/* * Note that csb_write, csb_status may be either in HWSP or mmio. @@ -1330,7 +1328,7 @@ static void process_csb(struct intel_engine_cs *engine)static void __execlists_submission_tasklet (struct intel_engine_cs *const engine) { -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);process_csb (engine);if (!execlists_is_active (&engine->execlists,EXECLISTS_ACTIVE_PREEMPT ))@@ -1351,15 +1349,16 @@ static void execlists_submission_tasklet(unsigned long data) !!intel_wakeref_active (&engine->wakeref), engine->execlists.active); -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__execlists_submission_tasklet (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void queue_request (struct intel_engine_cs *engine,struct i915_sched_node *node,int prio) { +GEM_BUG_ON (!list_empty (&node->link));list_add_tail (&node->link,i915_sched_lookup_priolist (engine, prio)); }@@ -1390,7 +1389,7 @@ static void execlists_submit_request(struct i915_request *request)unsigned long flags;/* Will be called from irq-context when using foreign fences. */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);queue_request (engine, &request->sched,rq_prio (request));@@ -1399,7 +1398,7 @@ static void execlists_submit_request(struct i915_request *request)submit_queue (engine,rq_prio (request)); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void __execlists_context_fini (struct intel_context *ce)@@ -2050,8 +2049,8 @@ static void execlists_reset_prepare(struct intel_engine_cs *engine)intel_engine_stop_cs (engine);/* And flush any current direct submission. */ -spin_lock_irqsave (&engine->timeline.lock, flags); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static bool lrc_regs_ok (const struct i915_request *rq)@@ -2094,11 +2093,11 @@ static void reset_csb_pointers(struct intel_engine_execlists *execlists)static struct i915_request *active_request (struct i915_request *rq) { -const struct list_head *const list = &rq->engine->timeline.requests; +const struct list_head *const list = &rq->engine->active.requests;const struct intel_context *const context = rq->hw_context;struct i915_request *active =NULL ; -list_for_each_entry_from_reverse (rq, list, link) { +list_for_each_entry_from_reverse (rq, list, sched.link) {if (i915_request_completed (rq))break ;@@ -2215,11 +2214,11 @@ static void execlists_reset(struct intel_engine_cs *engine, bool stalled)GEM_TRACE ("%s\n" , engine->name); -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__execlists_reset (engine, stalled); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void nop_submission_tasklet (unsigned long data)@@ -2250,12 +2249,12 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)* submission's irq state, we also wish to remind ourselves that * it is irq state.) */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__execlists_reset (engine, true);/* Mark all executing requests as skipped. */ -list_for_each_entry (rq, &engine->timeline.requests, link) { +list_for_each_entry (rq, &engine->active.requests, sched.link) {if (!i915_request_signaled (rq))dma_fence_set_error (&rq->fence, -EIO );@@ -2286,7 +2285,7 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)rb_erase_cached (rb, &execlists->virtual);RB_CLEAR_NODE (rb); -spin_lock (&ve->base.timeline.lock); +spin_lock (&ve->base.active.lock);if (ve->request) { ve->request->engine = engine;__i915_request_submit (ve->request);@@ -2295,7 +2294,7 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine) ve->base.execlists.queue_priority_hint =INT_MIN ; ve->request =NULL ; } -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock); }/* Remaining _unready_ requests will be nop'ed when submitted */ @@ -2307,7 +2306,7 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)GEM_BUG_ON (__tasklet_is_enabled (&execlists->tasklet)); execlists->tasklet.func = nop_submission_tasklet; -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void execlists_reset_finish (struct intel_engine_cs *engine)@@ -3010,12 +3009,18 @@ static int execlists_context_deferred_alloc(struct intel_context *ce,return ret; } +static struct list_head *virtual_queue (struct virtual_engine *ve) +{ +return &ve->base.execlists.default_priolist.requests[0 ]; +} +static void virtual_context_destroy (struct kref *kref) {struct virtual_engine *ve =container_of (kref,typeof (*ve), context.ref);unsigned int n; +GEM_BUG_ON (!list_empty (virtual_queue (ve)));GEM_BUG_ON (ve->request);GEM_BUG_ON (ve->context.inflight);@@ -3026,13 +3031,13 @@ static void virtual_context_destroy(struct kref *kref)if (RB_EMPTY_NODE (node))continue ; -spin_lock_irq (&sibling->timeline.lock); +spin_lock_irq (&sibling->active.lock);/* Detachment is lazily performed in the execlists tasklet */ if (!RB_EMPTY_NODE (node))rb_erase_cached (node, &sibling->execlists.virtual); -spin_unlock_irq (&sibling->timeline.lock); +spin_unlock_irq (&sibling->active.lock); }GEM_BUG_ON (__tasklet_is_scheduled (&ve->base.execlists.tasklet));@@ -3040,8 +3045,6 @@ static void virtual_context_destroy(struct kref *kref)__execlists_context_fini (&ve->context);kfree (ve->bonds); - -i915_timeline_fini (&ve->base.timeline);kfree (ve); }@@ -3161,16 +3164,16 @@ static void virtual_submission_tasklet(unsigned long data)if (unlikely (!(mask & sibling->mask))) {if (!RB_EMPTY_NODE (&node->rb)) { -spin_lock (&sibling->timeline.lock); +spin_lock (&sibling->active.lock);rb_erase_cached (&node->rb, &sibling->execlists.virtual);RB_CLEAR_NODE (&node->rb); -spin_unlock (&sibling->timeline.lock); +spin_unlock (&sibling->active.lock); }continue ; } -spin_lock (&sibling->timeline.lock); +spin_lock (&sibling->active.lock);if (!RB_EMPTY_NODE (&node->rb)) {/* @@ -3214,7 +3217,7 @@ static void virtual_submission_tasklet(unsigned long data)tasklet_hi_schedule (&sibling->execlists.tasklet); } -spin_unlock (&sibling->timeline.lock); +spin_unlock (&sibling->active.lock); }local_irq_enable (); }@@ -3231,9 +3234,13 @@ static void virtual_submit_request(struct i915_request *rq)GEM_BUG_ON (ve->base.submit_request != virtual_submit_request);GEM_BUG_ON (ve->request); +GEM_BUG_ON (!list_empty (virtual_queue (ve))); + ve->base.execlists.queue_priority_hint =rq_prio (rq);WRITE_ONCE (ve->request, rq); +list_move_tail (&rq->sched.link,virtual_queue (ve)); +tasklet_schedule (&ve->base.execlists.tasklet); }@@ -3297,10 +3304,7 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx,snprintf (ve->base.name,sizeof (ve->base.name),"virtual" ); - err =i915_timeline_init (ctx->i915, &ve->base.timeline,NULL ); -if (err) - goto err_put; -i915_timeline_set_subclass (&ve->base.timeline,TIMELINE_VIRTUAL ); +intel_engine_init_active (&ve->base,ENGINE_VIRTUAL );intel_engine_init_execlists (&ve->base);@@ -3311,6 +3315,7 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx, ve->base.submit_request = virtual_submit_request; ve->base.bond_execute = virtual_bond_execute; +INIT_LIST_HEAD (virtual_queue (ve)); ve->base.execlists.queue_priority_hint =INT_MIN ; tasklet_init(&ve->base.execlists.tasklet, virtual_submission_tasklet,@@ -3465,11 +3470,11 @@ void intel_execlists_show_requests(struct intel_engine_cs *engine,unsigned int count;struct rb_node *rb; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags); last =NULL ; count =0 ; -list_for_each_entry (rq, &engine->timeline.requests, link) { +list_for_each_entry (rq, &engine->active.requests, sched.link) {if (count++ < max -1 )show_request (m, rq,"\t\tE " );else @@ -3532,7 +3537,7 @@ void intel_execlists_show_requests(struct intel_engine_cs *engine,show_request (m, last,"\t\tV " ); } -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); } void intel_lr_context_reset(struct intel_engine_cs *engine,drivers/gpu/drm/i915/gt/intel_reset.c +5
-5@@ -49,12 +49,12 @@ static void engine_skip_context(struct i915_request *rq)struct intel_engine_cs *engine = rq->engine;struct i915_gem_context *hung_ctx = rq->gem_context; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);if (!i915_request_is_active (rq))return ; -list_for_each_entry_continue (rq, &engine->timeline.requests, link) +list_for_each_entry_continue (rq, &engine->active.requests, sched.link)if (rq->gem_context == hung_ctx)i915_request_skip (rq, -EIO ); }@@ -130,7 +130,7 @@ void i915_reset_request(struct i915_request *rq, bool guilty) rq->fence.seqno, yesno(guilty)); -lockdep_assert_held (&rq->engine->timeline.lock); +lockdep_assert_held (&rq->engine->active.lock);GEM_BUG_ON (i915_request_completed (rq));if (guilty) {@@ -785,10 +785,10 @@ static void nop_submit_request(struct i915_request *request) engine->name, request->fence.context, request->fence.seqno);dma_fence_set_error (&request->fence, -EIO ); -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__i915_request_submit (request);i915_request_mark_complete (request); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags);intel_engine_queue_breadcrumbs (engine); }drivers/gpu/drm/i915/gt/intel_ringbuffer.c +6
-9@@ -730,14 +730,13 @@ static void reset_prepare(struct intel_engine_cs *engine)static void reset_ring (struct intel_engine_cs *engine,bool stalled) { -struct i915_timeline *tl = &engine->timeline;struct i915_request *pos, *rq;unsigned long flags;u32 head; rq =NULL ; -spin_lock_irqsave (&tl->lock, flags); -list_for_each_entry (pos, &tl->requests, link) { +spin_lock_irqsave (&engine->active.lock, flags); +list_for_each_entry (pos, &engine->active.requests, sched.link) {if (!i915_request_completed (pos)) { rq = pos;break ;@@ -791,7 +790,7 @@ static void reset_ring(struct intel_engine_cs *engine, bool stalled) } engine->buffer->head =intel_ring_wrap (engine->buffer, head); -spin_unlock_irqrestore (&tl->lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void reset_finish (struct intel_engine_cs *engine)@@ -877,10 +876,10 @@ static void cancel_requests(struct intel_engine_cs *engine)struct i915_request *request;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Mark all submitted requests as skipped. */ -list_for_each_entry (request, &engine->timeline.requests, link) { +list_for_each_entry (request, &engine->active.requests, sched.link) {if (!i915_request_signaled (request))dma_fence_set_error (&request->fence, -EIO );@@ -889,7 +888,7 @@ static void cancel_requests(struct intel_engine_cs *engine)/* Remaining _unready_ requests will be nop'ed when submitted */ -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void i9xx_submit_request (struct i915_request *request)@@ -1267,8 +1266,6 @@ intel_engine_create_ring(struct intel_engine_cs *engine,GEM_BUG_ON (!is_power_of_2 (size));GEM_BUG_ON (RING_CTL_SIZE (size) & ~RING_NR_PAGES ); -GEM_BUG_ON (timeline == &engine->timeline); -lockdep_assert_held (&engine->i915->drm.struct_mutex); ring =kzalloc (sizeof (*ring),GFP_KERNEL );if (!ring)drivers/gpu/drm/i915/gt/mock_engine.c +6
-12@@ -229,17 +229,17 @@ static void mock_cancel_requests(struct intel_engine_cs *engine)struct i915_request *request;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Mark all submitted requests as skipped. */ -list_for_each_entry (request, &engine->timeline.requests, sched.link) { +list_for_each_entry (request, &engine->active.requests, sched.link) {if (!i915_request_signaled (request))dma_fence_set_error (&request->fence, -EIO );i915_request_mark_complete (request); } -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); } struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,@@ -285,28 +285,23 @@ int mock_engine_init(struct intel_engine_cs *engine)struct drm_i915_private *i915 = engine->i915;int err; +intel_engine_init_active (engine,ENGINE_MOCK );intel_engine_init_breadcrumbs (engine);intel_engine_init_execlists (engine);intel_engine_init__pm (engine); -if (i915_timeline_init (i915, &engine->timeline,NULL )) - goto err_breadcrumbs; -i915_timeline_set_subclass (&engine->timeline,TIMELINE_ENGINE ); - engine->kernel_context =i915_gem_context_get_engine (i915->kernel_context, engine->id);if (IS_ERR (engine->kernel_context)) - goto err_timeline; + goto err_breadcrumbs; err =intel_context_pin (engine->kernel_context);intel_context_put (engine->kernel_context);if (err) - goto err_timeline; + goto err_breadcrumbs;return 0 ; -err_timeline: -i915_timeline_fini (&engine->timeline); err_breadcrumbs:intel_engine_fini_breadcrumbs (engine);return -ENOMEM ;@@ -340,7 +335,6 @@ void mock_engine_free(struct intel_engine_cs *engine)intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine); -i915_timeline_fini (&engine->timeline);kfree (engine); }drivers/gpu/drm/i915/i915_gpu_error.c +3
-2@@ -1275,7 +1275,7 @@ static void engine_record_requests(struct intel_engine_cs *engine, count =0 ; request = first; -list_for_each_entry_from (request, &engine->timeline.requests, link) +list_for_each_entry_from (request, &engine->active.requests, sched.link) count++;if (!count)return ;@@ -1288,7 +1288,8 @@ static void engine_record_requests(struct intel_engine_cs *engine, count =0 ; request = first; -list_for_each_entry_from (request, &engine->timeline.requests, link) { +list_for_each_entry_from (request, + &engine->active.requests, sched.link) {if (count >= ee->num_requests) {/* * If the ring request list was changed in drivers/gpu/drm/i915/i915_request.c +13
-30@@ -232,9 +232,9 @@ static bool i915_request_retire(struct i915_request *rq)local_irq_disable (); -spin_lock (&rq->engine->timeline.lock); -list_del (&rq->link); -spin_unlock (&rq->engine->timeline.lock); +spin_lock (&rq->engine->active.lock); +list_del (&rq->sched.link); +spin_unlock (&rq->engine->active.lock);spin_lock (&rq->lock);i915_request_mark_complete (rq);@@ -254,6 +254,7 @@ static bool i915_request_retire(struct i915_request *rq)intel_context_unpin (rq->hw_context);i915_request_remove_from_client (rq); +list_del (&rq->link);free_capture_list (rq);i915_sched_node_fini (&rq->sched);@@ -373,28 +374,17 @@ __i915_request_await_execution(struct i915_request *rq,return 0 ; } -static void move_to_timeline (struct i915_request *request, -struct i915_timeline *timeline) -{ -GEM_BUG_ON (request->timeline == &request->engine->timeline); -lockdep_assert_held (&request->engine->timeline.lock); - -spin_lock (&request->timeline->lock); -list_move_tail (&request->link, &timeline->requests); -spin_unlock (&request->timeline->lock); -} -void __i915_request_submit (struct i915_request *request) {struct intel_engine_cs *engine = request->engine; -GEM_TRACE ("%s fence %llx:%lld -> current %d\n" , +GEM_TRACE ("%s fence %llx:%lld, current %d\n" , engine->name, request->fence.context, request->fence.seqno,hwsp_seqno (request));GEM_BUG_ON (!irqs_disabled ()); -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);if (i915_gem_context_is_banned (request->gem_context))i915_request_skip (request, -EIO );@@ -422,6 +412,8 @@ void __i915_request_submit(struct i915_request *request)/* We may be recursing from the signal callback of another i915 fence */ spin_lock_nested (&request->lock,SINGLE_DEPTH_NESTING ); +list_move_tail (&request->sched.link, &engine->active.requests); +GEM_BUG_ON (test_bit (I915_FENCE_FLAG_ACTIVE , &request->fence.flags));set_bit (I915_FENCE_FLAG_ACTIVE , &request->fence.flags);@@ -437,9 +429,6 @@ void __i915_request_submit(struct i915_request *request) engine->emit_fini_breadcrumb (request, request->ring->vaddr + request->postfix); -/* Transfer from per-context onto the global per-engine timeline */ -move_to_timeline (request, &engine->timeline); - engine->serial++;trace_i915_request_execute (request);@@ -451,11 +440,11 @@ void i915_request_submit(struct i915_request *request)unsigned long flags;/* Will be called from irq-context when using foreign fences. */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__i915_request_submit (request); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }void __i915_request_unsubmit (struct i915_request *request)@@ -468,7 +457,7 @@ void __i915_request_unsubmit(struct i915_request *request) hwsp_seqno(request));GEM_BUG_ON (!irqs_disabled ()); -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);/* * Only unwind in reverse order, required so that the per-context list @@ -486,9 +475,6 @@ void __i915_request_unsubmit(struct i915_request *request)spin_unlock (&request->lock); -/* Transfer back from the global per-engine timeline to per-context */ -move_to_timeline (request, request->timeline); -/* We've already spun, don't charge on resubmitting. */ if (request->sched.semaphores &&i915_request_started (request)) { request->sched.attr.priority |=I915_PRIORITY_NOSEMAPHORE ;@@ -510,11 +496,11 @@ void i915_request_unsubmit(struct i915_request *request)unsigned long flags;/* Will be called from irq-context when using foreign fences. */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__i915_request_unsubmit (request); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static int __i915_sw_fence_call@@ -669,7 +655,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) rq->engine = ce->engine; rq->ring = ce->ring; rq->timeline = tl; -GEM_BUG_ON (rq->timeline == &ce->engine->timeline); rq->hwsp_seqno = tl->hwsp_seqno; rq->hwsp_cacheline = tl->hwsp_cacheline; rq->rcustate =get_state_synchronize_rcu ();/* acts as smp_mb() */ @@ -1137,9 +1122,7 @@ __i915_request_add_to_timeline(struct i915_request *rq) 0); } -spin_lock_irq (&timeline->lock);list_add_tail (&rq->link, &timeline->requests); -spin_unlock_irq (&timeline->lock);/* * Make sure that no request gazumped us - if it was allocated after drivers/gpu/drm/i915/i915_request.h +1
-1@@ -217,7 +217,7 @@ struct i915_request {bool waitboost; -/** engine->request_list entry for this request */ +/** timeline->request entry for this request */ struct list_head link;/** ring->request_list entry for this request */ drivers/gpu/drm/i915/i915_scheduler.c +3
-3@@ -77,7 +77,7 @@ i915_sched_lookup_priolist(struct intel_engine_cs *engine, int prio)bool first = true;int idx, i; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);assert_priolists (execlists);/* buckets sorted from highest [in slot 0] to lowest priority */ @@ -162,9 +162,9 @@ sched_lock_engine(const struct i915_sched_node *node,* check that the rq still belongs to the newly locked engine. */ while (locked != (engine =READ_ONCE (rq->engine))) { -spin_unlock (&locked->timeline.lock); +spin_unlock (&locked->active.lock);memset (cache,0 ,sizeof (*cache)); -spin_lock (&engine->timeline.lock); +spin_lock (&engine->active.lock); locked = engine; }
drivers/gpu/drm/i915/i915_scheduler.c static void kick_submission(struct intel_engine_cs *engine, int prio) · line 192
Quoted 5 lines
drivers/gpu/drm/i915/i915_scheduler.c +1
-1@@ -189,7 +189,7 @@ static void kick_submission(struct intel_engine_cs *engine, int prio)* tasklet, i.e. we have not change the priority queue * sufficiently to oust the running context. */ -if (inflight && !i915_scheduler_need_preempt (prio,rq_prio (inflight))) +if (!inflight || !i915_scheduler_need_preempt (prio,rq_prio (inflight)))
Ok. Hmm yes. Unexpected but nothing to trip over.
Quoted 39 lines
drivers/gpu/drm/i915/i915_scheduler.c +4
-10return ;tasklet_hi_schedule (&engine->execlists.tasklet);@@ -278,7 +278,7 @@ static void __i915_schedule(struct i915_sched_node *node,memset (&cache,0 ,sizeof (cache)); engine =node_to_request (node)->engine; -spin_lock (&engine->timeline.lock); +spin_lock (&engine->active.lock);/* Fifo and depth-first replacement ensure our deps execute before us */ engine =sched_lock_engine (node, engine, &cache);@@ -287,7 +287,7 @@ static void __i915_schedule(struct i915_sched_node *node, node = dep->signaler; engine =sched_lock_engine (node, engine, &cache); -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);/* Recheck after acquiring the engine->timeline.lock */ if (prio <= node->attr.priority ||node_signaled (node))@@ -296,14 +296,8 @@ static void __i915_schedule(struct i915_sched_node *node,GEM_BUG_ON (node_to_request (node)->engine != engine); node->attr.priority = prio; -if (!list_empty (&node->link)) { -GEM_BUG_ON (intel_engine_is_virtual (engine)); -if (!cache.priolist) - cache.priolist = -i915_sched_lookup_priolist (engine, - prio); -list_move_tail (&node->link, cache.priolist); - }else { + +if (list_empty (&node->link)) {/* * If the request is not in the priolist queue because * it is not yet runnable, then it doesn't contribute
drivers/gpu/drm/i915/i915_scheduler.c static void __i915_schedule(struct i915_sched_node *node, · line 316
Quoted 5 lines
drivers/gpu/drm/i915/i915_scheduler.c +0
-2@@ -312,8 +306,16 @@ static void __i915_schedule(struct i915_sched_node *node,* queue; but in that case we may still need to reorder * the inflight requests. */ -if (!i915_sw_fence_done (&node_to_request (node)->submit)) -continue ;
Was smooth ride until here. Where did this go?
drivers/gpu/drm/i915/i915_scheduler.c static void __i915_schedule(struct i915_sched_node *node, · line 313
Quoted 5 lines
drivers/gpu/drm/i915/i915_scheduler.c +5
-0+continue ; + } + +if (!intel_engine_is_virtual (engine) && + !i915_request_is_active (node_to_request (node))) {
Is this the replacement? But it is now inside the virtual check which was bug on previously.
*trips over*
-Mika
Quoted 176 lines
drivers/gpu/drm/i915/i915_scheduler.c +6
-3+if (!cache.priolist) + cache.priolist = +i915_sched_lookup_priolist (engine, + prio); +list_move_tail (&node->link, cache.priolist); }if (prio <= engine->execlists.queue_priority_hint)@@ -325,7 +327,7 @@ static void __i915_schedule(struct i915_sched_node *node,kick_submission (engine, prio); } -spin_unlock (&engine->timeline.lock); +spin_unlock (&engine->active.lock); }void i915_schedule (struct i915_request *rq,const struct i915_sched_attr *attr)@@ -439,8 +441,6 @@ void i915_sched_node_fini(struct i915_sched_node *node) {struct i915_dependency *dep, *tmp; -GEM_BUG_ON (!list_empty (&node->link)); -spin_lock_irq (&schedule_lock);/* drivers/gpu/drm/i915/i915_timeline.c +0
-1@@ -251,7 +251,6 @@ int i915_timeline_init(struct drm_i915_private *i915, timeline->fence_context =dma_fence_context_alloc (1 ); -spin_lock_init (&timeline->lock);mutex_init (&timeline->mutex);INIT_ACTIVE_REQUEST (&timeline->last_request);drivers/gpu/drm/i915/i915_timeline.h +0
-19@@ -36,25 +36,6 @@ int i915_timeline_init(struct drm_i915_private *i915, struct i915_vma *hwsp);void i915_timeline_fini (struct i915_timeline *tl); -static inline void -i915_timeline_set_subclass (struct i915_timeline *timeline, -unsigned int subclass) -{ -lockdep_set_subclass (&timeline->lock, subclass); - -/* -* Due to an interesting quirk in lockdep's internal debug tracking, -* after setting a subclass we must ensure the lock is used. Otherwise, -* nr_unused_locks is incremented once too often. -*/ -#ifdef CONFIG_DEBUG_LOCK_ALLOC -local_irq_disable (); -lock_map_acquire (&timeline->lock.dep_map); -lock_map_release (&timeline->lock.dep_map); -local_irq_enable (); -#endif -} -struct i915_timeline *i915_timeline_create (struct drm_i915_private *i915,struct i915_vma *global_hwsp);drivers/gpu/drm/i915/i915_timeline_types.h +0
-4@@ -23,10 +23,6 @@ struct i915_timeline {u64 fence_context;u32 seqno; -spinlock_t lock; -#define TIMELINE_CLIENT 0/* default subclass */ -#define TIMELINE_ENGINE 1 -#define TIMELINE_VIRTUAL 2struct mutex mutex;/* protects the flow of requests */ unsigned int pin_count;drivers/gpu/drm/i915/intel_guc_submission.c +8
-8@@ -740,7 +740,7 @@ static bool __guc_dequeue(struct intel_engine_cs *engine)bool submit = false;struct rb_node *rb; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);if (port_isset (port)) {if (intel_engine_has_preemption (engine)) {@@ -822,7 +822,7 @@ static void guc_submission_tasklet(unsigned long data)struct i915_request *rq;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags); rq =port_request (port);while (rq &&i915_request_completed (rq)) {@@ -847,7 +847,7 @@ static void guc_submission_tasklet(unsigned long data)if (!execlists_is_active (execlists,EXECLISTS_ACTIVE_PREEMPT ))guc_dequeue (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_reset_prepare (struct intel_engine_cs *engine)@@ -884,7 +884,7 @@ static void guc_reset(struct intel_engine_cs *engine, bool stalled)struct i915_request *rq;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);execlists_cancel_port_requests (execlists);@@ -900,7 +900,7 @@ static void guc_reset(struct intel_engine_cs *engine, bool stalled)intel_lr_context_reset (engine, rq->hw_context, rq->head, stalled); out_unlock: -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_cancel_requests (struct intel_engine_cs *engine)@@ -926,13 +926,13 @@ static void guc_cancel_requests(struct intel_engine_cs *engine)* submission's irq state, we also wish to remind ourselves that * it is irq state.) */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Cancel the requests on the HW and clear the ELSP tracker. */ execlists_cancel_port_requests (execlists);/* Mark all executing requests as skipped. */ -list_for_each_entry (rq, &engine->timeline.requests, link) { +list_for_each_entry (rq, &engine->active.requests, sched.link) {if (!i915_request_signaled (rq))dma_fence_set_error (&rq->fence, -EIO );@@ -961,7 +961,7 @@ static void guc_cancel_requests(struct intel_engine_cs *engine) execlists->queue =RB_ROOT_CACHED ;GEM_BUG_ON (port_isset (execlists->port)); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_reset_finish (struct intel_engine_cs *engine)drivers/gpu/drm/i915/selftests/mock_timeline.c +0
-1@@ -13,7 +13,6 @@ void mock_timeline_init(struct i915_timeline *timeline, u64 context) timeline->i915 =NULL ; timeline->fence_context = context; -spin_lock_init (&timeline->lock);mutex_init (&timeline->mutex);INIT_ACTIVE_REQUEST (&timeline->last_request);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: [PATCH 3/8] drm/i915: Replace engine->timeline with a plain list
Quoting Mika Kuoppala (2019-06-14 15:34:21)
Quoted 26 lines
Quoted 18 lines
drivers/gpu/drm/i915/i915_scheduler.c +2
-8@@ -296,14 +296,8 @@ static void __i915_schedule(struct i915_sched_node *node,GEM_BUG_ON (node_to_request (node)->engine != engine); node->attr.priority = prio; -if (!list_empty (&node->link)) { -GEM_BUG_ON (intel_engine_is_virtual (engine)); -if (!cache.priolist) - cache.priolist = -i915_sched_lookup_priolist (engine, - prio); -list_move_tail (&node->link, cache.priolist); - }else { + +if (list_empty (&node->link)) {/* * If the request is not in the priolist queue because * it is not yet runnable, then it doesn't contribute drivers/gpu/drm/i915/i915_scheduler.c static void __i915_schedule(struct i915_sched_node *node, · line 316
Quoted 5 lines
drivers/gpu/drm/i915/i915_scheduler.c +0
-2@@ -312,8 +306,16 @@ static void __i915_schedule(struct i915_sched_node *node,* queue; but in that case we may still need to reorder * the inflight requests. */ -if (!i915_sw_fence_done (&node_to_request (node)->submit)) -continue ;Was smooth ride until here. Where did this go?
Quoted 8 lines
drivers/gpu/drm/i915/i915_scheduler.c static void __i915_schedule(struct i915_sched_node *node, · line 313
Quoted 5 lines
drivers/gpu/drm/i915/i915_scheduler.c +5
-0+continue ; + } + +if (!intel_engine_is_virtual (engine) && + !i915_request_is_active (node_to_request (node))) {Is this the replacement? But it is now inside the virtual check which was bug on previously.
Yes. It is because we are reusing rq->sched.link now, and keeping the rq->link as solely a link along rq->timeline->requests. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/8] drm/i915: Replace engine->timeline with a plain list
In reply to Chris WilsonQuoted 760 lines · Chris Wilson
To continue the onslaught of removing the assumption of a global execution ordering, another casualty is the
engine->timeline. Without an actual timeline to track, it is overkill and we can replace it with a much less grand plain list. We still need a list of requests inflight, for the simple purpose of finding inflight requests (for retiring, resetting, preemption etc).Signed-off-by Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/gt/intel_engine.h | 6 ++ drivers/gpu/drm/i915/gt/intel_engine_cs.c | 62 ++++++------ drivers/gpu/drm/i915/gt/intel_engine_types.h | 6 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 95 ++++++++++--------- drivers/gpu/drm/i915/gt/intel_reset.c | 10 +- drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 15 ++- drivers/gpu/drm/i915/gt/mock_engine.c | 18 ++-- drivers/gpu/drm/i915/i915_gpu_error.c | 5 +- drivers/gpu/drm/i915/i915_request.c | 43 +++------ drivers/gpu/drm/i915/i915_request.h | 2 +- drivers/gpu/drm/i915/i915_scheduler.c | 38 ++++---- drivers/gpu/drm/i915/i915_timeline.c | 1 - drivers/gpu/drm/i915/i915_timeline.h | 19 ---- drivers/gpu/drm/i915/i915_timeline_types.h | 4 - drivers/gpu/drm/i915/intel_guc_submission.c | 16 ++-- .../gpu/drm/i915/selftests/mock_timeline.c | 1 - 16 files changed, 153 insertions(+), 188 deletions(-)drivers/gpu/drm/i915/gt/intel_engine.h +6
-0@@ -564,4 +564,10 @@ static inline bool inject_preempt_hang(struct intel_engine_execlists *execlists)#endif +void intel_engine_init_active (struct intel_engine_cs *engine, +unsigned int subclass); +#define ENGINE_PHYSICAL 0 +#define ENGINE_MOCK 1 +#define ENGINE_VIRTUAL 2 +#endif /* _INTEL_RINGBUFFER_H_ */ drivers/gpu/drm/i915/gt/intel_engine_cs.c +31
-31@@ -617,14 +617,7 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine)if (err)return err; - err =i915_timeline_init (engine->i915, - &engine->timeline, - engine->status_page.vma); -if (err) - goto err_hwsp; - -i915_timeline_set_subclass (&engine->timeline,TIMELINE_ENGINE ); - +intel_engine_init_active (engine,ENGINE_PHYSICAL );intel_engine_init_breadcrumbs (engine);intel_engine_init_execlists (engine);intel_engine_init_hangcheck (engine);@@ -637,10 +630,6 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine)intel_sseu_from_device_info (&RUNTIME_INFO (engine->i915)->sseu);return 0 ; - -err_hwsp: -cleanup_status_page (engine); -return err; }/** @@ -797,6 +786,27 @@ static int pin_context(struct i915_gem_context *ctx,return 0 ; } +void +intel_engine_init_active (struct intel_engine_cs *engine,unsigned int subclass) +{ +INIT_LIST_HEAD (&engine->active.requests); + +spin_lock_init (&engine->active.lock); +lockdep_set_subclass (&engine->active.lock, subclass); + +/* +* Due to an interesting quirk in lockdep's internal debug tracking, +* after setting a subclass we must ensure the lock is used. Otherwise, +* nr_unused_locks is incremented once too often. +*/ +#ifdef CONFIG_DEBUG_LOCK_ALLOC +local_irq_disable (); +lock_map_acquire (&engine->active.lock.dep_map); +lock_map_release (&engine->active.lock.dep_map); +local_irq_enable (); +#endif +} +/** * intel_engines_init_common - initialize cengine state which might require hw access * @engine: Engine to initialize. @@ -860,6 +870,8 @@ int intel_engine_init_common(struct intel_engine_cs *engine)*/ void intel_engine_cleanup_common (struct intel_engine_cs *engine) { +GEM_BUG_ON (!list_empty (&engine->active.requests)); +cleanup_status_page (engine);intel_engine_fini_breadcrumbs (engine);@@ -874,8 +886,6 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)intel_context_unpin (engine->kernel_context);GEM_BUG_ON (!llist_empty (&engine->barrier_tasks)); -i915_timeline_fini (&engine->timeline); -intel_wa_list_free (&engine->ctx_wa_list);intel_wa_list_free (&engine->wa_list);intel_wa_list_free (&engine->whitelist);@@ -1482,16 +1492,6 @@ void intel_engine_dump(struct intel_engine_cs *engine,drm_printf (m,"\tRequests:\n" ); - rq =list_first_entry (&engine->timeline.requests, - struct i915_request, link); -if (&rq->link != &engine->timeline.requests) -print_request (m, rq,"\t\tfirst " ); - - rq =list_last_entry (&engine->timeline.requests, - struct i915_request, link); -if (&rq->link != &engine->timeline.requests) -print_request (m, rq,"\t\tlast " ); - rq =intel_engine_find_active_request (engine);if (rq) {print_request (m, rq,"\t\tactive " );@@ -1572,7 +1572,7 @@ int intel_enable_engine_stats(struct intel_engine_cs *engine)if (!intel_engine_supports_stats (engine))return -ENODEV ; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);write_seqlock (&engine->stats.lock);if (unlikely (engine->stats.enabled == ~0 )) {@@ -1598,7 +1598,7 @@ int intel_enable_engine_stats(struct intel_engine_cs *engine) unlock:write_sequnlock (&engine->stats.lock); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags);return err; }@@ -1683,22 +1683,22 @@ intel_engine_find_active_request(struct intel_engine_cs *engine)* At all other times, we must assume the GPU is still running, but * we only care about the snapshot of this moment. */ -spin_lock_irqsave (&engine->timeline.lock, flags); -list_for_each_entry (request, &engine->timeline.requests, link) { +spin_lock_irqsave (&engine->active.lock, flags); +list_for_each_entry (request, &engine->active.requests, sched.link) {if (i915_request_completed (request))continue ;if (!i915_request_started (request)) -break ; +continue ;/* More than one preemptible request may match! */ if (!match_ring (request)) -break ; +continue ; active = request;break ; } -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags);return active; }drivers/gpu/drm/i915/gt/intel_engine_types.h +5
-1@@ -288,7 +288,11 @@ struct intel_engine_cs {struct intel_ring *buffer; -struct i915_timeline timeline; +struct { +spinlock_t lock; +struct list_head requests; + } active; +struct llist_head barrier_tasks;struct intel_context *kernel_context;/* pinned */ drivers/gpu/drm/i915/gt/intel_lrc.c +50
-45@@ -298,8 +298,8 @@ static inline bool need_preempt(const struct intel_engine_cs *engine,* Check against the first request in ELSP[1], it will, thanks to the * power of PI, be the highest priority of that context. */ -if (!list_is_last (&rq->link, &engine->timeline.requests) && -rq_prio (list_next_entry (rq, link)) > last_prio) +if (!list_is_last (&rq->sched.link, &engine->active.requests) && +rq_prio (list_next_entry (rq, sched.link)) > last_prio)return true;if (rb) {@@ -434,11 +434,11 @@ __unwind_incomplete_requests(struct intel_engine_cs *engine)struct list_head *uninitialized_var (pl );int prio =I915_PRIORITY_INVALID ; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);list_for_each_entry_safe_reverse (rq, rn, - &engine->timeline.requests, - link) { + &engine->active.requests, + sched.link) {struct intel_engine_cs *owner;if (i915_request_completed (rq))@@ -465,7 +465,7 @@ __unwind_incomplete_requests(struct intel_engine_cs *engine) }GEM_BUG_ON (RB_EMPTY_ROOT (&engine->execlists.queue.rb_root)); -list_add (&rq->sched.link, pl); +list_move (&rq->sched.link, pl); active = rq; }else { rq->engine = owner;@@ -933,11 +933,11 @@ static void execlists_dequeue(struct intel_engine_cs *engine)rb_entry (rb,typeof (*ve), nodes[engine->id].rb);struct i915_request *rq; -spin_lock (&ve->base.timeline.lock); +spin_lock (&ve->base.active.lock); rq = ve->request;if (unlikely (!rq)) {/* lost the race to a sibling */ -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock);rb_erase_cached (rb, &execlists->virtual);RB_CLEAR_NODE (rb); rb =rb_first_cached (&execlists->virtual);@@ -950,13 +950,13 @@ static void execlists_dequeue(struct intel_engine_cs *engine)if (rq_prio (rq) >=queue_prio (execlists)) {if (!virtual_matches (ve, rq, engine)) { -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock); rb =rb_next (rb);continue ; }if (last && !can_merge_rq (last, rq)) { -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock);return ;/* leave this rq for another engine */ }@@ -1011,7 +1011,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) last = rq; } -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock);break ; }@@ -1068,8 +1068,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine)GEM_BUG_ON (port_isset (port)); } -list_del_init (&rq->sched.link); -__i915_request_submit (rq);trace_i915_request_in (rq,port_index (port, execlists));@@ -1170,7 +1168,7 @@ static void process_csb(struct intel_engine_cs *engine)const u8 num_entries = execlists->csb_size;u8 head, tail; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);/* * Note that csb_write, csb_status may be either in HWSP or mmio. @@ -1330,7 +1328,7 @@ static void process_csb(struct intel_engine_cs *engine)static void __execlists_submission_tasklet (struct intel_engine_cs *const engine) { -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);process_csb (engine);if (!execlists_is_active (&engine->execlists,EXECLISTS_ACTIVE_PREEMPT ))@@ -1351,15 +1349,16 @@ static void execlists_submission_tasklet(unsigned long data) !!intel_wakeref_active (&engine->wakeref), engine->execlists.active); -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__execlists_submission_tasklet (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void queue_request (struct intel_engine_cs *engine,struct i915_sched_node *node,int prio) { +GEM_BUG_ON (!list_empty (&node->link));list_add_tail (&node->link,i915_sched_lookup_priolist (engine, prio)); }@@ -1390,7 +1389,7 @@ static void execlists_submit_request(struct i915_request *request)unsigned long flags;/* Will be called from irq-context when using foreign fences. */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);queue_request (engine, &request->sched,rq_prio (request));@@ -1399,7 +1398,7 @@ static void execlists_submit_request(struct i915_request *request)submit_queue (engine,rq_prio (request)); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void __execlists_context_fini (struct intel_context *ce)@@ -2050,8 +2049,8 @@ static void execlists_reset_prepare(struct intel_engine_cs *engine)intel_engine_stop_cs (engine);/* And flush any current direct submission. */ -spin_lock_irqsave (&engine->timeline.lock, flags); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static bool lrc_regs_ok (const struct i915_request *rq)@@ -2094,11 +2093,11 @@ static void reset_csb_pointers(struct intel_engine_execlists *execlists)static struct i915_request *active_request (struct i915_request *rq) { -const struct list_head *const list = &rq->engine->timeline.requests; +const struct list_head *const list = &rq->engine->active.requests;const struct intel_context *const context = rq->hw_context;struct i915_request *active =NULL ; -list_for_each_entry_from_reverse (rq, list, link) { +list_for_each_entry_from_reverse (rq, list, sched.link) {if (i915_request_completed (rq))break ;@@ -2215,11 +2214,11 @@ static void execlists_reset(struct intel_engine_cs *engine, bool stalled)GEM_TRACE ("%s\n" , engine->name); -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__execlists_reset (engine, stalled); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void nop_submission_tasklet (unsigned long data)@@ -2250,12 +2249,12 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)* submission's irq state, we also wish to remind ourselves that * it is irq state.) */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__execlists_reset (engine, true);/* Mark all executing requests as skipped. */ -list_for_each_entry (rq, &engine->timeline.requests, link) { +list_for_each_entry (rq, &engine->active.requests, sched.link) {if (!i915_request_signaled (rq))dma_fence_set_error (&rq->fence, -EIO );@@ -2286,7 +2285,7 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)rb_erase_cached (rb, &execlists->virtual);RB_CLEAR_NODE (rb); -spin_lock (&ve->base.timeline.lock); +spin_lock (&ve->base.active.lock);if (ve->request) { ve->request->engine = engine;__i915_request_submit (ve->request);@@ -2295,7 +2294,7 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine) ve->base.execlists.queue_priority_hint =INT_MIN ; ve->request =NULL ; } -spin_unlock (&ve->base.timeline.lock); +spin_unlock (&ve->base.active.lock); }/* Remaining _unready_ requests will be nop'ed when submitted */ @@ -2307,7 +2306,7 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)GEM_BUG_ON (__tasklet_is_enabled (&execlists->tasklet)); execlists->tasklet.func = nop_submission_tasklet; -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void execlists_reset_finish (struct intel_engine_cs *engine)@@ -3010,12 +3009,18 @@ static int execlists_context_deferred_alloc(struct intel_context *ce,return ret; } +static struct list_head *virtual_queue (struct virtual_engine *ve) +{ +return &ve->base.execlists.default_priolist.requests[0 ]; +} +static void virtual_context_destroy (struct kref *kref) {struct virtual_engine *ve =container_of (kref,typeof (*ve), context.ref);unsigned int n; +GEM_BUG_ON (!list_empty (virtual_queue (ve)));GEM_BUG_ON (ve->request);GEM_BUG_ON (ve->context.inflight);@@ -3026,13 +3031,13 @@ static void virtual_context_destroy(struct kref *kref)if (RB_EMPTY_NODE (node))continue ; -spin_lock_irq (&sibling->timeline.lock); +spin_lock_irq (&sibling->active.lock);/* Detachment is lazily performed in the execlists tasklet */ if (!RB_EMPTY_NODE (node))rb_erase_cached (node, &sibling->execlists.virtual); -spin_unlock_irq (&sibling->timeline.lock); +spin_unlock_irq (&sibling->active.lock); }GEM_BUG_ON (__tasklet_is_scheduled (&ve->base.execlists.tasklet));@@ -3040,8 +3045,6 @@ static void virtual_context_destroy(struct kref *kref)__execlists_context_fini (&ve->context);kfree (ve->bonds); - -i915_timeline_fini (&ve->base.timeline);kfree (ve); }@@ -3161,16 +3164,16 @@ static void virtual_submission_tasklet(unsigned long data)if (unlikely (!(mask & sibling->mask))) {if (!RB_EMPTY_NODE (&node->rb)) { -spin_lock (&sibling->timeline.lock); +spin_lock (&sibling->active.lock);rb_erase_cached (&node->rb, &sibling->execlists.virtual);RB_CLEAR_NODE (&node->rb); -spin_unlock (&sibling->timeline.lock); +spin_unlock (&sibling->active.lock); }continue ; } -spin_lock (&sibling->timeline.lock); +spin_lock (&sibling->active.lock);if (!RB_EMPTY_NODE (&node->rb)) {/* @@ -3214,7 +3217,7 @@ static void virtual_submission_tasklet(unsigned long data)tasklet_hi_schedule (&sibling->execlists.tasklet); } -spin_unlock (&sibling->timeline.lock); +spin_unlock (&sibling->active.lock); }local_irq_enable (); }@@ -3231,9 +3234,13 @@ static void virtual_submit_request(struct i915_request *rq)GEM_BUG_ON (ve->base.submit_request != virtual_submit_request);GEM_BUG_ON (ve->request); +GEM_BUG_ON (!list_empty (virtual_queue (ve))); + ve->base.execlists.queue_priority_hint =rq_prio (rq);WRITE_ONCE (ve->request, rq); +list_move_tail (&rq->sched.link,virtual_queue (ve)); +tasklet_schedule (&ve->base.execlists.tasklet); }@@ -3297,10 +3304,7 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx,snprintf (ve->base.name,sizeof (ve->base.name),"virtual" ); - err =i915_timeline_init (ctx->i915, &ve->base.timeline,NULL ); -if (err) - goto err_put; -i915_timeline_set_subclass (&ve->base.timeline,TIMELINE_VIRTUAL ); +intel_engine_init_active (&ve->base,ENGINE_VIRTUAL );intel_engine_init_execlists (&ve->base);@@ -3311,6 +3315,7 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx, ve->base.submit_request = virtual_submit_request; ve->base.bond_execute = virtual_bond_execute; +INIT_LIST_HEAD (virtual_queue (ve)); ve->base.execlists.queue_priority_hint =INT_MIN ; tasklet_init(&ve->base.execlists.tasklet, virtual_submission_tasklet,@@ -3465,11 +3470,11 @@ void intel_execlists_show_requests(struct intel_engine_cs *engine,unsigned int count;struct rb_node *rb; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags); last =NULL ; count =0 ; -list_for_each_entry (rq, &engine->timeline.requests, link) { +list_for_each_entry (rq, &engine->active.requests, sched.link) {if (count++ < max -1 )show_request (m, rq,"\t\tE " );else @@ -3532,7 +3537,7 @@ void intel_execlists_show_requests(struct intel_engine_cs *engine,show_request (m, last,"\t\tV " ); } -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); } void intel_lr_context_reset(struct intel_engine_cs *engine,drivers/gpu/drm/i915/gt/intel_reset.c +5
-5@@ -49,12 +49,12 @@ static void engine_skip_context(struct i915_request *rq)struct intel_engine_cs *engine = rq->engine;struct i915_gem_context *hung_ctx = rq->gem_context; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);if (!i915_request_is_active (rq))return ; -list_for_each_entry_continue (rq, &engine->timeline.requests, link) +list_for_each_entry_continue (rq, &engine->active.requests, sched.link)if (rq->gem_context == hung_ctx)i915_request_skip (rq, -EIO ); }@@ -130,7 +130,7 @@ void i915_reset_request(struct i915_request *rq, bool guilty) rq->fence.seqno, yesno(guilty)); -lockdep_assert_held (&rq->engine->timeline.lock); +lockdep_assert_held (&rq->engine->active.lock);GEM_BUG_ON (i915_request_completed (rq));if (guilty) {@@ -785,10 +785,10 @@ static void nop_submit_request(struct i915_request *request) engine->name, request->fence.context, request->fence.seqno);dma_fence_set_error (&request->fence, -EIO ); -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__i915_request_submit (request);i915_request_mark_complete (request); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags);intel_engine_queue_breadcrumbs (engine); }drivers/gpu/drm/i915/gt/intel_ringbuffer.c +6
-9@@ -730,14 +730,13 @@ static void reset_prepare(struct intel_engine_cs *engine)static void reset_ring (struct intel_engine_cs *engine,bool stalled) { -struct i915_timeline *tl = &engine->timeline;struct i915_request *pos, *rq;unsigned long flags;u32 head; rq =NULL ; -spin_lock_irqsave (&tl->lock, flags); -list_for_each_entry (pos, &tl->requests, link) { +spin_lock_irqsave (&engine->active.lock, flags); +list_for_each_entry (pos, &engine->active.requests, sched.link) {if (!i915_request_completed (pos)) { rq = pos;break ;@@ -791,7 +790,7 @@ static void reset_ring(struct intel_engine_cs *engine, bool stalled) } engine->buffer->head =intel_ring_wrap (engine->buffer, head); -spin_unlock_irqrestore (&tl->lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void reset_finish (struct intel_engine_cs *engine)@@ -877,10 +876,10 @@ static void cancel_requests(struct intel_engine_cs *engine)struct i915_request *request;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Mark all submitted requests as skipped. */ -list_for_each_entry (request, &engine->timeline.requests, link) { +list_for_each_entry (request, &engine->active.requests, sched.link) {if (!i915_request_signaled (request))dma_fence_set_error (&request->fence, -EIO );@@ -889,7 +888,7 @@ static void cancel_requests(struct intel_engine_cs *engine)/* Remaining _unready_ requests will be nop'ed when submitted */ -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void i9xx_submit_request (struct i915_request *request)@@ -1267,8 +1266,6 @@ intel_engine_create_ring(struct intel_engine_cs *engine,GEM_BUG_ON (!is_power_of_2 (size));GEM_BUG_ON (RING_CTL_SIZE (size) & ~RING_NR_PAGES ); -GEM_BUG_ON (timeline == &engine->timeline); -lockdep_assert_held (&engine->i915->drm.struct_mutex); ring =kzalloc (sizeof (*ring),GFP_KERNEL );if (!ring)drivers/gpu/drm/i915/gt/mock_engine.c +6
-12@@ -229,17 +229,17 @@ static void mock_cancel_requests(struct intel_engine_cs *engine)struct i915_request *request;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Mark all submitted requests as skipped. */ -list_for_each_entry (request, &engine->timeline.requests, sched.link) { +list_for_each_entry (request, &engine->active.requests, sched.link) {if (!i915_request_signaled (request))dma_fence_set_error (&request->fence, -EIO );i915_request_mark_complete (request); } -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); } struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,@@ -285,28 +285,23 @@ int mock_engine_init(struct intel_engine_cs *engine)struct drm_i915_private *i915 = engine->i915;int err; +intel_engine_init_active (engine,ENGINE_MOCK );intel_engine_init_breadcrumbs (engine);intel_engine_init_execlists (engine);intel_engine_init__pm (engine); -if (i915_timeline_init (i915, &engine->timeline,NULL )) - goto err_breadcrumbs; -i915_timeline_set_subclass (&engine->timeline,TIMELINE_ENGINE ); - engine->kernel_context =i915_gem_context_get_engine (i915->kernel_context, engine->id);if (IS_ERR (engine->kernel_context)) - goto err_timeline; + goto err_breadcrumbs; err =intel_context_pin (engine->kernel_context);intel_context_put (engine->kernel_context);if (err) - goto err_timeline; + goto err_breadcrumbs;return 0 ; -err_timeline: -i915_timeline_fini (&engine->timeline); err_breadcrumbs:intel_engine_fini_breadcrumbs (engine);return -ENOMEM ;@@ -340,7 +335,6 @@ void mock_engine_free(struct intel_engine_cs *engine)intel_context_unpin (engine->kernel_context);intel_engine_fini_breadcrumbs (engine); -i915_timeline_fini (&engine->timeline);kfree (engine); }drivers/gpu/drm/i915/i915_gpu_error.c +3
-2@@ -1275,7 +1275,7 @@ static void engine_record_requests(struct intel_engine_cs *engine, count =0 ; request = first; -list_for_each_entry_from (request, &engine->timeline.requests, link) +list_for_each_entry_from (request, &engine->active.requests, sched.link) count++;if (!count)return ;@@ -1288,7 +1288,8 @@ static void engine_record_requests(struct intel_engine_cs *engine, count =0 ; request = first; -list_for_each_entry_from (request, &engine->timeline.requests, link) { +list_for_each_entry_from (request, + &engine->active.requests, sched.link) {if (count >= ee->num_requests) {/* * If the ring request list was changed in drivers/gpu/drm/i915/i915_request.c +3
-3@@ -232,9 +232,9 @@ static bool i915_request_retire(struct i915_request *rq)local_irq_disable (); -spin_lock (&rq->engine->timeline.lock); -list_del (&rq->link); -spin_unlock (&rq->engine->timeline.lock); +spin_lock (&rq->engine->active.lock); +list_del (&rq->sched.link); +spin_unlock (&rq->engine->active.lock);spin_lock (&rq->lock);i915_request_mark_complete (rq);
drivers/gpu/drm/i915/i915_request.c static bool i915_request_retire(struct i915_request *rq) · line 257
Quoted 4 lines
drivers/gpu/drm/i915/i915_request.c +1
-0@@ -254,6 +254,7 @@ static bool i915_request_retire(struct i915_request *rq)intel_context_unpin (rq->hw_context);i915_request_remove_from_client (rq); +list_del (&rq->link);
This is now unguarded. and the timeline mutex is not here to help either.
-Mika
Quoted 387 lines
drivers/gpu/drm/i915/i915_request.c +9
-27free_capture_list (rq);i915_sched_node_fini (&rq->sched);@@ -373,28 +374,17 @@ __i915_request_await_execution(struct i915_request *rq,return 0 ; } -static void move_to_timeline (struct i915_request *request, -struct i915_timeline *timeline) -{ -GEM_BUG_ON (request->timeline == &request->engine->timeline); -lockdep_assert_held (&request->engine->timeline.lock); - -spin_lock (&request->timeline->lock); -list_move_tail (&request->link, &timeline->requests); -spin_unlock (&request->timeline->lock); -} -void __i915_request_submit (struct i915_request *request) {struct intel_engine_cs *engine = request->engine; -GEM_TRACE ("%s fence %llx:%lld -> current %d\n" , +GEM_TRACE ("%s fence %llx:%lld, current %d\n" , engine->name, request->fence.context, request->fence.seqno,hwsp_seqno (request));GEM_BUG_ON (!irqs_disabled ()); -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);if (i915_gem_context_is_banned (request->gem_context))i915_request_skip (request, -EIO );@@ -422,6 +412,8 @@ void __i915_request_submit(struct i915_request *request)/* We may be recursing from the signal callback of another i915 fence */ spin_lock_nested (&request->lock,SINGLE_DEPTH_NESTING ); +list_move_tail (&request->sched.link, &engine->active.requests); +GEM_BUG_ON (test_bit (I915_FENCE_FLAG_ACTIVE , &request->fence.flags));set_bit (I915_FENCE_FLAG_ACTIVE , &request->fence.flags);@@ -437,9 +429,6 @@ void __i915_request_submit(struct i915_request *request) engine->emit_fini_breadcrumb (request, request->ring->vaddr + request->postfix); -/* Transfer from per-context onto the global per-engine timeline */ -move_to_timeline (request, &engine->timeline); - engine->serial++;trace_i915_request_execute (request);@@ -451,11 +440,11 @@ void i915_request_submit(struct i915_request *request)unsigned long flags;/* Will be called from irq-context when using foreign fences. */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__i915_request_submit (request); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }void __i915_request_unsubmit (struct i915_request *request)@@ -468,7 +457,7 @@ void __i915_request_unsubmit(struct i915_request *request) hwsp_seqno(request));GEM_BUG_ON (!irqs_disabled ()); -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);/* * Only unwind in reverse order, required so that the per-context list @@ -486,9 +475,6 @@ void __i915_request_unsubmit(struct i915_request *request)spin_unlock (&request->lock); -/* Transfer back from the global per-engine timeline to per-context */ -move_to_timeline (request, request->timeline); -/* We've already spun, don't charge on resubmitting. */ if (request->sched.semaphores &&i915_request_started (request)) { request->sched.attr.priority |=I915_PRIORITY_NOSEMAPHORE ;@@ -510,11 +496,11 @@ void i915_request_unsubmit(struct i915_request *request)unsigned long flags;/* Will be called from irq-context when using foreign fences. */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);__i915_request_unsubmit (request); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static int __i915_sw_fence_call@@ -669,7 +655,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) rq->engine = ce->engine; rq->ring = ce->ring; rq->timeline = tl; -GEM_BUG_ON (rq->timeline == &ce->engine->timeline); rq->hwsp_seqno = tl->hwsp_seqno; rq->hwsp_cacheline = tl->hwsp_cacheline; rq->rcustate =get_state_synchronize_rcu ();/* acts as smp_mb() */ @@ -1137,9 +1122,7 @@ __i915_request_add_to_timeline(struct i915_request *rq) 0); } -spin_lock_irq (&timeline->lock);list_add_tail (&rq->link, &timeline->requests); -spin_unlock_irq (&timeline->lock);/* * Make sure that no request gazumped us - if it was allocated after drivers/gpu/drm/i915/i915_request.h +1
-1@@ -217,7 +217,7 @@ struct i915_request {bool waitboost; -/** engine->request_list entry for this request */ +/** timeline->request entry for this request */ struct list_head link;/** ring->request_list entry for this request */ drivers/gpu/drm/i915/i915_scheduler.c +19
-19@@ -77,7 +77,7 @@ i915_sched_lookup_priolist(struct intel_engine_cs *engine, int prio)bool first = true;int idx, i; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);assert_priolists (execlists);/* buckets sorted from highest [in slot 0] to lowest priority */ @@ -162,9 +162,9 @@ sched_lock_engine(const struct i915_sched_node *node,* check that the rq still belongs to the newly locked engine. */ while (locked != (engine =READ_ONCE (rq->engine))) { -spin_unlock (&locked->timeline.lock); +spin_unlock (&locked->active.lock);memset (cache,0 ,sizeof (*cache)); -spin_lock (&engine->timeline.lock); +spin_lock (&engine->active.lock); locked = engine; }@@ -189,7 +189,7 @@ static void kick_submission(struct intel_engine_cs *engine, int prio)* tasklet, i.e. we have not change the priority queue * sufficiently to oust the running context. */ -if (inflight && !i915_scheduler_need_preempt (prio,rq_prio (inflight))) +if (!inflight || !i915_scheduler_need_preempt (prio,rq_prio (inflight)))return ;tasklet_hi_schedule (&engine->execlists.tasklet);@@ -278,7 +278,7 @@ static void __i915_schedule(struct i915_sched_node *node,memset (&cache,0 ,sizeof (cache)); engine =node_to_request (node)->engine; -spin_lock (&engine->timeline.lock); +spin_lock (&engine->active.lock);/* Fifo and depth-first replacement ensure our deps execute before us */ engine =sched_lock_engine (node, engine, &cache);@@ -287,7 +287,7 @@ static void __i915_schedule(struct i915_sched_node *node, node = dep->signaler; engine =sched_lock_engine (node, engine, &cache); -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);/* Recheck after acquiring the engine->timeline.lock */ if (prio <= node->attr.priority ||node_signaled (node))@@ -296,14 +296,8 @@ static void __i915_schedule(struct i915_sched_node *node,GEM_BUG_ON (node_to_request (node)->engine != engine); node->attr.priority = prio; -if (!list_empty (&node->link)) { -GEM_BUG_ON (intel_engine_is_virtual (engine)); -if (!cache.priolist) - cache.priolist = -i915_sched_lookup_priolist (engine, - prio); -list_move_tail (&node->link, cache.priolist); - }else { + +if (list_empty (&node->link)) {/* * If the request is not in the priolist queue because * it is not yet runnable, then it doesn't contribute @@ -312,8 +306,16 @@ static void __i915_schedule(struct i915_sched_node *node,* queue; but in that case we may still need to reorder * the inflight requests. */ -if (!i915_sw_fence_done (&node_to_request (node)->submit)) -continue ; +continue ; + } + +if (!intel_engine_is_virtual (engine) && + !i915_request_is_active (node_to_request (node))) { +if (!cache.priolist) + cache.priolist = +i915_sched_lookup_priolist (engine, + prio); +list_move_tail (&node->link, cache.priolist); }if (prio <= engine->execlists.queue_priority_hint)@@ -325,7 +327,7 @@ static void __i915_schedule(struct i915_sched_node *node,kick_submission (engine, prio); } -spin_unlock (&engine->timeline.lock); +spin_unlock (&engine->active.lock); }void i915_schedule (struct i915_request *rq,const struct i915_sched_attr *attr)@@ -439,8 +441,6 @@ void i915_sched_node_fini(struct i915_sched_node *node) {struct i915_dependency *dep, *tmp; -GEM_BUG_ON (!list_empty (&node->link)); -spin_lock_irq (&schedule_lock);/* drivers/gpu/drm/i915/i915_timeline.c +0
-1@@ -251,7 +251,6 @@ int i915_timeline_init(struct drm_i915_private *i915, timeline->fence_context =dma_fence_context_alloc (1 ); -spin_lock_init (&timeline->lock);mutex_init (&timeline->mutex);INIT_ACTIVE_REQUEST (&timeline->last_request);drivers/gpu/drm/i915/i915_timeline.h +0
-19@@ -36,25 +36,6 @@ int i915_timeline_init(struct drm_i915_private *i915, struct i915_vma *hwsp);void i915_timeline_fini (struct i915_timeline *tl); -static inline void -i915_timeline_set_subclass (struct i915_timeline *timeline, -unsigned int subclass) -{ -lockdep_set_subclass (&timeline->lock, subclass); - -/* -* Due to an interesting quirk in lockdep's internal debug tracking, -* after setting a subclass we must ensure the lock is used. Otherwise, -* nr_unused_locks is incremented once too often. -*/ -#ifdef CONFIG_DEBUG_LOCK_ALLOC -local_irq_disable (); -lock_map_acquire (&timeline->lock.dep_map); -lock_map_release (&timeline->lock.dep_map); -local_irq_enable (); -#endif -} -struct i915_timeline *i915_timeline_create (struct drm_i915_private *i915,struct i915_vma *global_hwsp);drivers/gpu/drm/i915/i915_timeline_types.h +0
-4@@ -23,10 +23,6 @@ struct i915_timeline {u64 fence_context;u32 seqno; -spinlock_t lock; -#define TIMELINE_CLIENT 0/* default subclass */ -#define TIMELINE_ENGINE 1 -#define TIMELINE_VIRTUAL 2struct mutex mutex;/* protects the flow of requests */ unsigned int pin_count;drivers/gpu/drm/i915/intel_guc_submission.c +8
-8@@ -740,7 +740,7 @@ static bool __guc_dequeue(struct intel_engine_cs *engine)bool submit = false;struct rb_node *rb; -lockdep_assert_held (&engine->timeline.lock); +lockdep_assert_held (&engine->active.lock);if (port_isset (port)) {if (intel_engine_has_preemption (engine)) {@@ -822,7 +822,7 @@ static void guc_submission_tasklet(unsigned long data)struct i915_request *rq;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags); rq =port_request (port);while (rq &&i915_request_completed (rq)) {@@ -847,7 +847,7 @@ static void guc_submission_tasklet(unsigned long data)if (!execlists_is_active (execlists,EXECLISTS_ACTIVE_PREEMPT ))guc_dequeue (engine); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_reset_prepare (struct intel_engine_cs *engine)@@ -884,7 +884,7 @@ static void guc_reset(struct intel_engine_cs *engine, bool stalled)struct i915_request *rq;unsigned long flags; -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);execlists_cancel_port_requests (execlists);@@ -900,7 +900,7 @@ static void guc_reset(struct intel_engine_cs *engine, bool stalled)intel_lr_context_reset (engine, rq->hw_context, rq->head, stalled); out_unlock: -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_cancel_requests (struct intel_engine_cs *engine)@@ -926,13 +926,13 @@ static void guc_cancel_requests(struct intel_engine_cs *engine)* submission's irq state, we also wish to remind ourselves that * it is irq state.) */ -spin_lock_irqsave (&engine->timeline.lock, flags); +spin_lock_irqsave (&engine->active.lock, flags);/* Cancel the requests on the HW and clear the ELSP tracker. */ execlists_cancel_port_requests (execlists);/* Mark all executing requests as skipped. */ -list_for_each_entry (rq, &engine->timeline.requests, link) { +list_for_each_entry (rq, &engine->active.requests, sched.link) {if (!i915_request_signaled (rq))dma_fence_set_error (&rq->fence, -EIO );@@ -961,7 +961,7 @@ static void guc_cancel_requests(struct intel_engine_cs *engine) execlists->queue =RB_ROOT_CACHED ;GEM_BUG_ON (port_isset (execlists->port)); -spin_unlock_irqrestore (&engine->timeline.lock, flags); +spin_unlock_irqrestore (&engine->active.lock, flags); }static void guc_reset_finish (struct intel_engine_cs *engine)drivers/gpu/drm/i915/selftests/mock_timeline.c +0
-1@@ -13,7 +13,6 @@ void mock_timeline_init(struct i915_timeline *timeline, u64 context) timeline->i915 =NULL ; timeline->fence_context = context; -spin_lock_init (&timeline->lock);mutex_init (&timeline->mutex);INIT_ACTIVE_REQUEST (&timeline->last_request);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: [PATCH 3/8] drm/i915: Replace engine->timeline with a plain list
Quoting Mika Kuoppala (2019-06-14 16:50:33)
Quoted 9 lines
drivers/gpu/drm/i915/i915_request.c static bool i915_request_retire(struct i915_request *rq) · line 257
Quoted 5 lines · Chris Wilson
drivers/gpu/drm/i915/i915_request.c +1
-0@@ -254,6 +254,7 @@ static bool i915_request_retire(struct i915_request *rq)intel_context_unpin (rq->hw_context);i915_request_remove_from_client (rq); +list_del (&rq->link);This is now unguarded. and the timeline mutex is not here to help either.
It is guarded by the caller to i915_request_retire, we can only retire under the same lock as we construct requests. Currently that is struct_mutex with the big switcheroo coming at the end. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Mika Kuoppala
Reviewed-byRe: [PATCH 3/8] drm/i915: Replace engine->timeline with a plain list
Quoted 11 lines · Chris Wilson
Quoting Mika Kuoppala (2019-06-14 16:50:33)
Quoted 9 lines
drivers/gpu/drm/i915/i915_request.c static bool i915_request_retire(struct i915_request *rq) · line 257
Quoted 5 lines · Chris Wilson
drivers/gpu/drm/i915/i915_request.c +1
-0@@ -254,6 +254,7 @@ static bool i915_request_retire(struct i915_request *rq)intel_context_unpin (rq->hw_context);i915_request_remove_from_client (rq); +list_del (&rq->link);This is now unguarded. and the timeline mutex is not here to help either.
Quoted 3 lines
It is guarded by the caller to
i915_request_retire, we can only retire under the same lock as we construct requests. Currently that isstruct_mutexwith the big switcheroo coming at the end.
Yup found it.
Quoted 1 line
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/8 drm/i915: Flush the execution-callbacks on retiring
In reply to Chris WilsonIn the unlikely case the request completes while we regard it as not even executing on the GPU (see the next patch!), we have to flush any pending execution callbacks at retirement and ensure that we do not add any more.
--- drivers/gpu/drm/i915/i915_request.c | 93 +++++++++++++++-------------- 1 file changed, 49 insertions(+), 44 deletions(-)
drivers/gpu/drm/i915/i915_request.c +49 -44
@@ -119,6 +119,50 @@ const struct dma_fence_ops i915_fence_ops = { .release = i915_fence_release, }; +static void irq_execute_cb (struct irq_work *wrk) +{ +struct execute_cb *cb =container_of (wrk,typeof (*cb), work); + +i915_sw_fence_complete (cb->fence); +kmem_cache_free (global.slab_execute_cbs, cb); +} + +static void irq_execute_cb_hook (struct irq_work *wrk) +{ +struct execute_cb *cb =container_of (wrk,typeof (*cb), work); + + cb->hook(container_of(cb->fence, struct i915_request, submit), + &cb->signal->fence); +i915_request_put (cb->signal); + +irq_execute_cb (wrk); +} + +static void __notify_execute_cb (struct i915_request *rq) +{ +struct execute_cb *cb; + +lockdep_assert_held (&rq->lock); + +if (list_empty (&rq->execute_cb)) +return ; + +list_for_each_entry (cb, &rq->execute_cb, link) +irq_work_queue (&cb->work); + +/* +* XXX Rollback on __i915_request_unsubmit() +* +* In the future, perhaps when we have an active time-slicing scheduler, +* it will be interesting to unsubmit parallel execution and remove +* busywaits from the GPU until their master is restarted. This is +* quite hairy, we have to carefully rollback the fence and do a +* preempt-to-idle cycle on the target engine, all the while the +* master execute_cb may refire. +*/ +INIT_LIST_HEAD (&rq->execute_cb); +} +static inline void i915_request_remove_from_client (struct i915_request *request) {
@@ -246,6 +290,11 @@ static bool i915_request_retire(struct i915_request *rq)GEM_BUG_ON (!atomic_read (&rq->i915->gt_pm.rps.num_waiters));atomic_dec (&rq->i915->gt_pm.rps.num_waiters); } +if (!test_bit (I915_FENCE_FLAG_ACTIVE , &rq->fence.flags)) { +set_bit (I915_FENCE_FLAG_ACTIVE , &rq->fence.flags); +__notify_execute_cb (rq); + } +GEM_BUG_ON (!list_empty (&rq->execute_cb));spin_unlock (&rq->lock);local_irq_enable ();
@@ -285,50 +334,6 @@ void i915_request_retire_upto(struct i915_request *rq) }while (i915_request_retire (tmp) && tmp != rq); } -static void irq_execute_cb (struct irq_work *wrk) -{ -struct execute_cb *cb =container_of (wrk,typeof (*cb), work); - -i915_sw_fence_complete (cb->fence); -kmem_cache_free (global.slab_execute_cbs, cb); -} - -static void irq_execute_cb_hook (struct irq_work *wrk) -{ -struct execute_cb *cb =container_of (wrk,typeof (*cb), work); - - cb->hook(container_of(cb->fence, struct i915_request, submit), - &cb->signal->fence); -i915_request_put (cb->signal); - -irq_execute_cb (wrk); -} - -static void __notify_execute_cb (struct i915_request *rq) -{ -struct execute_cb *cb; - -lockdep_assert_held (&rq->lock); - -if (list_empty (&rq->execute_cb)) -return ; - -list_for_each_entry (cb, &rq->execute_cb, link) -irq_work_queue (&cb->work); - -/* -* XXX Rollback on __i915_request_unsubmit() -* -* In the future, perhaps when we have an active time-slicing scheduler, -* it will be interesting to unsubmit parallel execution and remove -* busywaits from the GPU until their master is restarted. This is -* quite hairy, we have to carefully rollback the fence and do a -* preempt-to-idle cycle on the target engine, all the while the -* master execute_cb may refire. -*/ -INIT_LIST_HEAD (&rq->execute_cb); -} - static int __i915_request_await_execution(struct i915_request *rq, struct i915_request *signal,
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/8 drm/i915/execlists: Preempt-to-busy
In reply to Chris WilsonWhen using a global seqno, we required a precise stop-the-workd event to handle preemption and unwind the global seqno counter. To accomplish this, we would preempt to a special out-of-band context and wait for the machine to report that it was idle. Given an idle machine, we could very precisely see which requests had completed and which we needed to feed back into the run queue.
However, now that we have scrapped the global seqno, we no longer need to precisely unwind the global counter and only track requests by their per-context seqno. This allows us to loosely unwind inflight requests while scheduling a preemption, with the enormous caveat that the requests we put back on the run queue are still _inflight_ (until the preemption request is complete). This makes request tracking much more messy, as at any point then we can see a completed request that we believe is not currently scheduled for execution. We also have to be careful not to rewind RING_TAIL past RING_HEAD on preempting to the running context, and for this we use a semaphore to prevent completion of the request before continuing.
To accomplish this feat, we change how we track requests scheduled to the HW. Instead of appending our requests onto a single list as we submit, we track each submission to ELSP as its own block. Then upon receiving the CS preemption event, we promote the pending block to the inflight block (discarding what was previously being tracked). As normal CS completion events arrive, we then remove stale entries from the inflight tracker.
--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/gt/intel_context_types.h | 5 + drivers/gpu/drm/i915/gt/intel_engine.h | 61 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 61 +- drivers/gpu/drm/i915/gt/intel_engine_types.h | 52 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 671 ++++++++---------- drivers/gpu/drm/i915/i915_gpu_error.c | 19 +- drivers/gpu/drm/i915/i915_request.c | 6 + drivers/gpu/drm/i915/i915_request.h | 1 + drivers/gpu/drm/i915/i915_scheduler.c | 3 +- drivers/gpu/drm/i915/i915_utils.h | 12 + drivers/gpu/drm/i915/intel_guc_submission.c | 175 ++--- drivers/gpu/drm/i915/selftests/i915_request.c | 8 +- 13 files changed, 465 insertions(+), 611 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +1 -1
@@ -646,7 +646,7 @@ static void init_contexts(struct drm_i915_private *i915)static bool needs_preempt_context (struct drm_i915_private *i915) { -return HAS_EXECLISTS (i915); +return USES_GUC_SUBMISSION (i915); }int i915_gem_contexts_init (struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/gt/intel_context_types.h +5 -0
@@ -13,6 +13,7 @@#include <linux/types.h> #include "i915_active_types.h" +#include "i915_utils.h" #include "intel_engine_types.h" #include "intel_sseu.h"
@@ -38,6 +39,10 @@ struct intel_context {struct i915_gem_context *gem_context;struct intel_engine_cs *engine;struct intel_engine_cs *inflight; +#define intel_context_inflight (ce) ptr_mask_bits((ce)->inflight, 2) +#define intel_context_inflight_count (ce) ptr_unmask_bits((ce)->inflight, 2) +#define intel_context_inflight_inc (ce) ptr_count_inc(&(ce)->inflight) +#define intel_context_inflight_dec (ce) ptr_count_dec(&(ce)->inflight)struct list_head signal_link;struct list_head signals;
drivers/gpu/drm/i915/gt/intel_engine.h +8 -53
79 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_engine_cs.c +36 -25
103 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_engine_types.h +3 -49
65 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_lrc.c +303 -368
1,015 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gpu_error.c +7 -12
@@ -1247,10 +1247,10 @@ static void error_record_engine_registers(struct i915_gpu_state *error, } } -static void record_request (struct i915_request *request, +static void record_request (const struct i915_request *request,struct drm_i915_error_request *erq) { -struct i915_gem_context *ctx = request->gem_context; +const struct i915_gem_context *ctx = request->gem_context; erq->flags = request->fence.flags; erq->context = request->fence.context;
@@ -1314,20 +1314,15 @@ static void engine_record_requests(struct intel_engine_cs *engine, ee->num_requests = count; } -static void error_record_engine_execlists (struct intel_engine_cs *engine, +static void error_record_engine_execlists (const struct intel_engine_cs *engine,struct drm_i915_error_engine *ee) {const struct intel_engine_execlists *const execlists = &engine->execlists; -unsigned int n; +struct i915_request *const *port = execlists->active; +unsigned int n =0 ; -for (n =0 ; n <execlists_num_ports (execlists); n++) { -struct i915_request *rq =port_request (&execlists->port[n]); - -if (!rq) -break ; - -record_request (rq, &ee->execlist[n]); - } +while (*port) +record_request (*port++, &ee->execlist[n++]); ee->num_ports = n; }
drivers/gpu/drm/i915/i915_request.c +6 -0
@@ -276,6 +276,12 @@ static bool i915_request_retire(struct i915_request *rq)local_irq_disable (); +/* +* We only loosely track inflight requests across preemption, +* and so we may find ourselves attempting to retire a _completed_ +* request that we have removed from the HW and put back on a run +* queue. +*/ spin_lock (&rq->engine->active.lock);list_del (&rq->sched.link);spin_unlock (&rq->engine->active.lock);
drivers/gpu/drm/i915/i915_request.h +1 -0
@@ -28,6 +28,7 @@#include <linux/dma-fence.h> #include <linux/lockdep.h> +#include "gt/intel_context_types.h" #include "gt/intel_engine_types.h" #include "i915_gem.h"
drivers/gpu/drm/i915/i915_scheduler.c +1 -2
@@ -179,8 +179,7 @@ static inline int rq_prio(const struct i915_request *rq)static void kick_submission (struct intel_engine_cs *engine,int prio) { -const struct i915_request *inflight = -port_request (engine->execlists.port); +const struct i915_request *inflight = *engine->execlists.active;/* * If we are already the currently executing context, don't
drivers/gpu/drm/i915/i915_utils.h +12 -0
@@ -131,6 +131,18 @@ __check_struct_size(size_t base, size_t arr, size_t count, size_t *size) ((typeof (ptr))((unsigned long )(ptr) | __bits)); \ }) +#define ptr_count_dec (p_ptr) do { \ + typeof(p_ptr) __p = (p_ptr); \ + unsigned long __v = (unsigned long)(*__p); \ + *__p = (typeof(*p_ptr))(--__v); \ +} while (0) + +#define ptr_count_inc (p_ptr) do { \ + typeof(p_ptr) __p = (p_ptr); \ + unsigned long __v = (unsigned long)(*__p); \ + *__p = (typeof(*p_ptr))(++__v); \ +} while (0) +#define page_mask_bits (ptr) ptr_mask_bits(ptr, PAGE_SHIFT)#define page_unmask_bits (ptr) ptr_unmask_bits(ptr, PAGE_SHIFT)#define page_pack_bits (ptr, bits) ptr_pack_bits(ptr, bits, PAGE_SHIFT)
drivers/gpu/drm/i915/intel_guc_submission.c +77 -98
294 lines not on this page · raw message
drivers/gpu/drm/i915/selftests/i915_request.c +5 -3
@@ -366,13 +366,15 @@ static int __igt_breadcrumbs_smoketest(void *arg)if (!wait_event_timeout (wait->wait,i915_sw_fence_done (wait), -HZ /2 )) { +5 *HZ )) {struct i915_request *rq = requests[count -1 ]; -pr_err ("waiting for %d fences (last %llx:%lld) on %s timed out!\n" , - count, +pr_err ("waiting for %d/%d fences (last %llx:%lld) on %s timed out!\n" , +atomic_read (&wait->pending), count, rq->fence.context, rq->fence.seqno, t->engine->name); +GEM_TRACE_DUMP (); +i915_gem_set_wedged (t->engine->i915);GEM_BUG_ON (!i915_request_completed (rq));i915_sw_fence_wait (wait);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/8 drm/i915/execlists: Minimalistic timeslicing
In reply to Chris WilsonIf we have multiple contexts of equal priority pending execution, activate a timer to demote the currently executing context in favour of the next in the queue when that timeslice expires. This enforces fairness between contexts (so long as they allow preemption -- forced preemption, in the future, will kick those who do not obey) and allows us to avoid userspace blocking forward progress with e.g. unbounded MI_SEMAPHORE_WAIT.
For the starting point here, we use the jiffie as our timeslice so that we should be reasonably efficient wrt frequent CPU wakeups.
Testcase: igt/gem_exec_scheduler/semaphore-resolve
--- drivers/gpu/drm/i915/gt/intel_engine_types.h | 6 + drivers/gpu/drm/i915/gt/intel_lrc.c | 111 +++++++++ drivers/gpu/drm/i915/gt/selftest_lrc.c | 223 +++++++++++++++++++ drivers/gpu/drm/i915/i915_scheduler.c | 1 + drivers/gpu/drm/i915/i915_scheduler_types.h | 1 + 5 files changed, 342 insertions(+)
drivers/gpu/drm/i915/gt/intel_engine_types.h +6 -0
@@ -12,6 +12,7 @@#include <linux/kref.h> #include <linux/list.h> #include <linux/llist.h> +#include <linux/timer.h> #include <linux/types.h> #include "i915_gem.h"
@@ -137,6 +138,11 @@ struct intel_engine_execlists {*/ struct tasklet_struct tasklet; +/** +* @timer: kick the current context if its timeslice expires +*/ +struct timer_list timer; +/** * @default_priolist: priority list for I915_PRIORITY_NORMAL */
drivers/gpu/drm/i915/gt/intel_lrc.c +111 -0
153 lines not on this page · raw message
drivers/gpu/drm/i915/gt/selftest_lrc.c +223 -0
241 lines not on this page · raw message
drivers/gpu/drm/i915/i915_scheduler.c +1 -0
@@ -394,6 +394,7 @@ bool __i915_sched_node_add_dependency(struct i915_sched_node *node,list_add (&dep->wait_link, &signal->waiters_list);list_add (&dep->signal_link, &node->signalers_list); dep->signaler = signal; + dep->waiter = node; dep->flags = flags;/* Keep track of whether anyone on this chain has a semaphore */
drivers/gpu/drm/i915/i915_scheduler_types.h +1 -0
@@ -62,6 +62,7 @@ struct i915_sched_node {struct i915_dependency {struct i915_sched_node *signaler; +struct i915_sched_node *waiter;struct list_head signal_link;struct list_head wait_link;struct list_head dfs_link;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/8 drm/i915/execlists: Force preemption
In reply to Chris WilsonIf the preempted context takes too long to relinquish control, e.g. it is stuck inside a shader with arbitration disabled, evict that context with an engine reset. This ensures that preemptions are reasonably responsive, providing a tighter QoS for the more important context at the cost of flagging unresponsive contexts more frequently (i.e. instead of using an ~10s hangcheck, we now evict at ~10ms). The challenge of lies in picking a timeout that can be reasonably serviced by HW for typical workloads, balancing the existing clients against the needs for responsiveness.
--- drivers/gpu/drm/i915/Kconfig.profile | 12 ++++++ drivers/gpu/drm/i915/gt/intel_lrc.c | 56 ++++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/Kconfig.profile +12 -0
@@ -25,3 +25,15 @@ config DRM_I915_SPIN_REQUEST May be 0 to disable the initial spin. In practice, we estimate the cost of enabling the interrupt (if currently disabled) to be a few microseconds. + +config DRM_I915_PREEMPT_TIMEOUT + int "Preempt timeout (ms)" + default 10 # milliseconds + help + How long to wait (in milliseconds) for a preemption event to occur + when submitting a new context via execlists. If the current context + does not hit an arbitration point and yield to HW before the timer + expires, the HW will be reset to allow the more important context + to execute. + + May be 0 to disable the timeout.
drivers/gpu/drm/i915/gt/intel_lrc.c +53 -3
85 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 8/8 drm/i915: Add a label for config DRM_I915_SPIN_REQUEST
In reply to Chris WilsonIf we don't give it a label, it does not appear as a configuration option.
--- drivers/gpu/drm/i915/Kconfig.profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/Kconfig.profile +1 -1
@@ -13,7 +13,7 @@ config DRM_I915_USERFAULT_AUTOSUSPEND runtime pm autosuspend delay tunable. config DRM_I915_SPIN_REQUEST - int + int "Busywait for request completion (us)" default 5 # microseconds help Before sleeping waiting for a request (GPU operation) to complete,
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
URL : https://patchwork.freedesktop.org/series/61946/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 07bc4de0ab32 drm/i915: Keep contexts pinned until after the next kernel context switch e1f10e9ec8a6 drm/i915: Stop retiring along engine 4740389e1a7a drm/i915: Replace engine->timeline with a plain list -:180: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment #180: FILE: drivers/gpu/drm/i915/gt/intel_engine_types.h:292: + spinlock_t lock;
total: 0 errors, 0 warnings, 1 checks, 968 lines checked0a6152d74ef2 drm/i915: Flush the execution-callbacks on retiring 2286206e3ffc drm/i915/execlists: Preempt-to-busy
-:1494: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'p_ptr' - possible side-effects? #1494: FILE: drivers/gpu/drm/i915/i915_utils.h:134:
+#define ptr_count_dec(p_ptr) do { \
+ typeof(p_ptr) __p = (p_ptr); \
+ unsigned long __v = (unsigned long)(*__p); \
+ *__p = (typeof(*p_ptr))(--__v); \
+} while (0)
-:1500: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'p_ptr' - possible side-effects? #1500: FILE: drivers/gpu/drm/i915/i915_utils.h:140:
+#define ptr_count_inc(p_ptr) do { \
+ typeof(p_ptr) __p = (p_ptr); \
+ unsigned long __v = (unsigned long)(*__p); \
+ *__p = (typeof(*p_ptr))(++__v); \
+} while (0)
-:1783: WARNING:LINE_SPACING: Missing a blank line after declarations #1783: FILE: drivers/gpu/drm/i915/intel_guc_submission.c:820:
+ int rem = ARRAY_SIZE(execlists->inflight) - idx;
+ memmove(execlists->inflight, port, rem * sizeof(*port));
total: 0 errors, 1 warnings, 2 checks, 1682 lines checked 090ff087a41e drm/i915/execlists: Minimalistic timeslicing -:345: WARNING:LONG_LINE: line over 100 characters #345: FILE: drivers/gpu/drm/i915/gt/selftest_lrc.c:211:
+ 2 * RUNTIME_INFO(outer->i915)->num_engines * (count + 2) * (count + 3)) < 0) {
total: 0 errors, 1 warnings, 0 checks, 426 lines checked 65ce5d40d6da drm/i915/execlists: Force preemption 1915c21b2186 drm/i915: Add a label for config DRM_I915_SPIN_REQUEST
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for series starting with [1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
URL : https://patchwork.freedesktop.org/series/61946/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: drm/i915: Keep contexts pinned until after the next kernel context switch Okay!
Commit: drm/i915: Stop retiring along engine
Okay!
Commit: drm/i915: Replace engine->timeline with a plain list Okay!
Commit: drm/i915: Flush the execution-callbacks on retiring Okay!
Commit: drm/i915/execlists: Preempt-to-busy -drivers/gpu/drm/i915/selftests/../i915_utils.h:220:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/selftests/../i915_utils.h:232:16: warning: expression using sizeof(void)
Commit: drm/i915/execlists: Minimalistic timeslicing +drivers/gpu/drm/i915/gt/intel_lrc.c:876:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/gt/intel_lrc.c:876:16: warning: expression using sizeof(void)
Commit: drm/i915/execlists: Force preemption
++drivers/gpu/drm/i915/i915_utils.h:232:16: warning: expression using sizeof(void) +Error in reading or end of file.
Commit: drm/i915: Add a label for config DRM_I915_SPIN_REQUEST Okay!
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
URL : https://patchwork.freedesktop.org/series/61946/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6244 -> Patchwork_13250
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/
Known issues
------------
Here are the changes found in Patchwork_13250 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@debugfs_test@read_all_entries:
- fi-cml-u: [PASS][1] -> [INCOMPLETE][2] ([fdo#110566])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/fi-cml-u/igt@debugfs_test@read_all_entries.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/fi-cml-u/igt@debugfs_test@read_all_entries.html
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: [PASS][3] -> [INCOMPLETE][4] ([fdo#107718])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/fi-blb-e6850/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/fi-blb-e6850/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: [PASS][5] -> [FAIL][6] ([fdo#108511])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/fi-skl-6770hq/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/fi-skl-6770hq/igt@[email protected]
* igt@i915_selftest@live_blt:
- fi-skl-iommu: [PASS][7] -> [INCOMPLETE][8] ([fdo#108602])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/fi-skl-iommu/igt@i915_selftest@live_blt.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/fi-skl-iommu/igt@i915_selftest@live_blt.html
* igt@i915_selftest@live_hangcheck:
- fi-icl-y: [PASS][9] -> [INCOMPLETE][10] ([fdo#107713] / [fdo#108569])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/fi-icl-y/igt@i915_selftest@live_hangcheck.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/fi-icl-y/igt@i915_selftest@live_hangcheck.html
* igt@i915_selftest@live_sanitycheck:
- fi-icl-u3: [PASS][11] -> [DMESG-WARN][12] ([fdo#107724])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/fi-icl-u3/igt@i915_selftest@live_sanitycheck.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/fi-icl-u3/igt@i915_selftest@live_sanitycheck.html
#### Possible fixes ####
* igt@core_auth@basic-auth:
- fi-icl-u3: [DMESG-WARN][13] ([fdo#107724]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/fi-icl-u3/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/fi-icl-u3/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#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
[fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566
Participating hosts (51 -> 45)
------------------------------
Additional (1): fi-bwr-2160
Missing (7): fi-cml-u2 fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_6244 -> Patchwork_13250
CI_DRM_6244: d7ce900dafd424be9da576fbf3155b43ce5270ec @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5052: ff711b343c06a25ac4995ab8bd9a8bcb5ce1eb10 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13250: 1915c21b218609f12edb1f1ac752b3e81fc084c8 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
1915c21b2186 drm/i915: Add a label for config DRM_I915_SPIN_REQUEST 65ce5d40d6da drm/i915/execlists: Force preemption090ff087a41e drm/i915/execlists: Minimalistic timeslicing2286206e3ffc drm/i915/execlists: Preempt-to-busy0a6152d74ef2 drm/i915: Flush the execution-callbacks on retiring 4740389e1a7a drm/i915: Replace engine->timeline with a plain list e1f10e9ec8a6 drm/i915: Stop retiring along engine07bc4de0ab32 drm/i915: Keep contexts pinned until after the next kernel context switch
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [v2] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [v2] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)
URL : https://patchwork.freedesktop.org/series/61946/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 8566c15aaa58 drm/i915: Keep contexts pinned until after the next kernel context switch 11e02dde299e drm/i915: Stop retiring along engine a458b25070a5 drm/i915: Replace engine->timeline with a plain list -:180: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment #180: FILE: drivers/gpu/drm/i915/gt/intel_engine_types.h:292: + spinlock_t lock;
total: 0 errors, 0 warnings, 1 checks, 968 lines checkedd40bab648ec8 drm/i915: Flush the execution-callbacks on retiring aff0830f921c drm/i915/execlists: Preempt-to-busy
-:1494: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'p_ptr' - possible side-effects? #1494: FILE: drivers/gpu/drm/i915/i915_utils.h:134:
+#define ptr_count_dec(p_ptr) do { \
+ typeof(p_ptr) __p = (p_ptr); \
+ unsigned long __v = (unsigned long)(*__p); \
+ *__p = (typeof(*p_ptr))(--__v); \
+} while (0)
-:1500: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'p_ptr' - possible side-effects? #1500: FILE: drivers/gpu/drm/i915/i915_utils.h:140:
+#define ptr_count_inc(p_ptr) do { \
+ typeof(p_ptr) __p = (p_ptr); \
+ unsigned long __v = (unsigned long)(*__p); \
+ *__p = (typeof(*p_ptr))(++__v); \
+} while (0)
-:1783: WARNING:LINE_SPACING: Missing a blank line after declarations #1783: FILE: drivers/gpu/drm/i915/intel_guc_submission.c:820:
+ int rem = ARRAY_SIZE(execlists->inflight) - idx;
+ memmove(execlists->inflight, port, rem * sizeof(*port));
total: 0 errors, 1 warnings, 2 checks, 1682 lines checked cd324ac73cb8 drm/i915/execlists: Minimalistic timeslicing -:345: WARNING:LONG_LINE: line over 100 characters #345: FILE: drivers/gpu/drm/i915/gt/selftest_lrc.c:211:
+ 2 * RUNTIME_INFO(outer->i915)->num_engines * (count + 2) * (count + 3)) < 0) {
total: 0 errors, 1 warnings, 0 checks, 426 lines checked 3028af14aae1 drm/i915/execlists: Force preemption
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for series starting with [v2] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [v2] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)
URL : https://patchwork.freedesktop.org/series/61946/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: drm/i915: Keep contexts pinned until after the next kernel context switch Okay!
Commit: drm/i915: Stop retiring along engine
Okay!
Commit: drm/i915: Replace engine->timeline with a plain list Okay!
Commit: drm/i915: Flush the execution-callbacks on retiring Okay!
Commit: drm/i915/execlists: Preempt-to-busy -drivers/gpu/drm/i915/selftests/../i915_utils.h:220:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/selftests/../i915_utils.h:232:16: warning: expression using sizeof(void)
Commit: drm/i915/execlists: Minimalistic timeslicing +drivers/gpu/drm/i915/gt/intel_lrc.c:876:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/gt/intel_lrc.c:876:16: warning: expression using sizeof(void)
Commit: drm/i915/execlists: Force preemption
++drivers/gpu/drm/i915/i915_utils.h:232:16: warning: expression using sizeof(void) +Error in reading or end of file.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [v2] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)
URL : https://patchwork.freedesktop.org/series/61946/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6251 -> Patchwork_13254
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/
Known issues
------------
Here are the changes found in Patchwork_13254 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@vgem_basic@dmabuf-fence:
- fi-icl-u3: [PASS][1] -> [DMESG-WARN][2] ([fdo#107724]) +2 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/fi-icl-u3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/fi-icl-u3/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s4-devices:
- fi-blb-e6850: [INCOMPLETE][3] ([fdo#107718]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/fi-blb-e6850/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/fi-blb-e6850/igt@[email protected]
* igt@gem_flink_basic@double-flink:
- fi-icl-u3: [DMESG-WARN][5] ([fdo#107724]) -> [PASS][6] +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/fi-icl-u3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/fi-icl-u3/igt@[email protected]
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
Participating hosts (51 -> 47)
------------------------------
Additional (2): fi-icl-dsi fi-skl-iommu
Missing (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper
Build changes
-------------
* Linux: CI_DRM_6251 -> Patchwork_13254
CI_DRM_6251: 796f31ae8178af1598db09c4640873504a36b395 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5053: b90ebd9c21518f305a61ee50aea38462ef01e65c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13254: 3028af14aae113fb2d3aacbaf81e841584ef3734 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
3028af14aae1 drm/i915/execlists: Force preemptioncd324ac73cb8 drm/i915/execlists: Minimalistic timeslicingaff0830f921c drm/i915/execlists: Preempt-to-busyd40bab648ec8 drm/i915: Flush the execution-callbacks on retiring a458b25070a5 drm/i915: Replace engine->timeline with a plain list 11e02dde299e drm/i915: Stop retiring along engine8566c15aaa58 drm/i915: Keep contexts pinned until after the next kernel context switch
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.IGT: failure for series starting with [1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [1/8] drm/i915: Keep contexts pinned until after the next kernel context switch
URL : https://patchwork.freedesktop.org/series/61946/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_6244_full -> Patchwork_13250_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_13250_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_13250_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_13250_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_ctx_engines@execute-one:
- shard-skl: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-skl5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-skl1/igt@[email protected]
- shard-apl: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-apl2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-apl6/igt@[email protected]
- shard-glk: [PASS][5] -> [FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-glk6/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-glk6/igt@[email protected]
* igt@gem_exec_await@wide-contexts:
- shard-kbl: [PASS][7] -> [FAIL][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-kbl7/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-kbl4/igt@[email protected]
* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-snb: [PASS][9] -> [DMESG-WARN][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-snb1/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-snb4/igt@[email protected]
### Piglit changes ###
#### Possible regressions ####
* spec@arb_shader_image_load_store@shader-mem-barrier (NEW):
- pig-glk-j5005: NOTRUN -> [FAIL][11] +3 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/pig-glk-j5005/spec@[email protected]
- pig-skl-6260u: NOTRUN -> [FAIL][12]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/pig-skl-6260u/spec@[email protected]
New tests
---------
New tests have been introduced between CI_DRM_6244_full and Patchwork_13250_full:
### New Piglit tests (4) ###
* spec@arb_shader_image_load_store@shader-mem-barrier:
- Statuses : 2 fail(s)
- Exec time: [0.16, 0.19] s
* spec@ext_transform_feedback@order arrays points:
- Statuses : 1 fail(s)
- Exec time: [0.17] s
* spec@ext_transform_feedback@order elements triangles:
- Statuses : 1 fail(s)
- Exec time: [0.14] s
* [email protected]@execution@fs-execution-ordering:
- Statuses : 1 fail(s)
- Exec time: [0.67] s
Known issues
------------
Here are the changes found in Patchwork_13250_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_softpin@noreloc-s3:
- shard-skl: [PASS][13] -> [INCOMPLETE][14] ([fdo#104108])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-skl5/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-skl9/igt@[email protected]
* igt@gem_tiled_swapping@non-threaded:
- shard-apl: [PASS][15] -> [INCOMPLETE][16] ([fdo#103927] / [fdo#108686])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-apl6/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-apl4/igt@[email protected]
- shard-kbl: [PASS][17] -> [DMESG-WARN][18] ([fdo#108686])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-kbl3/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-kbl6/igt@[email protected]
* igt@gem_workarounds@suspend-resume-context:
- shard-apl: [PASS][19] -> [DMESG-WARN][20] ([fdo#108566]) +1 similar issue
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-apl3/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-apl6/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-pri-indfb-multidraw:
- shard-iclb: [PASS][21] -> [FAIL][22] ([fdo#103167]) +6 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-iclb6/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-iclb5/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-pwrite:
- shard-hsw: [PASS][23] -> [SKIP][24] ([fdo#109271]) +10 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-hsw2/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-pwrite.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-hsw1/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-pwrite.html
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [PASS][25] -> [DMESG-WARN][26] ([fdo#108566]) +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-kbl1/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-kbl3/igt@[email protected]
* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-skl: [PASS][27] -> [FAIL][28] ([fdo#110038])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-skl9/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-skl7/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min:
- shard-skl: [PASS][29] -> [FAIL][30] ([fdo#108145])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-skl7/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-skl10/igt@[email protected]
* igt@kms_psr@psr2_sprite_plane_move:
- shard-iclb: [PASS][31] -> [SKIP][32] ([fdo#109441]) +3 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-iclb7/igt@kms_psr@psr2_sprite_plane_move.html
* igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
- shard-kbl: [PASS][33] -> [DMESG-FAIL][34] ([fdo#105763])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-kbl2/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-kbl3/igt@[email protected]
* igt@kms_setmode@basic:
- shard-apl: [PASS][35] -> [FAIL][36] ([fdo#99912])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-apl1/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-apl2/igt@[email protected]
* igt@kms_vblank@pipe-c-ts-continuation-suspend:
- shard-iclb: [PASS][37] -> [INCOMPLETE][38] ([fdo#107713])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-iclb8/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-iclb3/igt@[email protected]
* igt@syncobj_wait@multi-wait-for-submit-signaled:
- shard-glk: [PASS][39] -> [INCOMPLETE][40] ([fdo#103359] / [k.org#198133])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-glk7/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-glk2/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_balancer@smoke:
- shard-iclb: [SKIP][41] ([fdo#110854]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-iclb5/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-iclb1/igt@[email protected]
* igt@gem_exec_schedule@semaphore-resolve:
- shard-skl: [FAIL][43] ([fdo#110519]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-skl9/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-skl8/igt@[email protected]
- shard-kbl: [FAIL][45] ([fdo#110519]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-kbl6/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-kbl2/igt@[email protected]
- shard-glk: [FAIL][47] ([fdo#110519]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-glk5/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-glk8/igt@[email protected]
- shard-iclb: [FAIL][49] ([fdo#110519]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-iclb5/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-iclb2/igt@[email protected]
* igt@gem_exec_suspend@basic-s3:
- shard-kbl: [DMESG-WARN][51] ([fdo#108566]) -> [PASS][52] +2 similar issues
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-kbl3/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-kbl6/igt@[email protected]
* igt@gem_tiled_swapping@non-threaded:
- shard-hsw: [FAIL][53] ([fdo#108686]) -> [PASS][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-hsw8/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-hsw2/igt@[email protected]
* igt@i915_suspend@sysfs-reader:
- shard-apl: [DMESG-WARN][55] ([fdo#108566]) -> [PASS][56] +2 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-apl8/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-apl1/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-skl: [FAIL][57] ([fdo#103232]) -> [PASS][58] +1 similar issue
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-skl3/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-skl5/igt@[email protected]
* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
- shard-hsw: [FAIL][59] ([fdo#105767]) -> [PASS][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-hsw6/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-hsw1/igt@[email protected]
* igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions:
- shard-hsw: [FAIL][61] ([fdo#103355]) -> [PASS][62]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-hsw5/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-hsw1/igt@[email protected]
* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-glk: [FAIL][63] ([fdo#105363]) -> [PASS][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-glk1/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-glk9/igt@[email protected]
* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-kbl: [INCOMPLETE][65] ([fdo#103665]) -> [PASS][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-kbl2/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-kbl7/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
- shard-iclb: [FAIL][67] ([fdo#103167]) -> [PASS][68] +2 similar issues
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [FAIL][69] ([fdo#108145]) -> [PASS][70]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-skl3/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-skl5/igt@[email protected]
* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-iclb: [FAIL][71] ([fdo#103166]) -> [PASS][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-iclb1/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-iclb2/igt@[email protected]
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [SKIP][73] ([fdo#109441]) -> [PASS][74] +3 similar issues
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-iclb7/igt@kms_psr@psr2_cursor_render.html
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
* igt@kms_setmode@basic:
- shard-skl: [FAIL][75] ([fdo#99912]) -> [PASS][76]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6244/shard-skl8/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/shard-skl4/igt@[email protected]
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110038]: https://bugs.freedesktop.org/show_bug.cgi?id=110038
[fdo#110519]: https://bugs.freedesktop.org/show_bug.cgi?id=110519
[fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
Participating hosts (10 -> 9)
------------------------------
Missing (1): pig-hsw-4770r
Build changes
-------------
* Linux: CI_DRM_6244 -> Patchwork_13250
CI_DRM_6244: d7ce900dafd424be9da576fbf3155b43ce5270ec @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5052: ff711b343c06a25ac4995ab8bd9a8bcb5ce1eb10 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13250: 1915c21b218609f12edb1f1ac752b3e81fc084c8 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13250/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.IGT: failure for series starting with [v2] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [v2] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)
URL : https://patchwork.freedesktop.org/series/61946/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_6251_full -> Patchwork_13254_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_13254_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_13254_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_13254_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_ctx_engines@execute-one:
- shard-skl: [PASS][1] -> [FAIL][2] +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl10/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl1/igt@[email protected]
- shard-apl: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-apl2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-apl6/igt@[email protected]
- shard-glk: [PASS][5] -> [FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-glk3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-glk1/igt@[email protected]
* igt@gem_exec_await@wide-contexts:
- shard-kbl: [PASS][7] -> [FAIL][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-kbl1/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-kbl7/igt@[email protected]
### Piglit changes ###
#### Possible regressions ####
* spec@arb_shader_image_load_store@shader-mem-barrier (NEW):
- pig-glk-j5005: NOTRUN -> [FAIL][9] +2 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/pig-glk-j5005/spec@[email protected]
- pig-skl-6260u: NOTRUN -> [FAIL][10]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/pig-skl-6260u/spec@[email protected]
New tests
---------
New tests have been introduced between CI_DRM_6251_full and Patchwork_13254_full:
### New Piglit tests (3) ###
* spec@arb_shader_image_load_store@shader-mem-barrier:
- Statuses : 2 fail(s)
- Exec time: [0.16, 0.20] s
* spec@ext_transform_feedback@order arrays points:
- Statuses : 1 fail(s)
- Exec time: [0.13] s
* [email protected]@execution@fs-execution-ordering:
- Statuses : 1 fail(s)
- Exec time: [0.62] s
Known issues
------------
Here are the changes found in Patchwork_13254_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_persistent_relocs@forked-faulting-reloc-thrashing:
- shard-snb: [PASS][11] -> [DMESG-WARN][12] ([fdo#110789] / [fdo#110913 ])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-snb5/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-snb6/igt@[email protected]
* igt@gem_persistent_relocs@forked-thrashing:
- shard-hsw: [PASS][13] -> [DMESG-WARN][14] ([fdo#110789] / [fdo#110913 ])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-hsw6/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-hsw8/igt@[email protected]
- shard-kbl: [PASS][15] -> [DMESG-WARN][16] ([fdo#110913 ])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-kbl2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-kbl3/igt@[email protected]
* igt@gem_pwrite@big-cpu-random:
- shard-glk: [PASS][17] -> [INCOMPLETE][18] ([fdo#103359] / [k.org#198133])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-glk3/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-glk9/igt@[email protected]
* igt@gem_tiled_swapping@non-threaded:
- shard-hsw: [PASS][19] -> [FAIL][20] ([fdo#108686])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-hsw7/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-hsw1/igt@[email protected]
* igt@gem_userptr_blits@map-fixed-invalidate-busy:
- shard-apl: [PASS][21] -> [DMESG-WARN][22] ([fdo#110913 ])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-apl8/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-apl8/igt@[email protected]
* igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
- shard-glk: [PASS][23] -> [DMESG-WARN][24] ([fdo#110913 ]) +1 similar issue
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-glk3/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-glk3/igt@[email protected]
* igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup:
- shard-skl: [PASS][25] -> [DMESG-WARN][26] ([fdo#110913 ])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl9/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl6/igt@[email protected]
* igt@i915_pm_rc6_residency@rc6-accuracy:
- shard-kbl: [PASS][27] -> [SKIP][28] ([fdo#109271])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-kbl1/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-kbl7/igt@[email protected]
* igt@kms_atomic_transition@plane-all-transition-nonblocking-fencing:
- shard-apl: [PASS][29] -> [INCOMPLETE][30] ([fdo#103927])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-apl1/igt@kms_atomic_transition@plane-all-transition-nonblocking-fencing.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-apl1/igt@kms_atomic_transition@plane-all-transition-nonblocking-fencing.html
* igt@kms_big_fb@x-tiled-32bpp-rotate-0:
- shard-snb: [PASS][31] -> [SKIP][32] ([fdo#109271]) +1 similar issue
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-snb6/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-snb5/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-256x85-offscreen:
- shard-skl: [PASS][33] -> [FAIL][34] ([fdo#103232])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl10/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl1/igt@[email protected]
* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [PASS][35] -> [SKIP][36] ([fdo#109349])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb2/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb3/igt@[email protected]
* igt@kms_flip@2x-flip-vs-absolute-wf_vblank:
- shard-hsw: [PASS][37] -> [SKIP][38] ([fdo#109271]) +19 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-hsw8/igt@kms_flip@2x-flip-vs-absolute-wf_vblank.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-hsw1/igt@kms_flip@2x-flip-vs-absolute-wf_vblank.html
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-pwrite:
- shard-iclb: [PASS][39] -> [FAIL][40] ([fdo#103167]) +6 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb4/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-pwrite.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-pwrite.html
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [PASS][41] -> [FAIL][42] ([fdo#108145]) +1 similar issue
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl6/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl9/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][43] -> [FAIL][44] ([fdo#108145] / [fdo#110403])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl10/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl1/igt@[email protected]
* igt@kms_plane_lowres@pipe-a-tiling-y:
- shard-iclb: [PASS][45] -> [FAIL][46] ([fdo#103166])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb7/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb7/igt@[email protected]
* igt@kms_psr@no_drrs:
- shard-iclb: [PASS][47] -> [FAIL][48] ([fdo#108341])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb4/igt@kms_psr@no_drrs.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb1/igt@kms_psr@no_drrs.html
* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [PASS][49] -> [SKIP][50] ([fdo#109441]) +3 similar issues
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb4/igt@kms_psr@psr2_primary_mmap_cpu.html
* igt@kms_setmode@basic:
- shard-glk: [PASS][51] -> [FAIL][52] ([fdo#99912])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-glk2/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-glk2/igt@[email protected]
* igt@kms_sysfs_edid_timing:
- shard-iclb: [PASS][53] -> [FAIL][54] ([fdo#100047])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb4/igt@kms_sysfs_edid_timing.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb2/igt@kms_sysfs_edid_timing.html
* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-apl: [PASS][55] -> [DMESG-WARN][56] ([fdo#108566]) +3 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-apl2/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-apl6/igt@[email protected]
#### Possible fixes ####
* igt@gem_eio@in-flight-external:
- shard-glk: [DMESG-WARN][57] ([fdo#110913 ]) -> [PASS][58] +1 similar issue
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-glk2/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-glk6/igt@[email protected]
* igt@gem_exec_schedule@semaphore-resolve:
- shard-skl: [FAIL][59] ([fdo#110519]) -> [PASS][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl10/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl1/igt@[email protected]
- shard-kbl: [FAIL][61] ([fdo#110519]) -> [PASS][62]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-kbl7/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-kbl6/igt@[email protected]
- shard-apl: [FAIL][63] ([fdo#110519]) -> [PASS][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-apl2/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-apl6/igt@[email protected]
- shard-glk: [FAIL][65] ([fdo#110519]) -> [PASS][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-glk3/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-glk1/igt@[email protected]
- shard-iclb: [FAIL][67] ([fdo#110519]) -> [PASS][68]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb6/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb4/igt@[email protected]
* igt@gem_persistent_relocs@forked-faulting-reloc-thrashing:
- shard-hsw: [DMESG-WARN][69] ([fdo#110789] / [fdo#110913 ]) -> [PASS][70]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-hsw8/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-hsw5/igt@[email protected]
* igt@gem_tiled_swapping@non-threaded:
- shard-glk: [DMESG-WARN][71] ([fdo#108686]) -> [PASS][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-glk4/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-glk8/igt@[email protected]
* igt@gem_userptr_blits@map-fixed-invalidate-busy:
- shard-skl: [DMESG-WARN][73] ([fdo#110913 ]) -> [PASS][74] +1 similar issue
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl7/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl4/igt@[email protected]
* igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
- shard-snb: [DMESG-WARN][75] ([fdo#110913 ]) -> [PASS][76]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-snb1/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-snb1/igt@[email protected]
- shard-kbl: [DMESG-WARN][77] ([fdo#110913 ]) -> [PASS][78]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-kbl6/igt@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-kbl2/igt@[email protected]
* igt@gem_userptr_blits@sync-unmap-cycles:
- shard-apl: [DMESG-WARN][79] ([fdo#110913 ]) -> [PASS][80] +1 similar issue
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-apl6/igt@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-apl6/igt@[email protected]
* igt@kms_draw_crc@draw-method-xrgb8888-mmap-gtt-ytiled:
- shard-iclb: [FAIL][81] ([fdo#103184] / [fdo#103232]) -> [PASS][82]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb1/igt@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb1/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: [FAIL][83] ([fdo#105363]) -> [PASS][84] +1 similar issue
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl7/igt@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl8/igt@[email protected]
* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-skl: [INCOMPLETE][85] ([fdo#109507]) -> [PASS][86]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-skl1/igt@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-skl5/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-pwrite:
- shard-hsw: [SKIP][87] ([fdo#109271]) -> [PASS][88] +21 similar issues
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-hsw1/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-pwrite.html
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-hsw2/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-pwrite.html
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [DMESG-WARN][89] ([fdo#108566]) -> [PASS][90]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-kbl1/igt@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-kbl2/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render:
- shard-iclb: [FAIL][91] ([fdo#103167]) -> [PASS][92] +3 similar issues
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb5/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render.html
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render.html
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- shard-apl: [DMESG-WARN][93] ([fdo#108566]) -> [PASS][94]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-apl7/igt@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-apl3/igt@[email protected]
* igt@kms_psr2_su@page_flip:
- shard-iclb: [SKIP][95] ([fdo#109642]) -> [PASS][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb3/igt@kms_psr2_su@page_flip.html
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb2/igt@kms_psr2_su@page_flip.html
* igt@kms_psr@psr2_no_drrs:
- shard-iclb: [SKIP][97] ([fdo#109441]) -> [PASS][98]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6251/shard-iclb4/igt@kms_psr@psr2_no_drrs.html
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/shard-iclb2/igt@kms_psr@psr2_no_drrs.html
[fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.o
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13254/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx