[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DB29Y9LUF90V.90X56SDRG8LN@kernel.org>
Date: Thu, 03 Jul 2025 10:24:47 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Marcelo Moreira" <marcelomoreira1905@...il.com>,
<rust-for-linux@...r.kernel.org>
Cc: <linux-kernel@...r.kernel.org>, <dakr@...nel.org>, <ojeda@...nel.org>,
<skhan@...uxfoundation.org>,
<linux-kernel-mentees@...ts.linuxfoundation.org>,
<~lkcamp/patches@...ts.sr.ht>
Subject: Re: [PATCH v5 1/2] rust: revocable: Refactor revocation mechanism
to remove generic revoke_internal
On Thu Jun 26, 2025 at 6:59 PM CEST, Marcelo Moreira wrote:
> The revocation mechanism is refactored by removing the generic
> `revoke_internal` function. Its logic is now directly integrated into
> two distinct public functions: `revoke()` and `revoke_nosync()`.
>
> `revoke_nosync()` is an `unsafe` function that requires the caller to
> guarantee no concurrent users, thus avoiding an RCU grace period.
> `revoke()` is a safe function that internally waits for the RCU grace
> period to ensure all concurrent accesses have completed before dropping
> the wrapped object.
>
> This change improves API clarity and simplifies associated `SAFETY`
> comments by making the synchronization behavior explicit in the function
> signatures.
>
> Suggested-by: Benno Lossin <lossin@...nel.org>
> Suggested-by: Danilo Krummrich <dakr@...nel.org>
> Signed-off-by: Marcelo Moreira <marcelomoreira1905@...il.com>
With the patch order changed:
Reviewed-by: Benno Lossin <lossin@...nel.org>
---
Cheer,
Benno
> ---
> rust/kernel/revocable.rs | 48 ++++++++++++++++++----------------------
> 1 file changed, 21 insertions(+), 27 deletions(-)
Powered by blists - more mailing lists