From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 00/66] [v1] Full PPGTT minus soft pin
Date: Tue, 2 Jul 2013 09:43:19 +0200 [thread overview]
Message-ID: <20130702074319.GI18285@phenom.ffwll.local> (raw)
In-Reply-To: <20130701223612.GJ4242@bwidawsk.net>
On Mon, Jul 01, 2013 at 03:36:13PM -0700, Ben Widawsky wrote:
> On Mon, Jul 01, 2013 at 11:39:30PM +0200, Daniel Vetter wrote:
> > Hi Ben
> >
> > So first things first: I rather like what the code looks like overall at
> > the end. I've done a light read-through (by far not a full review) and
> > besides a few bikesheds (all mentioned by mail already) the big thing is
> > the 1:1 context:ppgtt address space relationship.
> >
> > We've discussed this at length in private irc and agreed that we need to
> > changes this two a n:1 relationship, so I'll just reiterate the reasons
> > for that on the list:
> >
> > - Current userspace expects that different contexts created on the same fd
> > all use the same address space (since there's really only one). So if we
> > want to no add a new ABI (and for testing I really think we want to
> > enable ppgtt on current unchanged userspace) we must keep that promise.
> > Hence we need to be able to point the different contexts created on an
> > fd all at the same (per-fd) address space.
> >
> > If we want we could later on extend this and allow a context to have a
> > private address space all of its own.
> >
> > - HW contexts are pretty much the execution/scheduling primitive the hw
> > provides us with. On current platforms that's a bit a stretch, but it's
> > much clearer on future platforms.
> >
> > The equivalent concept on the cpu would be threads, and history
> > unanimously established that having multiple threads in the same process
> > is a useful concept. So I think allowing the same N:1 context:ppgtt
> > relation on gpus is sound. Of course that does not preclude other ways
> > to share individual buffers, which we already support with
> > flink/dma_buf.
> >
> > With that big issue resolved there's only the bikesheds left. I'm not
> > really worried about those, and in any case we already have some good
> > discussions going on about them.
>
> I've discussed this with the Mesa team, and I believe this is what they
> want. I'll highlight the important bit for TL;DR people:
> > Hence we need to be able to point the different contexts created on an
> > fd all at the same (per-fd) address space.
>
> If one wants a new address space, they will have to open a new fd.
Yeah, that's the gist of it.
> > So merge plan:
> >
> > Since the context<->ppgtt relation needs to be revamped I'd like to punt
> > on patches in that area at first and concentrate on merging the
> > address_space/vma conversion and all the prep work leading to that first.
>
> The main idea [ack, or nak] is the ppgtt becomes *ppgtt, and the context
> will refcount it on context creation/destrution - that way all the
> existing tricky context refcounting should still work, and the last
> context to down ref a ppgtt will destroy it in it's handler.
Yep, that's what I have in mind.
> > We're already discussing some of the details, so I won't repeat that here
> > again. I think for the overall approach I wouldn't bother with rebasing -
> > shuffling around such a massive&invasive patch series is a major pain and
> > rather error-prone.
> >
> > Instead I'd just freeze the current branch as a known-working reference
> > point and cherry-pick individual subseries out of it. Also some patches
> > will need to be redone, but thanks to the benefit of hindsight I hope that
> > v2 will have much less churn. Again I've tossed around a few ideas in
> > replies to individual patches.
> >
> > For prep work I see a few pieces:
> >
> > - drm_mm related prep work, especially drm_mm.c core changes. I think
> > simply reordering all the relevant patches and resubmitting them (with
> > cc: dri-devel) is all we need to get those in (minus the oddball last
> > minute bikeshed).
> >
> > - Small static inline functions to ease the pain of the conversion. I
> > think those need to be redone with as much foreshadowing as possible (so
> > that later patches don't suffer from overblown diff sizes). Maybe we
> > should also do the lookup-helpers upfront.
> >
> > - Other prep work like killing obj->gtt_offset and stuff I've missed (but
> > which doesn't touch the context<->ppgtt relation).
>
> I think this might be mergeable now. Did you try and have conflicts?
It's mergeable but imo it makes much more sense to add the gtt_space access
helpers first and then embed the drm_mm_node. Same for killing gtt_offset.
Atm your patch ordering for those three things is the wrong way round,
resulting in needless amounts of diff churn. I should have replied to that
patch with this comment, but maybe I've failed ...
> > - I think we can also merge as much of the hw interfacing code as possible
> > up-front (or in paralle), e.g. converting the pde loading to LRI.
>
> I was thinking this as well. I wasn't sure how you'd feel about the
> idea. I'd really like that. This should also have no conflicts at
> present (that I'm aware of).
Yeah, if you can prep a subseries of cherry-pick hw interface prep stuff I
can merge it right away. Should also make reviewing stuff a bit easier if
it's split out from the main thing.
> > Then we can slurp all the address_space/vma conversion patches. Imo the
> > important part is to fledge out the commit message with the hindsight
> > insights and explain a bit why certain stuff gets moved and why other
> > stuff should stay where it currently is. We also need to review whether
> > bisecting isn't broken anywhere, but since we don't yet add a real ppgtt I
> > don't expect any issues.
> >
> > Once that's all in we can revisit the context vs. ppgtt question and
> > figure out how to make it work. I expect that we need to refcount ppgtt
> > address spaces. But if we keep the per-fd contexts around (imo a sane idea
> > anyway) we should get by when just the contexts hold references onto the
> > ppgtt object. Since the context is guaranteed to stay around until the
> > last object is inactive again that should ensure that the ppgtt address
> > space stays around for long enough, too. And it would avoid the ugliness
> > of adding more tricky active refcounting on top of the context/obj
> > refcounting we already have.
> >
> > Comments?
>
> The high level plan sounds totally fine to me, I still have some issues
> with how to break up the huge changes in the VMA/VM conversion since
> many interfaces need to change, and that gets messy. In the end I like
> what I did where I split out the 6 or 7 major changes for review. Would
> you be okay with that again? Maybe if all goes well, it won't be a
> problem.
The current vma patches have some scary looking warnings about bisecting,
which need to be addressed. One trick could be to simply embed the vma
object temporarily into the gem_object until everything is moved into the
new place. That way the logic stays the same, we only have the code churn
to deal with (like sprinkling vma arguments instead of obj arguments over
tons of functions). Even the list handling code could be implemented while
the (single) vma is still embedded.
Then the actual behaviour change of a free-standing vma would reduce a lot
(and that change is the tricky one for bisecting I'd guess).
This approach for vmas would mirror your current approach for growing the
address_space struct by piecewise moving stuff from dev_priv->mm to the
(global gtt) address space struct.
Cheers, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-07-02 7:43 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-27 23:30 [PATCH 00/66] [v1] Full PPGTT minus soft pin Ben Widawsky
2013-06-27 23:30 ` [PATCH 01/66] drm/i915: Remove extra error state NULL Ben Widawsky
2013-06-27 23:30 ` [PATCH 02/66] drm/i915: Extract error buffer capture Ben Widawsky
2013-06-27 23:30 ` [PATCH 03/66] drm/i915: make PDE|PTE platform specific Ben Widawsky
2013-06-28 16:53 ` Daniel Vetter
2013-06-27 23:30 ` [PATCH 04/66] drm: Optionally create mm blocks from top-to-bottom Ben Widawsky
2013-06-30 12:30 ` Daniel Vetter
2013-06-30 12:40 ` Daniel Vetter
2013-06-27 23:30 ` [PATCH 05/66] drm/i915: Don't clear gtt with 0 entries Ben Widawsky
2013-06-27 23:30 ` [PATCH 06/66] drm/i915: Conditionally use guard page based on PPGTT Ben Widawsky
2013-06-28 17:57 ` Jesse Barnes
2013-06-27 23:30 ` [PATCH 07/66] drm/i915: Use drm_mm for PPGTT PDEs Ben Widawsky
2013-06-28 18:01 ` Jesse Barnes
2013-06-27 23:30 ` [PATCH 08/66] drm/i915: cleanup context fini Ben Widawsky
2013-06-27 23:30 ` [PATCH 09/66] drm/i915: Do a fuller init after reset Ben Widawsky
2013-06-27 23:30 ` [PATCH 10/66] drm/i915: Split context enabling from init Ben Widawsky
2013-06-27 23:30 ` [PATCH 11/66] drm/i915: destroy i915_gem_init_global_gtt Ben Widawsky
2013-06-27 23:30 ` [PATCH 12/66] drm/i915: Embed PPGTT into the context Ben Widawsky
2013-06-27 23:30 ` [PATCH 13/66] drm/i915: Unify PPGTT codepaths on gen6+ Ben Widawsky
2013-06-27 23:30 ` [PATCH 14/66] drm/i915: Move ppgtt initialization down Ben Widawsky
2013-06-27 23:30 ` [PATCH 15/66] drm/i915: Tie context to PPGTT Ben Widawsky
2013-06-27 23:30 ` [PATCH 16/66] drm/i915: Really share scratch page Ben Widawsky
2013-06-27 23:30 ` [PATCH 17/66] drm/i915: Combine scratch members into a struct Ben Widawsky
2013-06-27 23:30 ` [PATCH 18/66] drm/i915: Drop dev from pte_encode Ben Widawsky
2013-06-27 23:30 ` [PATCH 19/66] drm/i915: Use gtt shortform where possible Ben Widawsky
2013-06-27 23:30 ` [PATCH 20/66] drm/i915: Move fbc members out of line Ben Widawsky
2013-06-30 13:10 ` Daniel Vetter
2013-06-27 23:30 ` [PATCH 21/66] drm/i915: Move gtt and ppgtt under address space umbrella Ben Widawsky
2013-06-30 13:12 ` Daniel Vetter
2013-07-01 18:40 ` Ben Widawsky
2013-07-01 18:48 ` Daniel Vetter
2013-06-27 23:30 ` [PATCH 22/66] drm/i915: Move gtt_mtrr to i915_gtt Ben Widawsky
2013-06-27 23:30 ` [PATCH 23/66] drm/i915: Move stolen stuff " Ben Widawsky
2013-06-30 13:18 ` Daniel Vetter
2013-07-01 18:43 ` Ben Widawsky
2013-07-01 18:51 ` Daniel Vetter
2013-06-27 23:30 ` [PATCH 24/66] drm/i915: Move aliasing_ppgtt Ben Widawsky
2013-06-30 13:27 ` Daniel Vetter
2013-07-01 18:52 ` Ben Widawsky
2013-07-01 19:06 ` Daniel Vetter
2013-07-01 19:48 ` Ben Widawsky
2013-07-01 19:54 ` Daniel Vetter
2013-06-27 23:30 ` [PATCH 25/66] drm/i915: Put the mm in the parent address space Ben Widawsky
2013-06-27 23:30 ` [PATCH 26/66] drm/i915: Move active/inactive lists to new mm Ben Widawsky
2013-06-30 15:38 ` Daniel Vetter
2013-07-01 22:56 ` Ben Widawsky
2013-07-02 7:26 ` Daniel Vetter
2013-07-02 16:47 ` Ben Widawsky
2013-06-27 23:30 ` [PATCH 27/66] drm/i915: Create a global list of vms Ben Widawsky
2013-06-27 23:30 ` [PATCH 28/66] drm/i915: Remove object's gtt_offset Ben Widawsky
2013-06-27 23:30 ` [PATCH 29/66] drm: pre allocate node for create_block Ben Widawsky
2013-06-30 12:34 ` Daniel Vetter
2013-07-01 18:30 ` Ben Widawsky
2013-06-27 23:30 ` [PATCH 30/66] drm/i915: Getter/setter for object attributes Ben Widawsky
2013-06-30 13:00 ` Daniel Vetter
2013-07-01 18:32 ` Ben Widawsky
2013-07-01 18:43 ` Daniel Vetter
2013-07-01 19:08 ` Daniel Vetter
2013-07-01 22:59 ` Ben Widawsky
2013-07-02 7:28 ` Daniel Vetter
2013-07-02 16:51 ` Ben Widawsky
2013-07-02 17:07 ` Daniel Vetter
2013-06-27 23:30 ` [PATCH 31/66] drm/i915: Create VMAs (part 1) Ben Widawsky
2013-06-27 23:30 ` [PATCH 32/66] drm/i915: Create VMAs (part 2) - kill gtt space Ben Widawsky
2013-06-27 23:30 ` [PATCH 33/66] drm/i915: Create VMAs (part 3) - plumbing Ben Widawsky
2013-06-27 23:30 ` [PATCH 34/66] drm/i915: Create VMAs (part 3.5) - map and fenceable tracking Ben Widawsky
2013-06-27 23:30 ` [PATCH 35/66] drm/i915: Create VMAs (part 4) - Error capture Ben Widawsky
2013-06-27 23:30 ` [PATCH 36/66] drm/i915: Create VMAs (part 5) - move mm_list Ben Widawsky
2013-06-27 23:30 ` [PATCH 37/66] drm/i915: Create VMAs (part 6) - finish error plumbing Ben Widawsky
2013-06-27 23:30 ` [PATCH 38/66] drm/i915: create an object_is_active() Ben Widawsky
2013-06-27 23:30 ` [PATCH 39/66] drm/i915: Move active to vma Ben Widawsky
2013-06-27 23:30 ` [PATCH 40/66] drm/i915: Track all VMAs per VM Ben Widawsky
2013-06-30 15:35 ` Daniel Vetter
2013-07-01 19:04 ` Ben Widawsky
2013-06-27 23:30 ` [PATCH 41/66] drm/i915: Defer request freeing Ben Widawsky
2013-06-27 23:30 ` [PATCH 42/66] drm/i915: Clean up VMAs before freeing Ben Widawsky
2013-07-02 10:59 ` Ville Syrjälä
2013-07-02 16:58 ` Ben Widawsky
2013-06-27 23:30 ` [PATCH 43/66] drm/i915: Replace has_bsd/blt with a mask Ben Widawsky
2013-06-27 23:30 ` [PATCH 44/66] drm/i915: Catch missed context unref earlier Ben Widawsky
2013-06-27 23:30 ` [PATCH 45/66] drm/i915: Add a context open function Ben Widawsky
2013-06-27 23:30 ` [PATCH 46/66] drm/i915: Permit contexts on all rings Ben Widawsky
2013-06-27 23:30 ` [PATCH 47/66] drm/i915: Fix context fini refcounts Ben Widawsky
2013-06-27 23:30 ` [PATCH 48/66] drm/i915: Better reset handling for contexts Ben Widawsky
2013-06-27 23:30 ` [PATCH 49/66] drm/i915: Create a per file_priv default context Ben Widawsky
2013-06-27 23:30 ` [PATCH 50/66] drm/i915: Remove ring specificity from contexts Ben Widawsky
2013-06-27 23:30 ` [PATCH 51/66] drm/i915: Track which ring a context ran on Ben Widawsky
2013-06-27 23:30 ` [PATCH 52/66] drm/i915: dump error state based on capture Ben Widawsky
2013-06-27 23:30 ` [PATCH 53/66] drm/i915: PPGTT should take a ppgtt argument Ben Widawsky
2013-06-27 23:30 ` [PATCH 54/66] drm/i915: USE LRI for switching PP_DIR_BASE Ben Widawsky
2013-06-27 23:30 ` [PATCH 55/66] drm/i915: Extract mm switching to function Ben Widawsky
2013-06-27 23:30 ` [PATCH 56/66] drm/i915: Write PDEs at init instead of enable Ben Widawsky
2013-06-27 23:30 ` [PATCH 57/66] drm/i915: Disallow pin with full ppgtt Ben Widawsky
2013-06-28 8:55 ` Chris Wilson
2013-06-29 5:43 ` Ben Widawsky
2013-06-29 6:44 ` Chris Wilson
2013-06-29 14:34 ` Daniel Vetter
2013-06-30 6:56 ` Ben Widawsky
2013-06-30 11:06 ` Daniel Vetter
2013-06-30 11:31 ` Chris Wilson
2013-06-30 11:36 ` Daniel Vetter
2013-07-01 18:27 ` Ben Widawsky
2013-06-27 23:30 ` [PATCH 58/66] drm/i915: Get context early in execbuf Ben Widawsky
2013-06-27 23:31 ` [PATCH 59/66] drm/i915: Pass ctx directly to switch/hangstat Ben Widawsky
2013-06-27 23:31 ` [PATCH 60/66] drm/i915: Actually add the new address spaces Ben Widawsky
2013-06-27 23:31 ` [PATCH 61/66] drm/i915: Use multiple VMs Ben Widawsky
2013-06-27 23:43 ` Ben Widawsky
2013-07-02 10:58 ` Ville Syrjälä
2013-07-02 11:07 ` Chris Wilson
2013-07-02 11:34 ` Ville Syrjälä
2013-07-02 11:38 ` Chris Wilson
2013-07-02 12:34 ` Daniel Vetter
2013-06-27 23:31 ` [PATCH 62/66] drm/i915: Kill now unused ppgtt_{un, }bind Ben Widawsky
2013-06-27 23:31 ` [PATCH 63/66] drm/i915: Add PPGTT dumper Ben Widawsky
2013-06-27 23:31 ` [PATCH 64/66] drm/i915: Dump all ppgtt Ben Widawsky
2013-06-27 23:31 ` [PATCH 65/66] drm/i915: Add debugfs for vma info per vm Ben Widawsky
2013-06-27 23:31 ` [PATCH 66/66] drm/i915: Getparam full ppgtt Ben Widawsky
2013-06-28 3:38 ` [PATCH 00/66] [v1] Full PPGTT minus soft pin Ben Widawsky
2013-07-01 21:39 ` Daniel Vetter
2013-07-01 22:36 ` Ben Widawsky
2013-07-02 7:43 ` Daniel Vetter [this message]
2013-10-29 23:08 ` Eric Anholt
2013-10-30 0:10 ` Jesse Barnes
2013-11-01 17:20 ` Jesse Barnes
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=20130702074319.GI18285@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=ben@bwidawsk.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 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.