All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: Retire requests along rings
Date: Mon, 23 Apr 2018 10:06:45 +0100	[thread overview]
Message-ID: <152447440541.4840.10086979361052650347@mail.alporthouse.com> (raw)
In-Reply-To: <dac344b7-91ce-3dfa-f49c-7a4d6f714829@linux.intel.com>

Quoting Tvrtko Ursulin (2018-04-23 09:47:57)
> 
> On 20/04/2018 14:20, Chris Wilson wrote:
> >   void i915_retire_requests(struct drm_i915_private *i915)
> >   {
> > -     struct intel_engine_cs *engine;
> > -     enum intel_engine_id id;
> > +     struct intel_ring *ring, *next;
> >   
> >       lockdep_assert_held(&i915->drm.struct_mutex);
> >   
> >       if (!i915->gt.active_requests)
> >               return;
> >   
> > -     for_each_engine(engine, i915, id)
> > -             engine_retire_requests(engine);
> > +     list_for_each_entry_safe(ring, next, &i915->gt.rings, link)
> > +             ring_retire_requests(ring);
> 
> [Continuing from previous discussion on try-bot.]
> 
> I had a thought that this could be managed more efficiently in a very 
> simple manner.
> 
> We rename timeline->inflight_seqnos to something like live_requests and 
> manage this per ctx timeline, from request_add to request_retire. At the 
> same time we only have ring->ring_link be linked to 
> i915->gt.(live_)rings while the ctx timeline live_requests count is 
> greater than zero. In other words list_add on 0->1, list_del on 1->0.
> 
> This way the retire path does not have to walk all known rings, but only 
> all rings with live (unretired) reqeusts.
> 
> What do you think?

I wouldn't resurrect inflight_seqnos for this, we can simply use
list_empty(ring->request_list). Slight icky feeling every time we do
anything under struct_mutex, but by this point I itch all over.

Seems like a small enough patch to try after. I think I class it as an
optimisation, so would like to get the bigger change in engine to ring
soaking first.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-04-23  9:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 13:20 [PATCH 1/4] drm/i915: Stop tracking timeline->inflight_seqnos Chris Wilson
2018-04-20 13:20 ` [PATCH 2/4] drm/i915: Retire requests along rings Chris Wilson
2018-04-23  8:47   ` Tvrtko Ursulin
2018-04-23  9:06     ` Chris Wilson [this message]
2018-04-23 10:16       ` Tvrtko Ursulin
2018-04-20 13:20 ` [PATCH 3/4] drm/i915: Move timeline from GTT to ring Chris Wilson
2018-04-20 13:20 ` [PATCH 4/4] drm/i915: Split i915_gem_timeline into individual timelines Chris Wilson
2018-04-20 16:15 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915: Stop tracking timeline->inflight_seqnos Patchwork
2018-04-20 16:17 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-20 16:29 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-20 17:24 ` ✓ Fi.CI.IGT: " 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=152447440541.4840.10086979361052650347@mail.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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.