On Tue, Jul 07, 2026 at 10:25:27PM +0900, Eliot Courtney wrote:
> On Fri Jul 3, 2026 at 7:31 PM JST, Greg KH wrote:
> > On Fri, Jul 03, 2026 at 07:16:06PM +0900, Eliot Courtney wrote:
> >> Add support for contiguous area allocation. Add a new type,
> >> `UnusedArea`, following the same pattern as `UnusedId`.
> >> 
> >> Signed-off-by: Eliot Courtney <[email protected]>
> >
> > Why isn't the built-in idr library being used here instead of rolling
> > your own data structure?
> >
> > thanks,
> >
> > greg k-h
> 
> For nova-core in this series, we need allocation of a contiguous
> sequence of IDs with a specific length and sometimes a specific
> alignment. IIUC, IDA/xarray do not support that (I checked
> ida_alloc_range and it only allocates a single ID in a range, not a
> contiguous sequence).
> 
> For IdPool before this series, I think it could have used IDA/xarray.
> See [1] where Alice has posted some more context.
> 
> w.r.t. the structure choice, the IDs we need to allocate are channel
> IDs, and the total range is limited to 2048 of them, so IMO bitmaps are
> a better fit than e.g. maple tree.

But again, you are having to "roll your own" logic here, please reuse
the data structures we already have in the kernel for this type of
thing.  If a maple tree works, please use it.

thanks,

greg k-h

Reply via email to