All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 1/6] drm/i915: Stop tracking timeline->inflight_seqnos
Date: Tue, 24 Apr 2018 12:17:15 +0100	[thread overview]
Message-ID: <15800d6c-4fd2-33e9-e522-91cac1313911@linux.intel.com> (raw)
In-Reply-To: <152456643051.12387.14376256442287568305@mail.alporthouse.com>


On 24/04/2018 11:40, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-04-24 11:14:21)
>>
>> On 23/04/2018 19:08, Chris Wilson wrote:
>>> -static int reserve_engine(struct intel_engine_cs *engine)
>>> +static int reserve_gt(struct drm_i915_private *i915)
>>>    {
>>> -     struct drm_i915_private *i915 = engine->i915;
>>> -     u32 active = ++engine->timeline->inflight_seqnos;
>>> -     u32 seqno = engine->timeline->seqno;
>>>        int ret;
>>>    
>>> -     /* Reservation is fine until we need to wrap around */
>>> -     if (unlikely(add_overflows(seqno, active))) {
>>> +     /*
>>> +      * Reservation is fine until we may need to wrap around
>>> +      *
>>> +      * By incrementing the serial for every request, we know that no
>>> +      * individual engine may exceed that serial (as each is reset to 0
>>> +      * on any wrap). This protects even the most pessimistic of migrations
>>> +      * of every request from all engines onto just one.
>>> +      */
>>
>> I didn't really figure out what was wrong with v1? Neither could handle
>> more than four billion of simultaneously active requests - but I thought
>> that should not concern us. :)
> 
> It was still using the local engine->timeline.seqno as it's base. If we
> swapped from one at 0 to another at U32_MAX, we would overflow much
> later in submission; after the point of no return.

By swapped you already refer to engine change? Ok, I can see that yes. 
In this case global counter does prevent that.

In the light of that, what is your current thinking with regards to 
mixing engine classes?

If the thinking is still to only allow within a class then per-class 
seqno counter would be an option.

Regards,

Tvrtko

>> I don't quite get wrapping based on otherwise unused counter.
>>
>> v1 made sense to wrap then any engine timeline couldn't handle all
>> active requests without wrapping.
> 
> Emphasis on *any*, not just the current engine.
> -Chris
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-04-24 11:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 18:08 [PATCH v2 1/6] drm/i915: Stop tracking timeline->inflight_seqnos Chris Wilson
2018-04-23 18:08 ` [PATCH v2 2/6] drm/i915: Retire requests along rings Chris Wilson
2018-04-23 18:08 ` [PATCH v2 3/6] drm/i915: Only track live rings for retiring Chris Wilson
2018-04-24  9:37   ` Tvrtko Ursulin
2018-04-24  9:43     ` Chris Wilson
2018-04-23 18:08 ` [PATCH v2 4/6] drm/i915: Move timeline from GTT to ring Chris Wilson
2018-04-23 18:08 ` [PATCH v2 5/6] drm/i915: Split i915_gem_timeline into individual timelines Chris Wilson
2018-04-23 23:11   ` [PATCH] " Chris Wilson
2018-04-23 18:08 ` [PATCH v2 6/6] drm/i915: Lazily unbind vma on close Chris Wilson
2018-04-23 18:17 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/6] drm/i915: Stop tracking timeline->inflight_seqnos Patchwork
2018-04-23 18:19 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-23 18:32 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-04-23 20:29 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2018-04-23 20:32 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-23 20:46 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-04-23 23:53 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/6] drm/i915: Stop tracking timeline->inflight_seqnos (rev2) Patchwork
2018-04-23 23:55 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-24  0:08 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-04-24 10:14 ` [PATCH v2 1/6] drm/i915: Stop tracking timeline->inflight_seqnos Tvrtko Ursulin
2018-04-24 10:40   ` Chris Wilson
2018-04-24 11:17     ` Tvrtko Ursulin [this message]
2018-04-24 11:28       ` Chris Wilson
2018-04-24 13:55         ` Tvrtko Ursulin
2018-04-24 14:04           ` Chris Wilson
2018-04-24 14:48             ` Tvrtko Ursulin
2018-04-24 15:58               ` Chris Wilson

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=15800d6c-4fd2-33e9-e522-91cac1313911@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.