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

Alice Ryhl <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kernel
Message-ID <CAH5fLgjNm_aHLTE-XH=S+nukEW0o5MLe8Uih1nmn6io7e7fDZg@mail.gmail.com>
On Fri, Jul 17, 2026 at 3:20 PM Greg Kroah-Hartman
<[email protected]> 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 <[email protected]>
> > Signed-off-by: Alice Ryhl <[email protected]>
> > ---
> >  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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.