From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46098253359 for ; Sat, 5 Jul 2025 07:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751698901; cv=none; b=myjwIXthH0KUG8NGs7L1OqkciSaOYoVI44uvrxaGqBzDnoiAhqXN+i6kyjK7tWVIq4cK0FCN7Q5ZZRVFCi+vVCyuM3Zb6DrdEy+wOBE0QCIdCSg4oYtVoO1wF50lyJ0bLyUF7UM1ez6+c/uAKPxwioPD6OL7qSde333OCE/o8hs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751698901; c=relaxed/simple; bh=Idmu/dCAYI+cgqBEYepV+Mv0IJ2ByJnr314LV8QmSKk=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=t0eysf8NSKFqe1t0IlLHI4rHnyX7jxICsOUPBwuytDwXAtBb43x+W5OZKs7oT/bbSvH4iap1kbD1SLH+V36z+MRdRUjmW8g1cskUOn0zgRRisfsbJ29YFet5MBU+VfrvcdS4+6Zfot8Wdvx+7ALOR3IUyOP/GTi442cbB1tWUAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ot5FtxDd; arc=none smtp.client-ip=140.211.166.133 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ot5FtxDd" Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C1EBF403C8 for ; Sat, 5 Jul 2025 07:01:38 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.101 X-Spam-Level: Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 0Iubz4wps_qB for ; Sat, 5 Jul 2025 07:01:38 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=lossin@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 231F040086 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 231F040086 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Ot5FtxDd Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by smtp2.osuosl.org (Postfix) with ESMTPS id 231F040086 for ; Sat, 5 Jul 2025 07:01:37 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 94FB2445A5; Sat, 5 Jul 2025 07:01:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8D1DC4CEE7; Sat, 5 Jul 2025 07:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751698897; bh=Idmu/dCAYI+cgqBEYepV+Mv0IJ2ByJnr314LV8QmSKk=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=Ot5FtxDd/DzDG+uyjUTdveMYO13QXkaaamkCO+pyezWTNJXS7NJVaY6jt/fDXh3BI yrvzzzNAO9Zj/yTXLmdAhrN48kcAvAOeuXiQ/eWpYmTGyArutMm0zRtAwTYiAv6OX5 jWQmMWBQhnAcDw6k2lpRTzFL9lkUHyqlVu7nGOlxIYFHW7mOSFTyjz82nsVI88x8l8 qcNuHgA8x/bcvuWHnj3Ck2+Sy3zdFO2TPPizEYNHLn5Q3iGgttXYDG17e75IfLLKk6 NeFShxy/bVLLaiy7Gs+V8aMJ+b+vzRiWXLnbgQpjVHG+s6Sb7Xxpvg4j693n76fk4k EMg2seiqYVyOw== Precedence: bulk X-Mailing-List: linux-kernel-mentees@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 05 Jul 2025 09:01:33 +0200 Message-Id: Cc: , , , , , , <~lkcamp/patches@lists.sr.ht> Subject: Re: [PATCH v5 0/2] rust: revocable: documentation and refactorings From: "Benno Lossin" To: "Marcelo Moreira" X-Mailer: aerc 0.20.1 References: <20250626165927.66498-1-marcelomoreira1905@gmail.com> In-Reply-To: On Sat Jul 5, 2025 at 7:09 AM CEST, Marcelo Moreira wrote: > Em qui., 3 de jul. de 2025 =C3=A0s 05:24, Benno Lossin escreveu: >> >> On Thu Jun 26, 2025 at 6:59 PM CEST, Marcelo Moreira wrote: >> > This patch series brings documentation and refactorings to the `Revoca= ble` type. >> > >> > Changes include: >> > - Clarifying the write invariant and updating associated safety commen= ts for `Revocable`. >> > - Splitting the internal `revoke_internal` function into two distinct,= explicit functions: `revoke()` (safe, synchronizing with RCU) and `revoke_= nosync()` (unsafe, without RCU synchronization), now returning `bool` to in= dicate revocation status. >> >> Could you wrap your text to a more readable column? Thanks! > > Sure! Thanks! > >> >> > >> > Marcelo Moreira (2): >> > rust: revocable: Refactor revocation mechanism to remove generic >> > revoke_internal >> > rust: revocable: Clarify write invariant and update safety comments >> > >> > Changelog >> > --------- >> > >> > Changes since v4: >> > - Rebased the series onto the latest `rfl/rust-next` to integrate rece= nt changes, specifically the `bool` return for `revoke()` and `revoke_nosyn= c()`. >> > - Dropped the "rust: revocable: simplify RevocableGuard for internal s= afety" patch, as the approach of using a direct reference (`&'a T`) for `Re= vocableGuard` was found to be unsound due to Rust's aliasing rules and LLVM= 's `dereferencable` attribute guarantees, which require references to remai= n valid for the entire function call duration, even if the internal RCU gua= rd is dropped earlier. >> > - Refined the `PinnedDrop::drop` `SAFETY` comment based on Benno Lossi= n's and Miguel Ojeda's feedback, adopting a more concise and standard Kerne= l-style bullet point format. >> > - Corrected a duplicated line in the commit message of the second patc= h. >> >> Now since we had to drop the `RevocableGuard` change, its safety >> invariant & comment in `deref` is insufficient. It shouldn't have the >> invariant that the rcu lock is held (since it owns an `rcu::Guard`, that >> already is guaranteed), but instead it should require that the >> `data_ref` pointer is valid. That invariant is then used by the safety >> comment in `deref` to justify dereferencing the pointer. >> >> Also, I think it's better to reorder the patches again (since the >> current first one relies on changes from the second one), the first one >> should be the change to the invariants section of `Revocable` (so >> currently the second patch). Then the second and third patches can be >> the removal of `revoke_internal` and the `RevocableGuard` safety >> documentation fix. > > All right Benno, I'll prepare the comment for `RevocableGuard` and send v= 6. > > The order now is: > 1- Documentation for invariant and updates associated `SAFETY` comments > 2- Remove `revoke_internal` (Refactoring) > 3- `RevocableGuard` safety documentation fix. Sounds good! --- Cheers, Benno