[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3bb02ec3-4d19-9135-cabc-26ed210f7396@redhat.com>
Date: Mon, 20 Feb 2023 15:00:59 +0100
From: Danilo Krummrich <dakr@...hat.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: matthew.brost@...el.com, dri-devel@...ts.freedesktop.org,
corbet@....net, nouveau@...ts.freedesktop.org, ogabbay@...nel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, boris.brezillon@...labora.com,
bskeggs@...hat.com, tzimmermann@...e.de, Liam.Howlett@...cle.com,
bagasdotme@...il.com, christian.koenig@....com,
jason@...kstrand.net
Subject: Re: [PATCH drm-next v2 04/16] maple_tree: add flag MT_FLAGS_LOCK_NONE
On 2/17/23 20:38, Matthew Wilcox wrote:
> On Fri, Feb 17, 2023 at 02:44:10PM +0100, Danilo Krummrich wrote:
>> Generic components making use of the maple tree (such as the
>> DRM GPUVA Manager) delegate the responsibility of ensuring mutual
>> exclusion to their users.
>>
>> While such components could inherit the concept of an external lock,
>> some users might just serialize the access to the component and hence to
>> the internal maple tree.
>>
>> In order to allow such use cases, add a new flag MT_FLAGS_LOCK_NONE to
>> indicate not to do any internal lockdep checks.
>
> I'm really against this change.
>
> First, we really should check that users have their locking right.
> It's bitten us so many times when they get it wrong.
In case of the DRM GPUVA manager, some users might serialize the access
to the GPUVA manager and hence to it's maple tree instances, e.g.
through the drm_gpu_scheduler. In such a case ensuring to hold a lock
would be a bit pointless and I wouldn't really know how to "sell" this
to potential users of the GPUVA manager.
>
> Second, having a lock allows us to defragment the slab cache. The
> patches to do that haven't gone anywhere recently, but if we drop the
> requirement now, we'll never be able to compact ranges of memory that
> have slabs allocated to them.
>
Not sure if I get that, do you mind explaining a bit how this would
affect other users of the maple tree, such as my use case, the GPUVA
manager?
Powered by blists - more mailing lists