intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Eric Anholt <eric@anholt.net>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] [RFC] drm/i915: Restore LRU evict order, with a twist!
Date: Thu, 01 Jul 2010 21:36:41 +0100	[thread overview]
Message-ID: <89k77n$o7tsl8@fmsmga001.fm.intel.com> (raw)
In-Reply-To: <877hlfhtiq.fsf@pollan.anholt.net>

On Thu, 01 Jul 2010 12:49:33 -0700, Eric Anholt <eric@anholt.net> wrote:
> On Thu,  1 Jul 2010 17:53:44 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > +static int
> > +i915_gem_eviction_roster_add(struct i915_gem_eviction_roster *roster,
> > +			     struct drm_i915_gem_object *obj_priv)
> > +{
> 
> This function could stand a brief comment of what it does.  But frankly,
> a lot of this file looks like a rewrite of drm_mm.c -- is there a reason
> not to reuse that for free space tracking?

I only sent this patch simply because it was the one in my tree and has
seen some testing prior to forward porting to the current drm-intel-next.
(Though obviously not any testing on HAS_BSD hardware!). Daniel Vetter
reworked drm_mm.c for the same purpose, which the change in eviction logic
here could reuse once that was ready.

> Only downside seems to be
> doing another lookup to figure out which objects take up the space when
> we decide on which block to free, since the merging of blocks wouldn't
> be aware of our list of objects we want to attach.

IIRC, Daniel used a rollback to undo the incomplete evictions. I'll port
his work to the current tree and rebase upon it.

> (but then, if we're going to talk about cpu efficiency, it seems like we
> could do a lot better than this implementation of _search that we call
> over and over to try to find the a block with the same size/align
> parameters each time)

The fun we could have, though clarity here is paramount. Making the wrong
choice over which object to evict costs far more in clflush than we could
reasonably expend searching...

Thanks for the review. This is something that I feel does need to be in
shape for the next merge window as the 2D code is still susceptible to
the page-fault-of-doom.
-- 
Chris Wilson, Intel Open Source Technology Centre

      reply	other threads:[~2010-07-01 20:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 16:53 [PATCH 1/2] [RFC] drm/i915: Restore LRU evict order, with a twist! Chris Wilson
2010-07-01 16:53 ` [PATCH 2/2] drm/i915: Maintain LRU order of inactive objects upon access by CPU Chris Wilson
2010-07-01 19:49 ` [PATCH 1/2] [RFC] drm/i915: Restore LRU evict order, with a twist! Eric Anholt
2010-07-01 20:36   ` Chris Wilson [this message]

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='89k77n$o7tsl8@fmsmga001.fm.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=eric@anholt.net \
    --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;
as well as URLs for NNTP newsgroup(s).