[Intel-gfx] [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-09-11 Thread Michał Winiarski
IDR is deprecated, and since XArray manages its own state with internal locking, it simplifies the locking on DRM side. Additionally, don't use the IRQ-safe variant, since operating on drm minor is not done in IRQ context. Signed-off-by: Michał Winiarski Suggested-by: Matthew Wilcox --- drivers

Re: [Intel-gfx] [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-10-31 Thread Jeffrey Hugo
On 9/11/2022 3:14 PM, Michał Winiarski wrote: IDR is deprecated, and since XArray manages its own state with internal locking, it simplifies the locking on DRM side. Additionally, don't use the IRQ-safe variant, since operating on drm minor is not done in IRQ context. Signed-off-by: Michał Winia

Re: [Intel-gfx] [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-11-04 Thread Oded Gabbay
On Mon, Sep 12, 2022 at 12:17 AM Michał Winiarski wrote: > > IDR is deprecated, and since XArray manages its own state with internal > locking, it simplifies the locking on DRM side. > Additionally, don't use the IRQ-safe variant, since operating on drm > minor is not done in IRQ context. > > Sign

Re: [Intel-gfx] [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-11-06 Thread Oded Gabbay
On Wed, Nov 2, 2022 at 4:23 PM Oded Gabbay wrote: > > On Mon, Sep 12, 2022 at 12:17 AM Michał Winiarski > wrote: > > > > IDR is deprecated, and since XArray manages its own state with internal > > locking, it simplifies the locking on DRM side. > > Additionally, don't use the IRQ-safe variant, si

Re: [Intel-gfx] [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-11-07 Thread Matthew Wilcox
On Sun, Nov 06, 2022 at 04:51:39PM +0200, Oded Gabbay wrote: > I tried executing the following code in a dummy driver I wrote: You don't need to write a dummy driver; you can write test-cases entirely in userspace. Just add them to lib/test_xarray.c and then make -C tools/testing/radix-tree/ > s

Re: [Intel-gfx] [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-11-07 Thread Michał Winiarski
On Sun, Nov 06, 2022 at 04:51:39PM +0200, Oded Gabbay wrote: > On Wed, Nov 2, 2022 at 4:23 PM Oded Gabbay wrote: > > > > On Mon, Sep 12, 2022 at 12:17 AM Michał Winiarski > > wrote: > > > > > > IDR is deprecated, and since XArray manages its own state with internal > > > locking, it simplifies th

Re: [Intel-gfx] [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-11-07 Thread Oded Gabbay
On Mon, Nov 7, 2022 at 6:20 PM Matthew Wilcox wrote: > > On Sun, Nov 06, 2022 at 04:51:39PM +0200, Oded Gabbay wrote: > > I tried executing the following code in a dummy driver I wrote: > > You don't need to write a dummy driver; you can write test-cases > entirely in userspace. Just add them to