[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2kwOO9GOUF9DsJj@nvidia.com>
Date: Mon, 7 Nov 2022 12:20:08 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Oded Gabbay <ogabbay@...nel.org>
Cc: David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
John Hubbard <jhubbard@...dia.com>,
Alex Deucher <alexander.deucher@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Yuji Ishikawa <yuji2.ishikawa@...hiba.co.jp>,
Jiho Chu <jiho.chu@...sung.com>,
Daniel Stone <daniel@...ishbar.org>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
Jeffrey Hugo <quic_jhugo@...cinc.com>,
Christoph Hellwig <hch@...radead.org>,
Kevin Hilman <khilman@...libre.com>,
Jagan Teki <jagan@...rulasolutions.com>,
Jacek Lawrynowicz <jacek.lawrynowicz@...ux.intel.com>,
Maciej Kwapulinski <maciej.kwapulinski@...ux.intel.com>,
Stanislaw Gruszka <stanislaw.gruszka@...ux.intel.com>,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [RFC PATCH v3 0/3] new subsystem for compute accelerator devices
On Sun, Nov 06, 2022 at 11:02:22PM +0200, Oded Gabbay wrote:
> Another important change is that I have reverted back to use IDR for minor
> handling instead of xarray. This is because I have found that xarray doesn't
> handle well the scenario where you allocate a NULL entry and then exchange it
> with a real pointer. It appears xarray still considers that entry a "zero"
> entry. This is unfortunate because DRM works that way (first allocates a NULL
> entry and then replaces the entry with a real pointer).
This is what XA_ZERO_ENTRY is for.
Some APIs, like xa_alloc automatically promote NULL to XA_ZERO_ENTRY,
others require it to be explicit.
If you use the usual pattern of xa_alloc(NULL), xa_store(!NULL) then
you should be fine, as far as I know. So long as the xarray was tagged
as allocating.
Jason
Powered by blists - more mailing lists