From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>,
"Koenig,
Christian" <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>
Cc: "intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [Intel-gfx] [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v12
Date: Wed, 26 Jun 2019 13:53:52 +0200 [thread overview]
Message-ID: <24916a7e-e0b5-d2ed-5a7a-0d816690a063@gmail.com> (raw)
In-Reply-To: <CAKMK7uH9SmCw-pcRvMrf1OL=jYDOJ5WSR8U8hOK+Amm6bjhnkg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[SNIP]
>>>>> I'm confused here: Atm ->moving isn't in resv_obj, there's only one
>>> exclusive fence. And yes you need to set that every time you do a move
>>> (because a move needs to be pretty exclusive access). But I'm not seeing a
>>> separate not_quite_exclusive fence slot for moves.
>> Yeah, but shouldn't that be sufficient? I mean why does somebody else
>> than the exporter needs to know when a BO is moving?
> I think for buffer sharing there's not much use for this, but it
> sounded like you want to use ->move_notify also more internally. And
> in that case, for vk, you want to be able to ignore the implicit
> fences as much as possible. But you can't ignore the buffer moves ofc.
> Hence tracking those separate could be useful.
Yeah, but for this case I can still rely on using ttm_bo->moving. So no
need to actually change that.
> amdgpu seems to be solving this internally by never attaching an
> exclusive fence for implicit stuff, or something like that, except
> when it's shared. But in general you need to assume a funky mix of
> implicit and explicit sync'ed workloads, and for those tracking the
> moves separately would be good.
Actually we have an "owner" for each fence which is basically a "void*"
pointer.
If we see that a command submission is coming from the same "owner" we
just avoid synchronization at all.
For buffer moves the owner is simply NULL (or some other special value),
and so we always sync to those.
[SNIP]
>>>>> - You sound like you want to use this a lot more, even internally in
>>>>> amdgpu. For that I do think the sepearate dma_fence just to make sure
>>>>> the buffer is accessible will be needed in resv_obj.
>>>>>
>>>>> - Once we have ->moving I think there's some good chances to extract a bit
>>>>> of the eviction/pipeline bo move boilerplate from ttm, and maybe use it
>>>>> in other drivers. i915 could already make use of this in upstream, since
>>>>> we already pipeline get_pages and clflush of buffers. Ofc once we have
>>>>> vram support, even more useful.
>>>> I actually indeed wanted to add more stuff to the reservation object
>>>> implementation, like finally cleaning up the distinction of readers/writers.
>>> Hm, more details? Not ringing a bell ...
>> I'm not yet sure about the details either, so please just wait until I
>> solved that all up for me first.
> Ah is this about amdgpu doing something else for implicit sync than
> what's supposed to be done, and a bit a mismatch when you deal with
> shared buffers?
Yes, exactly.
>>>> And cleaning up the fence removal hack we have in the KFD for freed up BOs.
>>>> That would also allow for getting rid of this in the long term.
>>> Hm, what's that for?
>> When the KFD frees up memory it removes their eviction fence from the
>> reservation object instead of setting it as signaled and adding a new
>> one to all other used reservation objects.
> Oh so just a fast-path for destryoing memory that's in-flight in some move?
Yes exactly that again.
Christian.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2019-06-26 11:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 12:46 [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v12 Christian König
2019-06-25 12:46 ` [PATCH 2/6] drm/ttm: remove the backing store if no placement is given Christian König
2019-06-25 12:46 ` [PATCH 3/6] drm/ttm: use the parent resv for ghost objects v2 Christian König
2019-06-25 13:07 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] dma-buf: add dynamic DMA-buf handling v12 Patchwork
2019-06-25 13:08 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-06-25 13:41 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-25 14:35 ` [PATCH 1/6] " Daniel Vetter
[not found] ` <20190625143548.GX12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-25 14:45 ` [Intel-gfx] " Christian König
2019-06-25 15:07 ` Daniel Vetter
2019-06-25 15:13 ` Christian König
[not found] ` <6fdde041-89f8-ff12-d237-3e280f0af21c-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-25 15:26 ` [Intel-gfx] " Daniel Vetter
2019-06-25 14:51 ` ✓ Fi.CI.IGT: success for series starting with [1/6] " Patchwork
[not found] ` <20190625124654.122364-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-06-25 12:46 ` [PATCH 4/6] drm/amdgpu: use allowed_domains for exported DMA-bufs Christian König
2019-06-25 12:46 ` [PATCH 5/6] drm/amdgpu: add independent DMA-buf export v6 Christian König
2019-06-25 12:46 ` [PATCH 6/6] drm/amdgpu: add independent DMA-buf import v7 Christian König
2019-06-25 16:05 ` [Intel-gfx] [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v12 Daniel Vetter
[not found] ` <20190625160539.GB12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-26 7:49 ` Christian König
[not found] ` <819ef4bd-e862-6390-d2e3-60f9d6c9cab4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-26 8:17 ` Daniel Vetter
[not found] ` <20190626081711.GH12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-26 9:28 ` Koenig, Christian
2019-06-26 10:57 ` Daniel Vetter
[not found] ` <CAKMK7uH9SmCw-pcRvMrf1OL=jYDOJ5WSR8U8hOK+Amm6bjhnkg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-26 11:53 ` Christian König [this message]
[not found] ` <24916a7e-e0b5-d2ed-5a7a-0d816690a063-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-26 12:15 ` Daniel Vetter
2019-06-26 12:34 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] dma-buf: add dynamic DMA-buf handling v12 (rev2) 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=24916a7e-e0b5-d2ed-5a7a-0d816690a063@gmail.com \
--to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=Christian.Koenig-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=daniel-/w4YWyX8dFk@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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