diff options
| author | Alice Ryhl <aliceryhl@google.com> | 2026-06-15 12:36:44 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-10 16:57:56 +0200 |
| commit | 2812b20e165dbd9764d31d25686e305c7f329010 (patch) | |
| tree | 4684dbd13a1d4bb2970d57bc1929ed97d5cbcb10 /drivers/android | |
| parent | 56c650167ea9627ba734e375bff1b68d2039b88a (diff) | |
| download | lwn-2812b20e165dbd9764d31d25686e305c7f329010.tar.gz lwn-2812b20e165dbd9764d31d25686e305c7f329010.zip | |
rust_binder: keep NodeDeath in NodeRefInfo during process cleanup
By keeping the NodeDeath inside the NodeRefInfo structure during process
cleanup, we avoid running its destructor under the node_refs lock. It is
still dropped shortly thereafter when the entire rbtree holding the
NodeRefInfo objects is dropped, but that occurs outside of the lock.
Reviewed-by: Matthew Maurer <mmaurer@google.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260615-binder-noderefs-spin-v3-4-3235f5a3e0a0@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android')
| -rw-r--r-- | drivers/android/binder/process.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs index 7b214dc51586..7a45d478e33a 100644 --- a/drivers/android/binder/process.rs +++ b/drivers/android/binder/process.rs @@ -1375,13 +1375,11 @@ impl Process { // SAFETY: We are removing the `NodeRefInfo` from the right node. unsafe { info.node_ref2().node.remove_node_info(info) }; - // Remove all death notifications from the nodes (that belong to a different process). - let death = if let Some(existing) = info.death().take() { - existing - } else { - continue; - }; - death.set_cleared(false); + // Clear death notifications from the nodes (that belong to a different process). + // No need to remove them from `info` as we clear info below. + if let Some(death) = info.death().as_ref() { + death.set_cleared(false); + } } // Clean up freeze listeners. |
