Re: [PATCH v4 1/6] rust_binder: avoid allocating under node_refs for freeze listeners
From: Alice Ryhl
Date: Fri Jul 17 2026 - 09:48:44 EST
On Fri, Jul 17, 2026 at 3:20 PM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Jul 07, 2026 at 10:28:51AM +0000, Alice Ryhl wrote:
> > The node_refs mutex needs to be changed to a spinlock, so in preparation
> > for that, update freeze.rs to avoid allocating under the node_refs lock.
> > This is done by adding a retry loop so that if add_freeze_listener()
> > requires reallocating the KVVec<_> of freeze listeners, the caller will
> > allocate a larger vector and retry.
> >
> > Analogously, the remove_freeze_listener() function is updated to return
> > the empty KVVec<_> when it is no longer needed, to avoid calling
> > kvfree() under the node_refs lock.
> >
> > Reviewed-by: Matthew Maurer <mmaurer@xxxxxxxxxx>
> > Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> > ---
> > drivers/android/binder/freeze.rs | 65 +++++++++++++++++++++++++++-------------
> > drivers/android/binder/node.rs | 41 +++++++++++++------------
> > 2 files changed, 64 insertions(+), 42 deletions(-)
> >
>
> This doesn't apply against my tree now, given all of the binder patches
> now added? Can you rebase against char-misc-testing and resend?
I believe this is already in char-misc-next as commit b9d17aa74ddd
("rust_binder: avoid allocating under node_refs for freeze
listeners").
Alice