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

From: Greg Kroah-Hartman

Date: Thu Oct 01 2026 - 08:44:10 EST


On Mon, Aug 31, 2026 at 07:49:20AM +0200, nenkov2004@xxxxxxxxx wrote:
> From: Hristos Nenkov <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: Hristos Nenkov <nenkov2004@xxxxxxxxx>
> ---
> drivers/android/binder/process.rs | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)

This does not apply to the char-misc-testing branch :(