All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 3/8] drm/i915: Add a new "remapped" gtt_view
Date: Tue, 09 Oct 2018 09:41:49 +0100	[thread overview]
Message-ID: <153907450914.16699.16082213409663047143@skylake-alporthouse-com> (raw)
In-Reply-To: <59597392-03ed-7c7d-c48a-67b1bd9cc3d8@linux.intel.com>

Quoting Tvrtko Ursulin (2018-10-09 09:24:33)
> 
> On 05/10/2018 19:42, Ville Syrjälä wrote:
> > On Mon, Oct 01, 2018 at 04:48:21PM +0100, Tvrtko Ursulin wrote:
> >>
> >> On 01/10/2018 16:37, Chris Wilson wrote:
> >>> Quoting Ville Syrjälä (2018-10-01 16:27:43)
> >>>> On Mon, Oct 01, 2018 at 04:12:09PM +0100, Chris Wilson wrote:
> >>>>> Quoting Ville Syrjälä (2018-10-01 16:03:30)
> >>>>>> On Wed, Sep 26, 2018 at 08:50:25AM +0100, Tvrtko Ursulin wrote:
> >>>>>>>
> >>>>>>> On 25/09/2018 20:37, Ville Syrjala wrote:
> >>>>>>> One more thing, do you really need random access for this
> >>>>>>> transformation? Or you could walk the sg list as it is? Just if you hit
> >>>>>>> a too long chunk you need to copy a trimmed version over and know where
> >>>>>>> to continue for the next row. If doable it would be better than having
> >>>>>>> to kvmalloc_array.
> >>>>>>
> >>>>>> I think Chris suggested just using i915_gem_object_get_dma_address()
> >>>>>> here. But I'm not sure why we're not using it for rotate_pages()
> >>>>>> as well.
> >>>>>
> >>>>> Tvrtko is opposed to populating the obj->mm.pages cache with no defined
> >>>>> release point. I say the mempressure and shrinker should to the right
> >>>>> thing, but it's a big if.
> >>>>
> >>>> OK.
> >>>>
> >>>> Well, looks to me like i915_gem_object_get_dma_address() is the
> >>>> only convenient looking thing for iterating the pages without
> >>>> arowning the code in irrelevant details about sgs and whatnot.
> >>>> I suppose it should be possible to write some helpers that avoid
> >>>> all that and don't need the temp array, but I'm not really
> >>>> motivated enough to do that myself.
> >>>
> >>> Keep it simple and use get_dma_address(). We can find ways to throw away
> >>> the cache later if need be.
> >>
> >> I'd do it straight away. I think cache for a large framebuffer, the kind
> >> which needs remapping could be quite big! Even the more fragmented
> >> memory the bigger the cache, and so if it sticks around pointlessly for
> >> the lifetime of the framebuffer it is a double whammy.
> > 
> > The tree is indexed with the ggtt offset so memory fragmentation
> > shouldn't matter I think. Or did I totally miss something?
> 
> I think it is indexed by page index, but the number of tree entries 
> depends on the number of sg chunks, which in turn depends on the system 
> memory fragmentation. Consecutive pages are stored as "exceptional" 
> entries so that is more efficient IIRC, but TBH I don't remember how 
> many of those it can store before it needs a new tree node. Anyways, if 
> I am not completely mistaken then the tree metadata size is proportional 
> to backing store fragmentation, and secondary proportional to object 
> size. (Due exceptional entry spill.)
> 
> > The relative overhead should be highest for a single page object
> > (576/4096 = ~15%). For big objects it should be something around
> > .2% AFAICS.
> 
> It is a bit annoying since radix tree does not have a helper to tell us 
> the number of allocated nodes. I don't remember how I measure this last 
> time.. Will try to recall.
> 
> > 
> > The shrinker can throw the cache out for non-pinned fbs. Looks
> > like it does consider all fbs active so it tries not to kick
> > them out as the first thing though. For pinned fbs the cache
> > would remain allocated forever however.
> > 
> > Keeping the cache around should be great for panning within
> > large remapped fbs. Although I suppose that panning isn't a
> > very common use case these days
> 
> We could just export __i915_gem_object_reset_page_iter, and look at the 
> required locking when used from rotate/remap and I'd be happy to start 
> with. But okay, let me first try to recall/re-measure how big are these 
> trees...

Also, the should soon be a generic radix tree implementation so we
should be free to swap out the tagged nodes for a more streamline tree.

But seriously, the sole argument is that you dislike the caching and you
even argue against the caching in situations like this where the cache
will be reused! (Since we need to remap each crtc into the single fb.)

We can't even randomly call reset_page_iter unless you know you own the
iter (since it's common to everyone who has a pin_pages). Revoking
unpinned pages under mempressure, i.e. the default shrinker behaviour,
seems satisfactory.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-09  8:41 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 19:37 [PATCH v3 0/8] drm/i915: GTT remapping for display Ville Syrjala
2018-09-25 19:37 ` [PATCH v3 1/8] drm/i915: Make sure fb gtt offsets stay within 32bits Ville Syrjala
2018-09-25 20:29   ` Chris Wilson
2018-09-26  9:27     ` Ville Syrjälä
2018-09-26 20:09       ` Chris Wilson
2018-09-27 12:24         ` Ville Syrjälä
2018-10-23 16:02   ` [PATCH v4 " Ville Syrjala
2018-10-23 18:49     ` Chris Wilson
2018-10-23 19:16       ` Ville Syrjälä
2018-09-25 19:37 ` [PATCH v3 2/8] drm/i915: Decouple SKL stride units from intel_fb_stride_alignment() Ville Syrjala
2018-10-23 18:50   ` Chris Wilson
2018-09-25 19:37 ` [PATCH v3 3/8] drm/i915: Add a new "remapped" gtt_view Ville Syrjala
2018-09-26  7:50   ` Tvrtko Ursulin
2018-10-01 15:03     ` Ville Syrjälä
2018-10-01 15:12       ` Chris Wilson
2018-10-01 15:27         ` Ville Syrjälä
2018-10-01 15:37           ` Chris Wilson
2018-10-01 15:48             ` Tvrtko Ursulin
2018-10-05 18:42               ` Ville Syrjälä
2018-10-09  8:24                 ` Tvrtko Ursulin
2018-10-09  8:41                   ` Chris Wilson [this message]
2018-10-09 11:54                   ` Ville Syrjälä
2018-10-10  7:04                     ` Tvrtko Ursulin
2018-10-01 15:38           ` Tvrtko Ursulin
2018-10-01 15:35         ` Tvrtko Ursulin
2018-10-23 16:02   ` [PATCH v4 " Ville Syrjala
2018-10-23 18:56     ` Chris Wilson
2018-10-23 19:10       ` Ville Syrjälä
2018-10-26  9:19     ` Tvrtko Ursulin
2018-10-26 12:43       ` Ville Syrjälä
2018-10-26 12:48         ` Tvrtko Ursulin
2018-09-25 19:37 ` [PATCH v3 4/8] drm/i915/selftests: Add mock selftest for remapped vmas Ville Syrjala
2018-09-25 20:22   ` Chris Wilson
2018-09-26  9:28     ` Ville Syrjälä
2018-10-23 16:03   ` [PATCH v4 " Ville Syrjala
2018-10-23 19:02     ` Chris Wilson
2018-10-23 19:14       ` Ville Syrjälä
2018-09-25 19:37 ` [PATCH v3 5/8] drm/i915/selftests: Add live vma selftest Ville Syrjala
2018-09-25 20:19   ` Chris Wilson
2018-09-25 20:40   ` Chris Wilson
2018-09-26  9:33     ` Ville Syrjälä
2018-10-23 16:03   ` [PATCH v4 " Ville Syrjala
2018-10-23 19:05     ` Chris Wilson
2018-09-25 19:37 ` [PATCH v3 6/8] drm/i915: Overcome display engine stride limits via GTT remapping Ville Syrjala
2018-10-23 19:16   ` Chris Wilson
2018-10-25 13:45     ` Ville Syrjälä
2018-09-25 19:37 ` [PATCH v3 7/8] drm/i915: Bump gen4+ fb stride limit to 256KiB Ville Syrjala
2018-09-25 20:13   ` Chris Wilson
2018-09-28 19:19     ` Ville Syrjälä
2018-09-25 19:37 ` [PATCH v3 8/8] drm/i915: Bump gen7+ fb size limits to 16kx16k Ville Syrjala
2018-09-25 19:59   ` Chris Wilson
2018-09-26  9:25     ` Ville Syrjälä
2018-09-25 20:05 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: GTT remapping for display Patchwork
2018-09-25 20:08 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-09-25 20:30 ` ✓ Fi.CI.BAT: success " Patchwork
2018-09-25 21:21 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-23 16:21 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: GTT remapping for display (rev5) Patchwork
2018-10-23 16:24 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-23 16:43 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-23 18:13 ` ✓ Fi.CI.IGT: " Patchwork
2019-01-09  9:45 ` [PATCH v3 0/8] drm/i915: GTT remapping for display Timo Aaltonen

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=153907450914.16699.16082213409663047143@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=ville.syrjala@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.