Re: [PATCH v3 5/5] rust_binder: use bitmap for allocation of handles
From: Carlos Llamas
Date: Fri Nov 07 2025 - 17:04:07 EST
On Tue, Oct 28, 2025 at 10:55:18AM +0000, Alice Ryhl wrote:
> To find an unused Binder handle, Rust Binder currently iterates the
> red/black tree from the beginning until it finds a gap in the keys. This
> is extremely slow.
>
> To improve the performance, add a bitmap that keeps track of which
> indices are actually in use. This allows us to quickly find an unused
> key in the red/black tree.
>
> This logic matches the approach used by C Binder. It was chosen
> partially because it's the most memory efficient solution.
>
> Reviewed-by: Burak Emir <bqe@xxxxxxxxxx>
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> ---
LGTM,
Acked-by: Carlos Llamas <cmllamas@xxxxxxxxxx>