Re: [PATCH v5 5/5] gpu: nova-core: add ChannelIdPool
From: Eliot Courtney
Date: Mon Aug 17 2026 - 07:49:33 EST
On Mon Aug 17, 2026 at 8:18 PM JST, Danilo Krummrich wrote:
> On Mon Aug 17, 2026 at 12:54 PM CEST, Gary Guo wrote:
>> IMO we can just support zero-sized allocation by always succeeding, similar to
>> how ZST allocation is handled in memory allocation.
>
> Probably, but in contrast to ZST allocations it wouldn't be very useful, so we'd
> silently succeed on something that never was a reasonable argument in the first
> palce.
Yeah I agree that supporting a generalised zero sized alloc is in some
ways conceptually nicer, but I also can't see any good reason why you
would want to do it, it sounds like a bug. That's also why in the latest
version I made IdPool also not allow a zero capacity [1] (incidentally
required to not have to change the grow code to avoid trying to double a
zero capacity thing every time).
Tbh, I feel that NonZero (and Alignment) is hard to use currently
because of these ergonomics issues. But I reckon they're useful, so I
like the idea of trying to making them easier to use. Maybe you can make
an argument to not use NonZero here, but what about all the other times
we will want to use it?
[1]: https://lore.kernel.org/all/20260817-chid-v7-6-a5872e64d8f4@xxxxxxxxxx/