Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Avoid synchronize_rcu() for every thread drop in Rust Binder
@ 2026-05-08  6:55 Alice Ryhl
  2026-05-08  6:55 ` [PATCH v3 1/2] rust: poll: use kfree_rcu() for PollCondVar Alice Ryhl
  2026-05-08  6:55 ` [PATCH v3 2/2] rust_binder: move (e)poll wait queue to Process Alice Ryhl
  0 siblings, 2 replies; 3+ messages in thread
From: Alice Ryhl @ 2026-05-08  6:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Carlos Llamas, Christian Brauner, Boqun Feng
  Cc: Paul E. McKenney, Alexander Viro, Jan Kara, Miguel Ojeda,
	Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Danilo Krummrich, Gary Guo, linux-fsdevel,
	rust-for-linux, linux-kernel, Alice Ryhl

Right now Rust Binder calls synchronize_rcu() more often than is
necessary. Most processes do not use epoll at all, so they don't require
rcu here. Back in Kangrejos I came up with a way to avoid this. Idea is
to move the value that needs rcu to a separate allocation that's easy to
kfree_rcu(). We pay the allocation only when the proc uses epoll using
an "upgrade" strategy - most processes don't.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Changes in v3:
- This series was almost entirely rewritten to use a different
  implementation strategy. By moving the PollCondVar to the process we
  can avoid the upgrade logic entirely.
- Link to v2: https://lore.kernel.org/r/20260213-upgrade-poll-v2-0-984a0fb184fb@google.com

Changes in v2:
- Change how Rust Binder handles the lock class key.
- Rebase.
- Link to v1: https://lore.kernel.org/r/20260117-upgrade-poll-v1-0-179437b7bd49@google.com

---
Alice Ryhl (2):
      rust: poll: use kfree_rcu() for PollCondVar
      rust_binder: move (e)poll wait queue to Process

 drivers/android/binder/process.rs     | 51 +++++++++++++++++------
 drivers/android/binder/thread.rs      | 78 +++++++++++++++++------------------
 drivers/android/binder/transaction.rs |  4 ++
 rust/kernel/sync/poll.rs              | 73 +++++++++++++++++++++++++++++++-
 4 files changed, 154 insertions(+), 52 deletions(-)
---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260117-upgrade-poll-37ee2a7a79dd

Best regards,
-- 
Alice Ryhl <aliceryhl@google.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-08  6:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08  6:55 [PATCH v3 0/2] Avoid synchronize_rcu() for every thread drop in Rust Binder Alice Ryhl
2026-05-08  6:55 ` [PATCH v3 1/2] rust: poll: use kfree_rcu() for PollCondVar Alice Ryhl
2026-05-08  6:55 ` [PATCH v3 2/2] rust_binder: move (e)poll wait queue to Process Alice Ryhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox