Re: [PATCH v4 1/6] rust_binder: avoid allocating under node_refs for freeze listeners

From: Greg Kroah-Hartman

Date: Fri Jul 17 2026 - 10:36:52 EST


On Fri, Jul 17, 2026 at 03:48:07PM +0200, Alice Ryhl wrote:
> 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").

Ok, sorry about that.

I've now gone through all pending patches that I saw on my side for the
binder code. There were 2 that needs review from you:
https://lore.kernel.org/r/20260618121202.6258-1-iganschel@xxxxxxxxx
https://lore.kernel.org/r/20260616170956.2580772-1-georgeandrout13@xxxxxxxxx

and then there's the ratelimit patches outstanding too.

If I've missed anything else, please resend.

thanks,

greg k-h