From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Burak Emir" <burak.emir@gmail.com>
Cc: "Yury Norov" <ynorov@nvidia.com>,
"Eliot Courtney" <ecourtney@nvidia.com>,
"Alice Ryhl" <aliceryhl@google.com>,
"Yury Norov" <yury.norov@gmail.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Onur Özkan" <work@onurozkan.dev>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"John Hubbard" <jhubbard@nvidia.com>,
"Alistair Popple" <apopple@nvidia.com>,
"Timur Tabi" <ttabi@nvidia.com>, "Zhi Wang" <zhiw@nvidia.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v9 8/9] rust: id_pool: do not round capacity up to BitmapVec::MAX_INLINE_LEN
Date: Thu, 15 Oct 2026 22:30:56 +0900 [thread overview]
Message-ID: <DM5G660SFQ0S.QNZ3KFM5I1WF@nvidia.com> (raw)
In-Reply-To: <CABwQupOYBBev5WkQry3oOoX5tGCs-ggDE4L_nK8BBYvrO=81bA@mail.gmail.com>
Hi Burak!
On Wed Oct 14, 2026 at 4:20 PM JST, Burak Emir wrote:
<...>
>> >
>> > Do the other patches in this series need this, or can we just drop this patch?
>> > If they do, maybe a demonstration of how significant the special-case
>> > handling is that can be avoided with the exact small capacity could be
>> > part of the commit message?
>>
>> The next patch in this series needs this to implement `ChannelIdPool`.
>> The alternative would be to track the actual length of the pool and
>> return an error if `IdPool` returns an ID after that value, which is
>> what v5 [1] was doing (see `num_chids` in the v5 code).
>>
>> That's the special-case handling that this patch is designed to avoid,
>> and I hope we can agree that it isn't a satisfying workaround,
>> especially when the backing `BitmapVec` *does* support exact sizes and
>> that artificial limitation is introduced by `IdPool` itself.
>>
>> [1] https://lore.kernel.org/all/20260812-chid-v5-5-6c767770b3f4@nvidia.com/
>
> Thanks for the link.
> To me, having IdPool support exact size seems nice-to-have.
>
> We are changing the design in light of different requirements, it is a
> defensible but not critical generalization.
> I was worried that we may need to have proper separate length and
> capacity fields (which contradicts the binder use case), but that is
> not the case.
>
> I checked the grow_request and grow dance now, it seems that even with
> exact small sizes we avoid allocating a bitmap.
> So I am not opposed. Like Yury, I find the 0 case slightly odd, but
> unlike Yury, I find that tolerable.
>
> The phrasing as "dropping an artificial limitation" does not
> adequately reflect that IdPool was done for a specific use case where
> the design made sense and is not actually a limitation.
>
> I wanted to highlight this perspective, because notwithstanding the
> name, IdPool was not meant to join the set of kernel's dedicated
> supported ID allocation mechanisms.
Given its name and location, I guess it was inevitable. :) But thanks
for clarifying its history, that helps understand the current design.
This also means we have two different use styles for this now:
- The binder style, where the pool grows as needed and we don't care
about its exact size,
- The Nova (and likely others in the future) style, where we manage a
set of finite resources that is not supposed to grow.
Which is what this patch tried to prepare for. Does it look acceptable
to you? I think we still want to merge it or something close to it.
next prev parent reply other threads:[~2026-10-15 13:31 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 2:42 [PATCH v9 0/9] rust: Add support for reserving of ranges of IDs Eliot Courtney
2026-09-30 2:42 ` [PATCH v9 1/9] rust: bitmap: use function-level cfg on kunit test Eliot Courtney
2026-09-30 2:42 ` [PATCH v9 2/9] rust: bitmap: restrict bitmap length to at most i32::MAX Eliot Courtney
2026-09-30 2:42 ` [PATCH v9 3/9] rust: sizes: add sub-1K size constants Eliot Courtney
2026-09-30 9:12 ` Miguel Ojeda
2026-09-30 11:04 ` Alexandre Courbot
2026-09-30 11:22 ` Miguel Ojeda
2026-10-01 0:40 ` Gary Guo
2026-10-01 5:23 ` Eliot Courtney
2026-09-30 2:42 ` [PATCH v9 4/9] rust: sizes: implement SizeConstants for Alignment Eliot Courtney
2026-09-30 9:12 ` Miguel Ojeda
2026-09-30 2:42 ` [PATCH v9 5/9] rust: use Alignment size constants Eliot Courtney
2026-09-30 2:42 ` [PATCH v9 6/9] rust: bitmap: add contiguous area operations Eliot Courtney
2026-09-30 4:41 ` Yury Norov
2026-09-30 2:42 ` [PATCH v9 7/9] rust: id_pool: add contiguous ID reservation Eliot Courtney
2026-09-30 2:51 ` sashiko-bot
2026-09-30 4:50 ` Yury Norov
2026-09-30 2:42 ` [PATCH v9 8/9] rust: id_pool: do not round capacity up to BitmapVec::MAX_INLINE_LEN Eliot Courtney
2026-09-30 2:52 ` sashiko-bot
2026-09-30 5:05 ` Yury Norov
2026-10-01 6:20 ` Alexandre Courbot
2026-10-08 15:47 ` Yury Norov
2026-10-08 16:04 ` Gary Guo
2026-10-09 14:07 ` Alexandre Courbot
2026-10-09 18:48 ` Burak Emir
2026-10-14 2:04 ` Alexandre Courbot
2026-10-14 7:20 ` Burak Emir
2026-10-15 13:30 ` Alexandre Courbot [this message]
2026-10-15 14:00 ` Yury Norov
2026-09-30 2:42 ` [PATCH v9 9/9] gpu: nova-core: add ChannelIdPool Eliot Courtney
2026-10-08 15:04 ` [PATCH v9 0/9] rust: Add support for reserving of ranges of IDs Alexandre Courbot
2026-10-11 9:15 ` Miguel Ojeda
2026-10-13 13:26 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM5G660SFQ0S.QNZ3KFM5I1WF@nvidia.com \
--to=acourbot@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=burak.emir@gmail.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ecourtney@nvidia.com \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=nova-gpu@lists.linux.dev \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=ttabi@nvidia.com \
--cc=work@onurozkan.dev \
--cc=ynorov@nvidia.com \
--cc=yury.norov@gmail.com \
--cc=zhiw@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.