From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 11/15] drm/i915/execlists: Cancel banned contexts on schedule-out
Date: Mon, 14 Oct 2019 14:38:02 +0100 [thread overview]
Message-ID: <fb23201a-1e20-f085-052d-b3f61b7c2298@linux.intel.com> (raw)
In-Reply-To: <157105938286.18859.17442370513635200680@skylake-alporthouse-com>
On 14/10/2019 14:23, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-10-14 14:19:19)
>>
>> On 14/10/2019 14:13, Chris Wilson wrote:
>>> Quoting Chris Wilson (2019-10-14 13:34:35)
>>>> Quoting Tvrtko Ursulin (2019-10-14 13:25:58)
>>>>>
>>>>> On 14/10/2019 13:06, Chris Wilson wrote:
>>>>>> Quoting Tvrtko Ursulin (2019-10-14 13:00:01)
>>>>>>>
>>>>>>> On 14/10/2019 10:07, Chris Wilson wrote:
>>>>>>>> +static void cancel_active(struct i915_request *rq,
>>>>>>>> + struct intel_engine_cs *engine)
>>>>>>>> +{
>>>>>>>> + struct intel_context * const ce = rq->hw_context;
>>>>>>>> +
>>>>>>>> + /*
>>>>>>>> + * The executing context has been cancelled. Fixup the context so that
>>>>>>>> + * it will be marked as incomplete [-EIO] upon resubmission and not
>>>>>
>>>>> (read below first)
>>>>>
>>>>> ... and not misleadingly say "Fixup the context so that it will be
>>>>> marked as incomplete" because there is nothing in this function which
>>>>> does that. It mostly happens by the virtual of context already being
>>>>> marked as banned somewhere else. This comment should just explain the
>>>>> decision to rewind the ring->head for more determinism. It can still
>>>>> mention canceling of user payload and -EIO. Just needs to be clear of
>>>>> the single extra thing achieved here by the head rewind and context edit.
>>>>
>>>> I thought I was clear: "upon resubmission". So use a more active voice to
>>>> reduce ambiguity, gotcha.
>>>
>>> /*
>>> * The executing context has been cancelled. We want to prevent
>>> * further execution along this context and propagate the error on
>>> * to anything depending on its results.
>>> *
>>> * In __i915_request_submit(), we apply the -EIO and remove the
>>> * requests payload for any banned requests. But first, we must
>>> * rewind the context back to the start of the incomplete request so
>>> * that we don't jump back into the middle of the batch.
>>> *
>>> * We preserve the breadcrumbs and semaphores of the incomplete
>>> * requests so that inter-timeline dependencies (i.e other timelines)
>>> * remain correctly ordered.
>>> */
>>>
>>
>> Sounds good.
>>
>> Btw.. does this work? :) If context was preempted in the middle of a
>> batch buffer there must be some other state saved (other than RING_HEAD)
>> which on context restore enables it to continue from the right place
>> *within* the batch. Is this code zapping that state as well so GPU will
>> fully forget it was inside the batch?
>
> Yes. We are resetting the context image back to vanilla, and then
> restore the ring registers to restart from this request. The selftests
> are using spinning batches to simulate the banned context.
Okay, in that case:
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-10-14 13:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 9:07 [PATCH 01/15] drm/i915/display: Squelch kerneldoc warnings Chris Wilson
2019-10-14 9:07 ` [PATCH 02/15] drm/i915/gem: Distinguish each object type Chris Wilson
2019-10-14 9:07 ` [PATCH 03/15] drm/i915/execlists: Assert tasklet is locked for process_csb() Chris Wilson
2019-10-14 9:07 ` [PATCH 04/15] drm/i915/execlists: Clear semaphore immediately upon ELSP promotion Chris Wilson
2019-10-14 9:07 ` [PATCH 05/15] drm/i915/execlists: Tweak virtual unsubmission Chris Wilson
2019-10-14 9:07 ` [PATCH 06/15] drm/i915/selftests: Check known register values within the context Chris Wilson
2019-10-14 9:59 ` Tvrtko Ursulin
2019-10-14 10:06 ` Chris Wilson
2019-10-14 9:07 ` [PATCH 07/15] drm/i915/selftests: Check that GPR are cleared for new contexts Chris Wilson
2019-10-14 10:08 ` Tvrtko Ursulin
2019-10-14 9:07 ` [PATCH 08/15] drm/i915: Expose engine properties via sysfs Chris Wilson
2019-10-14 10:17 ` Tvrtko Ursulin
2019-10-14 10:27 ` Chris Wilson
2019-10-14 9:07 ` [PATCH 09/15] drm/i915/execlists: Force preemption Chris Wilson
2019-10-14 9:07 ` [PATCH 10/15] drm/i915/gt: Introduce barrier pulses along engines Chris Wilson
2019-10-14 11:03 ` Tvrtko Ursulin
2019-10-14 9:07 ` [PATCH 11/15] drm/i915/execlists: Cancel banned contexts on schedule-out Chris Wilson
2019-10-14 12:00 ` Tvrtko Ursulin
2019-10-14 12:06 ` Chris Wilson
2019-10-14 12:25 ` Tvrtko Ursulin
2019-10-14 12:34 ` Chris Wilson
2019-10-14 13:13 ` Chris Wilson
2019-10-14 13:19 ` Tvrtko Ursulin
2019-10-14 13:23 ` Chris Wilson
2019-10-14 13:38 ` Tvrtko Ursulin [this message]
2019-10-14 9:07 ` [PATCH 12/15] drm/i915/gem: Cancel non-persistent contexts on close Chris Wilson
2019-10-14 12:11 ` Tvrtko Ursulin
2019-10-14 12:21 ` Chris Wilson
2019-10-14 13:10 ` Tvrtko Ursulin
2019-10-14 13:34 ` Chris Wilson
2019-10-14 16:06 ` Tvrtko Ursulin
2019-10-14 9:07 ` [PATCH 13/15] drm/i915: Replace hangcheck by heartbeats Chris Wilson
2019-10-14 12:13 ` Tvrtko Ursulin
2019-10-14 9:07 ` [PATCH 14/15] drm/i915: Flush idle barriers when waiting Chris Wilson
2019-10-14 9:07 ` [PATCH 15/15] drm/i915/execlist: Trim immediate timeslice expiry Chris Wilson
2019-10-14 16:15 ` ✗ Fi.CI.BUILD: failure for series starting with [01/15] drm/i915/display: Squelch kerneldoc warnings 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=fb23201a-1e20-f085-052d-b3f61b7c2298@linux.intel.com \
--to=tvrtko.ursulin@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