From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89234606A31A for ; Wed, 2 Dec 2026 11:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=E8leW0B1 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F08C010E045; Wed, 2 Dec 2026 11:47:14 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5DA7310E045 for ; Wed, 2 Dec 2026 11:47:08 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id A616462799; Wed, 2 Dec 2026 11:47:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26EC41F00931; Wed, 2 Dec 2026 11:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796212027; bh=Z3YrG+sXF5VggsPAutsCJTrQG4Di4fxqjw8ZYO1rZaM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=E8leW0B1ePTQ5NRQJUS6ciEXspHbNJJEHa2Es7h4sVfeQvScTOl9q/wBQHIdTHAJC 34He3kmKTxNgXe0Hc1FrPshlIP8xp6JSIGesWqESPn6vPTFZnD1F225in772CwrgnW ys1LEh3eSCh3YTWrnFMOiq9ibMYvLmkxED1OT2rMQV9gU/00q+MUmIXVm2+RUZ5WWZ lawRQ1i31nnH4c0lx+m5ylZZFicQuIv0zCU7RPdppKrU27TdIIP+6TETt5xWOVOGEL cRXs2slMBLXO/qFAEQzEBsDM8j0dD16NdvQZFgj43rqZnNeyfe09OjcCdM9SwbjM0W Fd9y671q52pgg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 1/9] rust: rcu: Add RcuState To: "Philipp Stanner" Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org, ojeda@kernel.org, gary@garyguo.net In-Reply-To: <20261202113914.1660411-3-phasta@kernel.org> References: <20261202113914.1660411-2-phasta@kernel.org> <20261202113914.1660411-3-phasta@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 11:47:06 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] rust: rcu: missing #[inline] on RcuState::new() and cond_synchronize() -- commit 9b80e8ce3d2823d6c857be2691481f7b6e1c7968 Author: Philipp Stanner rust: rcu: Add RcuState This commit adds RcuState to record an RCU grace period cookie via get_state_synchronize_rcu() and conditionally wait for that grace period via cond_synchronize_rcu(). > diff --git a/rust/kernel/sync/rcu.rs b/rust/kernel/sync/rcu.rs > index 0daa1ac87d818..7cb5a7d31e57d 100644 > --- a/rust/kernel/sync/rcu.rs > +++ b/rust/kernel/sync/rcu.rs > @@ -86,3 +86,38 @@ pub fn synchronize_rcu() { > // SAFETY: `synchronize_rcu()` is always safe to be called from proc= ess context. > unsafe { bindings::synchronize_rcu() }; > } > + > +/// An RCU grace period snapshot. > +/// > +/// Useful for waiting for said grace period if necessary. If you just d= rop this > +/// object, nothing happens. > +#[derive(Copy, Clone)] > +pub struct RcuState(usize); > + > +impl RcuState { > + /// Create a new RcuState. It stores an identifier of the current gr= ace > + /// period so that you can later water on it. > + pub fn new() -> Self { > + // SAFETY: `get_state_synchronize_rcu()` is always safe to be ca= lled. > + let cookie: usize =3D unsafe { bindings::get_state_synchronize_r= cu() }; > + > + Self(cookie) > + } > + > + /// Make sure that a full RCU grace period has passed since this Rcu= State > + /// was created. > + /// > + /// Executes a [`synchronize_rcu()`] if that's not the case. Thus, y= ou must > + /// not call this in atomic context. > + pub fn cond_synchronize(self) { > + // SAFETY: This is the right cookie. The function runs in proces= s context. > + unsafe { bindings::cond_synchronize_rcu(self.0) }; > + } > +} [Severity: Low] Should RcuState::new() and RcuState::cond_synchronize() be marked #[inline] like the other C binding wrappers in this module so callers in other crates can inline them? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202113914.1660= 411-2-phasta@kernel.org?part=3D1