public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Keith Packard <keithp@keithp.com>, intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH] drm/i915: Seperate fence pin counting from normal bind pin counting
Date: Sat, 04 Jun 2011 19:31:27 +0100	[thread overview]
Message-ID: <e0d58a$8kl1b@orsmga002.jf.intel.com> (raw)
In-Reply-To: <yun4o45pke8.fsf@aiko.keithp.com>


On Sat, 04 Jun 2011 10:38:07 -0700, Keith Packard <keithp@keithp.com> wrote:
> On Sat,  4 Jun 2011 09:55:43 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> I'm afraid you've completely lost me here. Can you provide a small
> example (libdrm?) program which exhibits the failure so I can follow
> what the problem is?

The outline of the test case is (tuned for num_avail_fences):

batch 1 with 16 buffers, all with fenced relocations.
batch 2 with all 16 buffers from batch, but with no fenced relocations,
and 16 fresh buffers with fenced relocations.

At the start of batch 2, we first pin the 16 reused and currently bound
buffers from batch 1, which we do to avoid eviction any of those active
buffers to make room for batch 2. This has the side-effect of also
pinning all 16 fence registers, of which none are going to be used in
batch 2. Then when we try to pin and fence a fresh buffer, we cannot
find an available fence, abort the reservation and evict everything. On
the second pass we are then able to pin and fence, as required, all 32
buffers.

> And, if I understand any of this at all, I should remove the patch to
> return -EDEADLK from i915_gem_object_get_fence as we may run out of
> fence registers even if the client is accounting for them correctly. If
> so, I'll remove that from my list of -fixes patches.

Yes, we can't apply the EDEADLK patch until we fix the accounting.

> As this is a performance optimization, I also expect to see convincing
> benchmark data before this patch could be considered for merging.

Since the problem is that we prematurely run out of fences, we frequently
trigger evict_everything(inactive) and so cause mass evictions and clflush,
and a large performance regression for heavy fenced BLT usage:

Speedups on q35 (or equally because I finally noticed the regression of):
 midori-zoomed            3576.78 -> 2059.74: 1.74x speedup
 firefox-planet-gnome    14500.77 -> 9523.07: 1.52x speedup
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2011-06-04 18:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-04  8:55 [PATCH] drm/i915: Seperate fence pin counting from normal bind pin counting Chris Wilson
2011-06-04 17:38 ` Keith Packard
2011-06-04 18:31   ` Chris Wilson [this message]
2011-06-05  1:07     ` Keith Packard
2011-06-04 22:18   ` Chris Wilson
2011-06-05 20:55 ` Daniel Vetter
2011-06-06  6:10   ` [PATCH] drm/i915: Separate " Chris Wilson
2011-09-02 18:43     ` Eugeni Dodonov
2011-11-13 11:00 ` [PATCH] drm/i915: Seperate " Chris Wilson
2011-11-13 11:21   ` Paul Menzel
2011-11-23 12:38   ` Daniel Vetter
2011-11-23 13:04     ` [PATCH] drm/i915: Separate " Chris Wilson
2012-01-29 17:25       ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2011-07-09  8:25 [PATCH] drm/i915: Seperate " Chris Wilson
2011-07-09 10:23 ` Paul Menzel
2011-07-09 10:32   ` Chris Wilson
2011-11-23 10:49 ` Daniel Vetter

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='e0d58a$8kl1b@orsmga002.jf.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=keithp@keithp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox