summaryrefslogtreecommitdiff
path: root/drivers/android
diff options
context:
space:
mode:
authorAlice Ryhl <aliceryhl@google.com>2026-06-15 12:36:43 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-10 16:57:56 +0200
commit56c650167ea9627ba734e375bff1b68d2039b88a (patch)
tree0786aa644aebb7e3c3f4c9e6ddf667933edf3d9d /drivers/android
parent521eae8326a18cbf7fb4640dcfb2d1396423d1ab (diff)
downloadlwn-56c650167ea9627ba734e375bff1b68d2039b88a.tar.gz
lwn-56c650167ea9627ba734e375bff1b68d2039b88a.zip
rust_binder: schedule NodeDeath outside of node_refs lock
There's no reason to hold the node_refs lock while scheduling the NodeDeath to the thread todo list, so don't. The call to set_cleared() is kept under the lock so that the state update is kept atomic. 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-3-3235f5a3e0a0@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android')
-rw-r--r--drivers/android/binder/process.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs
index 73a2582c4d9c..7b214dc51586 100644
--- a/drivers/android/binder/process.rs
+++ b/drivers/android/binder/process.rs
@@ -1289,7 +1289,10 @@ impl Process {
// Update state and determine if we need to queue a work item. We only need to do it when
// the node is not dead or if the user already completed the death notification.
- if death.set_cleared(false) {
+ let should_schedule = death.set_cleared(false);
+ drop(refs);
+
+ if should_schedule {
if let Some(death) = ListArc::try_from_arc_or_drop(death) {
let _ = thread.push_work_if_looper(death);
}