[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YpTePTj6rrHYN0QT@google.com>
Date: Tue, 31 May 2022 00:09:49 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Christian König <christian.koenig@....com>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Sumit Semwal <sumit.semwal@...aro.org>,
Gustavo Padovan <gustavo@...ovan.org>,
Tomasz Figa <tfiga@...omium.org>,
Ricardo Ribalda <ribalda@...omium.org>,
Christoph Hellwig <hch@...radead.org>,
linux-media@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linaro-mm-sig@...ts.linaro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma-fence: allow dma fence to have their own lock
Hi Christian,
On (22/05/30 16:55), Christian König wrote:
> Hi Sergey,
>
> I'm removing most of the mail because you have a very fundamental
> misunderstanding about what this dma_fence lock is all about.
Happy to learn.
> Am 30.05.22 um 16:22 schrieb Sergey Senozhatsky:
> > [SNIP]
> > So the `lock` should have at least same lifespan as the DMA fence
> > that borrows it, which is impossible to guarantee in our case.
>
> Nope, that's not correct. The lock should have at least same lifespan as the
> context of the DMA fence.
In our case we have one context and it lives as long as the module is loaded.
Does this mean that all DMA fences within that context should be serialized
by a single spinlock? We can have a number of "active" fences so the lock
can become a bit congested. But each operation creates, exports and signals
just once fence.
> The idea here is that DMA fence signaling and callback calling serializes.
> E.g. when you have fence a,b,c,d... they must signal in the order a,b,c,d...
> and that's what this lock is good for.
Hmm, OK. So that borrowed ->lock is in fact something like
context_lock_irqsave() and context_unlock_irqrestore().
> If you just want to create a single dma_fence which is also only bound to a
> single context you can embed the lock into the fence without much problem.
Aha, I guess this is what we need then. I'll take a look. Thanks.
Powered by blists - more mailing lists