Message ID | 20180329093900.10237-1-chris@chris-wilson.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Quoting Chris Wilson (2018-03-29 10:39:00) > We can refine our current execlists->queue_priority if we inspect > ELSP[1] rather than the head of the unsubmitted queue. Currently, we use > the unsubmitted queue and say that if a subsequent request is more than > important than the current queue, we will rerun the submission tasklet > to evaluate the need for preemption. However, we only want to preempt if > we need to jump ahead of a currently executing request in ELSP. The > second reason for running the submission tasklet is amalgamate requests > into the active context on ELSP[0] to avoid a stall when ELSP[0] drains. > (Though repeatedly amalgamating requests into the active context and > triggering many lite-restore is off question gain, the goal really is to > put a context into ELSP[1] to cover the interrupt.) So if instead of > looking at the head of the queue, we look at the context in ELSP[1] we > can answer both of the questions more accurately -- we don't need to > rerun the submission tasklet unless our new request is important enough > to feed into, at least, ELSP[1]. > > References: f6322eddaff7 ("drm/i915/preemption: Allow preemption between submission ports") > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > Cc: Michał Winiarski <michal.winiarski@intel.com> > Cc: Michel Thierry <michel.thierry@intel.com> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Has anyone had a chance to think about this yet? -Chris > --- > drivers/gpu/drm/i915/intel_lrc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c > index 654634254b64..e6d3ee4ca0b2 100644 > --- a/drivers/gpu/drm/i915/intel_lrc.c > +++ b/drivers/gpu/drm/i915/intel_lrc.c > @@ -698,7 +698,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine) > kmem_cache_free(engine->i915->priorities, p); > } > done: > - execlists->queue_priority = rb ? to_priolist(rb)->priority : INT_MIN; > + execlists->queue_priority = > + port != execlists->port ? rq_prio(last) : INT_MIN; > execlists->first = rb; > if (submit) > port_assign(port, last); > -- > 2.16.3 >
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 654634254b64..e6d3ee4ca0b2 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -698,7 +698,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine) kmem_cache_free(engine->i915->priorities, p); } done: - execlists->queue_priority = rb ? to_priolist(rb)->priority : INT_MIN; + execlists->queue_priority = + port != execlists->port ? rq_prio(last) : INT_MIN; execlists->first = rb; if (submit) port_assign(port, last);
We can refine our current execlists->queue_priority if we inspect ELSP[1] rather than the head of the unsubmitted queue. Currently, we use the unsubmitted queue and say that if a subsequent request is more than important than the current queue, we will rerun the submission tasklet to evaluate the need for preemption. However, we only want to preempt if we need to jump ahead of a currently executing request in ELSP. The second reason for running the submission tasklet is amalgamate requests into the active context on ELSP[0] to avoid a stall when ELSP[0] drains. (Though repeatedly amalgamating requests into the active context and triggering many lite-restore is off question gain, the goal really is to put a context into ELSP[1] to cover the interrupt.) So if instead of looking at the head of the queue, we look at the context in ELSP[1] we can answer both of the questions more accurately -- we don't need to rerun the submission tasklet unless our new request is important enough to feed into, at least, ELSP[1]. References: f6322eddaff7 ("drm/i915/preemption: Allow preemption between submission ports") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Michel Thierry <michel.thierry@intel.com> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> --- drivers/gpu/drm/i915/intel_lrc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)