From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Chris Wilson
<chris-Y6uKTt2uX1cEflXRtASbqLVCufUGDwFn@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/2] dma-buf: try to replace a signaled fence in reservation_object_add_shared_inplace
Date: Tue, 14 Nov 2017 15:24:44 +0100 [thread overview]
Message-ID: <4fc05061-e92d-1702-a0f6-ee337b7d3eb3@gmail.com> (raw)
In-Reply-To: <150998532204.10527.4781311190552781355-M6iVdVfohj6unts5RBS2dVaTQe2KTcn/@public.gmane.org>
Am 06.11.2017 um 17:22 schrieb Chris Wilson:
> Quoting Christian König (2017-10-30 14:59:04)
>> From: Christian König <christian.koenig@amd.com>
>>
>> The amdgpu issue to also need signaled fences in the reservation objects should
>> be fixed by now.
>>
>> Optimize the handling by replacing a signaled fence when adding a new
>> shared one.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>> drivers/dma-buf/reservation.c | 18 +++++++++++++++---
>> 1 file changed, 15 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
>> index 6fc794576997..a3928ce9f311 100644
>> --- a/drivers/dma-buf/reservation.c
>> +++ b/drivers/dma-buf/reservation.c
>> @@ -104,7 +104,8 @@ reservation_object_add_shared_inplace(struct reservation_object *obj,
>> struct reservation_object_list *fobj,
>> struct dma_fence *fence)
>> {
>> - u32 i;
>> + struct dma_fence *signaled = NULL;
>> + u32 i, signaled_idx;
>>
>> dma_fence_get(fence);
>>
>> @@ -126,17 +127,28 @@ reservation_object_add_shared_inplace(struct reservation_object *obj,
>> dma_fence_put(old_fence);
>> return;
>> }
>> +
>> + if (!signaled && dma_fence_is_signaled(old_fence)) {
>> + signaled = old_fence;
>> + signaled_idx = i;
>> + }
> How much do we care about only keeping one fence per-ctx here? You could
> rearrange this to break on old_fence->context == fence->context ||
> dma_fence_is_signaled(old_fence) then everyone can use the final block.
Yeah, that is what David Zhou suggested as well.
I've rejected this approach for now cause I think we still have cases
where we rely on one fence per ctx (but I'm not 100% sure).
I changed patch #1 in this series as you suggest and going to send that
out once more in a minute.
Can we get this upstream as is for now? I won't have much more time
working on this.
Regards,
Christian.
> -Chris
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-11-14 14:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-30 14:59 [PATCH 1/2] dma-buf: keep only not signaled fence in reservation_object_add_shared_replace v2 Christian König
2017-10-30 14:59 ` [PATCH 2/2] dma-buf: try to replace a signaled fence in reservation_object_add_shared_inplace Christian König
2017-11-06 16:22 ` Chris Wilson
[not found] ` <150998532204.10527.4781311190552781355-M6iVdVfohj6unts5RBS2dVaTQe2KTcn/@public.gmane.org>
2017-11-14 14:24 ` Christian König [this message]
[not found] ` <4fc05061-e92d-1702-a0f6-ee337b7d3eb3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-14 14:34 ` Chris Wilson
2017-11-15 16:55 ` Chris Wilson
2017-11-15 17:34 ` Christian König
[not found] ` <1a565164-85cf-0678-b6ab-802ec047bb91-5C7GfCeVMHo@public.gmane.org>
2017-11-15 17:43 ` Chris Wilson
2017-11-15 18:56 ` Christian König
2017-11-15 19:30 ` Chris Wilson
[not found] ` <20171030145904.18584-1-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-11-02 12:26 ` [PATCH 1/2] dma-buf: keep only not signaled fence in reservation_object_add_shared_replace v2 Sumit Semwal
2017-11-06 16:18 ` Chris Wilson
-- strict thread matches above, loose matches on Subject: below --
2017-11-14 14:24 [PATCH 1/2] dma-buf: keep only not signaled fence in reservation_object_add_shared_replace v3 Christian König
[not found] ` <20171114142436.1360-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2017-11-14 14:24 ` [PATCH 2/2] dma-buf: try to replace a signaled fence in reservation_object_add_shared_inplace Christian König
2017-11-14 14:41 ` Chris Wilson
2017-10-31 8:43 [PATCH 1/2] dma-buf: keep only not signaled fence in reservation_object_add_shared_replace v2 Christian König
[not found] ` <20171031084306.1986-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2017-10-31 8:43 ` [PATCH 2/2] dma-buf: try to replace a signaled fence in reservation_object_add_shared_inplace Christian König
2017-10-31 8:41 [PATCH 1/2] dma-buf: keep only not signaled fence in reservation_object_add_shared_replace v2 Christian König
[not found] ` <20171031084137.1925-1-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-10-31 8:41 ` [PATCH 2/2] dma-buf: try to replace a signaled fence in reservation_object_add_shared_inplace Christian König
2017-10-24 13:55 [PATCH 1/2] dma-buf: keep only not signaled fence in reservation_object_add_shared_replace Christian König
2017-10-24 13:55 ` [PATCH 2/2] dma-buf: try to replace a signaled fence in reservation_object_add_shared_inplace Christian König
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=4fc05061-e92d-1702-a0f6-ee337b7d3eb3@gmail.com \
--to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=chris-Y6uKTt2uX1cEflXRtASbqLVCufUGDwFn@public.gmane.org \
--cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
--cc=dri-devel-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;
as well as URLs for NNTP newsgroup(s).