From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 01/11] drm/i915/execlists: Avoid kicking the submission too early for rescheduling
Date: Tue, 27 Mar 2018 15:18:06 +0300 [thread overview]
Message-ID: <87efk54sqp.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <152215126497.10679.7155358328370004804@mail.alporthouse.com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Quoting Mika Kuoppala (2018-03-27 12:34:31)
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>>
>> > If the request is still waiting on external fences, it has not yet been
>> > submitted to the HW queue and so we can forgo kicking the submission
>> > tasklet when re-evaluating its priority.
>> >
>> > This should have no impact other than reducing the number of tasklet
>> > wakeups under signal heavy workloads (e.g. switching between engines).
>> >
>> > v2: Use prebaked container_of()
>> >
>> > 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 | 15 +++++++++++----
>> > 1 file changed, 11 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
>> > index b4ab06b05e58..104b69e0494f 100644
>> > --- a/drivers/gpu/drm/i915/intel_lrc.c
>> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
>> > @@ -1051,12 +1051,16 @@ static void queue_request(struct intel_engine_cs *engine,
>> > list_add_tail(&pt->link, &lookup_priolist(engine, pt, prio)->requests);
>> > }
>> >
>> > -static void submit_queue(struct intel_engine_cs *engine, int prio)
>> > +static void __submit_queue(struct intel_engine_cs *engine, int prio)
>> > {
>> > - if (prio > engine->execlists.queue_priority) {
>> > engine->execlists.queue_priority = prio;
>> > tasklet_hi_schedule(&engine->execlists.tasklet);
>> > - }
>> > +}
>> > +
>> > +static void submit_queue(struct intel_engine_cs *engine, int prio)
>> > +{
>> > + if (prio > engine->execlists.queue_priority)
>> > + __submit_queue(engine, prio);
>>
>> You did this...
>>
>> > }
>> >
>> > static void execlists_submit_request(struct i915_request *request)
>> > @@ -1189,7 +1193,10 @@ static void execlists_schedule(struct i915_request *request, int prio)
>> > __list_del_entry(&pt->link);
>> > queue_request(engine, pt, prio);
>> > }
>> > - submit_queue(engine, prio);
>> > +
>> > + if (prio > engine->execlists.queue_priority &&
>> > + i915_sw_fence_done(&pt_to_request(pt)->submit))
>> > + __submit_queue(engine, prio);
>>
>> ..to have explicit priority comparison on submit callsite I gather.
>> Or is there some other reason?
>
> No, just because I wanted both checks in this case. On the other path
> i915_sw_fence_done() isn't technically true as we are in process of
> performing the i915_sw_fence callback, so just i915_sw_fence_signaled().
> But we don't want to use i915_sw_fence_signaled() here as I don't want
> to think about the race. :)
>
> So since prio > engine.queue_priority should be cheaper than loading the
> cacheline for the request->submit.flags, I wanted that tested first as
> it will only fire, at most, once per engine.
Ok, didn't see the perf angle of it but makes sense.
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-03-27 12:18 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-26 11:50 Forced preemption gedankenexperiment Chris Wilson
2018-03-26 11:50 ` [PATCH 01/11] drm/i915/execlists: Avoid kicking the submission too early for rescheduling Chris Wilson
2018-03-27 11:34 ` Mika Kuoppala
2018-03-27 11:47 ` Chris Wilson
2018-03-27 12:18 ` Mika Kuoppala [this message]
2018-03-27 13:34 ` Chris Wilson
2018-03-27 11:42 ` Mika Kuoppala
2018-03-26 11:50 ` [PATCH 02/11] drm/i915/execlists: Clear user-active flag on preemption completion Chris Wilson
2018-03-27 10:00 ` Chris Wilson
2018-03-27 10:01 ` Chris Wilson
2018-03-26 11:50 ` [PATCH 03/11] drm/i915: Include submission tasklet state in engine dump Chris Wilson
2018-03-27 8:37 ` Mika Kuoppala
2018-03-26 11:50 ` [PATCH 04/11] drm/i915/execlists: Refactor out complete_preempt_context() Chris Wilson
2018-03-26 11:50 ` [PATCH 05/11] drm/i915: Move engine reset prepare/finish to backends Chris Wilson
2018-03-26 11:50 ` [PATCH 06/11] drm/i915: Split execlists/guc reset prepartions Chris Wilson
2018-03-26 11:50 ` [PATCH 07/11] drm/i915/execlists: Flush pending preemption events during reset Chris Wilson
2018-03-27 11:44 ` [PATCH v2] " Chris Wilson
2018-03-27 15:33 ` Jeff McGee
2018-03-26 11:50 ` [PATCH 08/11] drm/i915/execlists: Force preemption via reset on timeout Chris Wilson
2018-03-27 8:51 ` Tvrtko Ursulin
2018-03-27 9:10 ` Chris Wilson
2018-03-27 9:23 ` Chris Wilson
2018-03-28 8:59 ` Chris Wilson
2018-03-27 15:40 ` Jeff McGee
2018-03-27 15:50 ` Jeff McGee
2018-03-26 11:50 ` [PATCH 09/11] drm/i915/preemption: Select timeout when scheduling Chris Wilson
2018-03-26 11:50 ` [PATCH 10/11] drm/i915: Use a preemption timeout to enforce interactivity Chris Wilson
2018-03-27 8:35 ` Tvrtko Ursulin
2018-03-27 8:39 ` Chris Wilson
2018-03-27 8:57 ` Tvrtko Ursulin
2018-03-26 11:50 ` [PATCH 11/11] drm/i915: Allow user control over preempt timeout on the important context Chris Wilson
2018-03-26 17:09 ` Tvrtko Ursulin
2018-03-26 19:52 ` Chris Wilson
2018-03-26 20:49 ` Chris Wilson
2018-03-26 12:08 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] drm/i915/execlists: Avoid kicking the submission too early for rescheduling Patchwork
2018-03-26 12:23 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-26 14:56 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-03-27 12:28 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] drm/i915/execlists: Avoid kicking the submission too early for rescheduling (rev2) Patchwork
2018-03-27 12:44 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-27 15:30 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87efk54sqp.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox