Re: [PATCH] rust: binder: Use lower bound for node debug lookup

From: Alice Ryhl

Date: Mon Aug 31 2026 - 08:31:45 EST


On Mon, Aug 31, 2026 at 07:26:35AM +0200, nenkov2004@xxxxxxxxx wrote:
> From: ChrisX101010 <nenkov2004@xxxxxxxxx>
>
> The Binder node debug lookup currently walks the process node RBTree
> from the beginning until it finds the first node pointer greater than
> the requested pointer.
>
> Use RBTree::cursor_lower_bound() to start the lookup at the relevant
> tree position instead. When the lower-bound key is equal to the
> requested pointer, inspect the next node to preserve the existing
> strictly-greater-than semantics.
>
> This changes the tree lookup from a linear scan to an O(log n) search
> without changing the returned node semantics.
>
> Suggested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1249
> Signed-off-by: ChrisX101010 <nenkov2004@xxxxxxxxx>

This is a duplicate:

https://lore.kernel.org/all/20260814215145.2050599-1-rafael@xxxxxxxxxxx/