From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: rcu: add RcuBox type Date: Thu, 04 Jun 2026 15:39:36 +1000 Message-ID: In-Reply-To: <20260530143541.229628-4-phasta@kernel.org> References: <20260530143541.229628-2-phasta@kernel.org> <20260530143541.229628-4-phasta@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Author: Alice Ryhl** Well-designed container. The `needs_drop::()` branching in `Drop` is a n= ice optimization =E2=80=94 using `kvfree_call_rcu` for trivially-droppable = types avoids an unnecessary callback indirection. The `ForeignOwnableRcu` t= rait extension is cleanly separated. A few observations: 1. **`Send + Sync` bound on `Send`/`Sync` impls**: The bounds require `T: S= end + Sync` for `RcuBox: Send`. The `Send` requirement comes from the st= ruct definition (`RcuBox`), and `Sync` is needed because the previ= ous owner may still read `&T` during an RCU grace period after transferring= ownership. The safety comment explains this well. 2. **Trailing `//` comments** again appear in the `use` block: ```rust use crate::{ bindings, types::{ ForeignOwnable, NotThreadSafe, // }, // }; ``` 3. **The `rcu_borrow` safety contract** could be more precise about what "p= lus one rcu grace period" means in practice: ```rust /// * If [`from_foreign`] is called, then `'a` must not end after the call = to `from_foreign` /// plus one rcu grace period. ``` This is correct but subtle =E2=80=94 it means callers must hold the RCU rea= d lock to ensure the grace period hasn't elapsed. No blocking issues. --- --- Generated by Claude Code Patch Reviewer