All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] Rate limited printing for Rust
@ 2026-07-28  9:32 Alice Ryhl
  2026-07-28  9:32 ` [PATCH v4 1/5] rust: sync: move lockdep types to rust/kernel/sync/lockdep.rs Alice Ryhl
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Alice Ryhl @ 2026-07-28  9:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Carlos Llamas, Boqun Feng, Gary Guo
  Cc: Onur Özkan, Andreas Hindborg, Benno Lossin,
	Björn Roy Baron, Daniel Almeida, Danilo Krummrich,
	Ingo Molnar, Lyude Paul, Miguel Ojeda, Peter Zijlstra,
	Trevor Gross, Waiman Long, Will Deacon, linux-kernel,
	rust-for-linux, Alice Ryhl, Alvin Sun

To avoid DoS on the kernel log, the Rust Binder driver is being switched
to rate limited printing. But before we can do that, we must first
implement rate limited printing for Rust. Thus, do that.

However, it turns out that before we can implement rate limited
printing, we must first implement the ability declare a raw_spinlock_t
in a global variable. Thus, do that too.

Based on top of char-misc-next plus this patch:
https://lore.kernel.org/all/20260728061236.198267-1-aliceryhl@google.com/

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Changes in v4:
- Rebase series.
- Mark Ratelimit::new_static() with #[inline]
- Link to v3: https://lore.kernel.org/r/20260722-pr-ratelimited-v3-0-57faa37fdfbd@google.com

Changes in v3:
- Rebase on char-misc-testing.
- Add rust/kernel/sync/lockdep.rs to MAINTAINERS file.
- Link to v2: https://lore.kernel.org/r/20260716-pr-ratelimited-v2-0-31c27a4543d2@google.com

Changes in v2:
- Rebase on top of binder_debug! patch series.
  - As a consequence, the logic for printing the size of transaction
    failures is changed to print the size of each piece of the
    transaction, rather than the total buffer size.
- Add doc aliases for raw_spin_lock_unlocked.
- Make raw_spin_lock_unlocked and raw_lockdep_map private.
- Add Ratelimit::new_static.
- Add some missing links to docs.
- Link to v1: https://lore.kernel.org/r/20260623-pr-ratelimited-v1-0-cc922f544dc0@google.com

---
Alice Ryhl (5):
      rust: sync: move lockdep types to rust/kernel/sync/lockdep.rs
      rust: sync: add const constructor for raw_spinlock_t
      rust: add pr_*_ratelimit! macros for printing
      rust_binder: consolidate transaction failure prints
      rust_binder: use pr_*_ratelimited! for printing

 MAINTAINERS                           |   1 +
 drivers/android/binder/allocation.rs  |   4 +-
 drivers/android/binder/context.rs     |   6 +-
 drivers/android/binder/debug.rs       |   4 +-
 drivers/android/binder/error.rs       |   4 -
 drivers/android/binder/freeze.rs      |   2 +-
 drivers/android/binder/node.rs        |   4 +-
 drivers/android/binder/page_range.rs  |  12 +-
 drivers/android/binder/process.rs     |  22 ++--
 drivers/android/binder/thread.rs      | 119 +++++++++----------
 drivers/android/binder/transaction.rs |  24 +---
 include/linux/spinlock_types_raw.h    |   4 +
 rust/bindings/lib.rs                  |  24 ++++
 rust/helpers/helpers.c                |   1 +
 rust/helpers/ratelimit.c              |  14 +++
 rust/kernel/error.rs                  |   2 +-
 rust/kernel/lib.rs                    |   1 +
 rust/kernel/prelude.rs                |   8 ++
 rust/kernel/ratelimit.rs              | 216 ++++++++++++++++++++++++++++++++++
 rust/kernel/sync.rs                   | 135 +--------------------
 rust/kernel/sync/lock/spinlock.rs     |  30 +++++
 rust/kernel/sync/lockdep.rs           | 161 +++++++++++++++++++++++++
 22 files changed, 553 insertions(+), 245 deletions(-)
---
base-commit: c6ad4d0943523437ae5b42dc24865fc2643d1260
change-id: 20260619-pr-ratelimited-6e20fa89bd5b

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


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

end of thread, other threads:[~2026-07-31 12:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28  9:32 [PATCH v4 0/5] Rate limited printing for Rust Alice Ryhl
2026-07-28  9:32 ` [PATCH v4 1/5] rust: sync: move lockdep types to rust/kernel/sync/lockdep.rs Alice Ryhl
2026-07-28  9:32 ` [PATCH v4 2/5] rust: sync: add const constructor for raw_spinlock_t Alice Ryhl
2026-07-28  9:32 ` [PATCH v4 3/5] rust: add pr_*_ratelimit! macros for printing Alice Ryhl
2026-07-28  9:32 ` [PATCH v4 4/5] rust_binder: consolidate transaction failure prints Alice Ryhl
2026-07-28 17:10   ` Carlos Llamas
2026-07-28  9:32 ` [PATCH v4 5/5] rust_binder: use pr_*_ratelimited! for printing Alice Ryhl
2026-07-31  9:06 ` [PATCH v4 0/5] Rate limited printing for Rust Greg Kroah-Hartman
2026-07-31 11:34   ` Miguel Ojeda
2026-07-31 12:19     ` Alice Ryhl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.