Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=80.241.56.151 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796293575; b=Bo1A38pnzIpQDPSvta39OPUfEpvOOgSbPs2iN2abfbde6RfyQJ1s9wAxKr1T5/Y0wUVf Izz5tfU8RFBp3WtXfh62pgnDPYzX8FXVxGR1DSfRCw/alsDi/b3m1eOF6y4qauyAjh+FV 13utz77o/wz/8JkpSV9lAaVqcJgz+i+3fcu845XnpRcqAWzfwnfyl5YvXgZK4RItajP+w PHmIt8b/YA1DGWpUa1O/5GCpIqhZL9VmytuQUzFUOkKKn+ohyAtjf4QpkFffXHDIAk452 IqxB/53O9p7+I9o73mxM5oO3oKG9EjqlMN3pdPcLIk3LTP4HTWwkSEFA/kQmMZEecIg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796293575; h=DMARC-Filter:Received:DKIM-Signature:Message-ID:Subject:From: Reply-To:To:Cc:Date:In-Reply-To:References:Content-Type: Content-Transfer-Encoding:User-Agent:MIME-Version:X-MBO-RS-ID: X-MBO-RS-META; bh=M/4O09+KSgRA1yWqpMfrwKvVP1wT7+t+Pd9+LFXJgH0=; b=AnnlLdH8oEmloPYfBbXjAv/RQ+WCb5n9553eMWJ0QbZZvd1rs22Zo+DoBn3q0mAiUlky Q9Qv+bVJv5UPXcoKJap4IZ+CbQlD0/CC2VpgJesjEKwxvN8HQ3Fr+sAcm1cnm/ndSisJ7 NMVia4uqUqZgNTZfNOzCklFnXoSfOA91jLMPFAGAKHBxJ2KQPs+vWBnzsf9RyCpxqBwxG YtZ+/zqu+M0Y3/WajSabvo/6LVvcbjMFwvzguC/8pyIolcfQQDN+QAWMUW89LPoPwAxAS xaHzByllGRRRIBuvRBK16TdZzxaxylzdn6sihjiduTIRYkGIZrYFc6DApn84BYi30UA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=f9cldh1M; arc=none smtp.remote-ip=80.241.56.151 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (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 B0035606A322; Thu, 3 Dec 2026 10:26:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B0035606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=f9cldh1M Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4jg9l72fQbz8tx7; Thu, 03 Dec 2026 11:26:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1796293571; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M/4O09+KSgRA1yWqpMfrwKvVP1wT7+t+Pd9+LFXJgH0=; b=f9cldh1Mzl6VgO/Ba2rJBV2zPH8YSp6+5cZRPWZZhNai2n+NjIHr/eOwpXXH9gBmkXdiXP hGiBUe7U+hstNOxSOhbU4TD5CZVo1O9OmMyLTax3GuAKzRHOOygWpjd8xuUzA/KHkxFJD4 ZBOPDVrd2NsbBx8JnfWrI0ygtLFA7B5mxKRWORVHlYCve5xardgyzrTYmS9zpdP4+q+tCv o9Nz+rr2wiclioRN/3CvF9n1N0lE4hsEWnrLal4ADBiMtWg+jeC9Lv/Pt6bWSjtrdLuiKo t+ldNOXTY0VyCa/1/dJ4Kx9w7ryt0GXlKqU8uUjrD9jU+7O9GZkn0WpgksgjfQ== Message-ID: <0475e49c9ef2c122f784f2fd449eb48e731ba1ee.camel@mailbox.org> Subject: Re: [PATCH v3 1/9] rust: rcu: Add RcuState From: Philipp Stanner Reply-To: phasta@kernel.org To: Gary Guo , Philipp Stanner , Miguel Ojeda , Boqun Feng , =?ISO-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , Onur =?ISO-8859-1?Q?=D6zkan?= , Sumit Semwal , Christian =?ISO-8859-1?Q?K=F6nig?= , Matthew Brost , David Airlie , Simona Vetter , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Lyude Paul , "Joel Fernandes (NVIDIA)" , Boris Brezillon , Yuvan Shen Cc: rust-for-linux@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, rcu@vger.kernel.org Date: Thu, 03 Dec 2026 11:26:07 +0100 In-Reply-To: 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 User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MBO-RS-ID: 8a84d19cb304a0d38a5 X-MBO-RS-META: a1a8enoi6qi9perq9srfetcrsctxmeyy On Wed, 2026-12-02 at 17:06 +0000, Gary Guo wrote: > On Wed Dec 2, 2026 at 11:39 AM GMT, Philipp Stanner wrote: > > Currently, Rust's RCU abstractions only provide a full > > synchronize_rcu(). Many users, however, only want to wait for one grace > > period if a specific grace period has not already passed. > >=20 > > Add RcuState, an object identifying a grace period, and implement a > > method to conditionally synchronize for that grace period. > >=20 > > Signed-off-by: Philipp Stanner > > Suggested-by: Gary Guo >=20 > Please ensure `#[inline]` is added as Sashiko points out. >=20 > Acked-by: Gary Guo Thx for the Ack in this case inline is kind of non-controversial, but I still don't get what the inline-rules are for Rust. Sashiko-bro for example also wants this to be inline, which does not seem reasonable to me for status(): unsafe fn __status(&self) -> Result { // SAFETY: Safe by the function's safety requirements. let res =3D unsafe { (*self.as_raw()).error }; to_result(res) } /// Query a fence's status at the moment of the function call. /// /// If it is signaled, return the fence's result, i.e., determine if it= was /// signaled with an error. pub fn status(&self) -> Poll { // SAFETY: `self` is valid. if unsafe { bindings::dma_fence_is_signaled(self.as_raw()) } { // SAFETY: The fence is signaled. The C backend ensures orderin= g. let status =3D unsafe { self.__status() }; return Poll::Ready(status); } Poll::Pending } In C we spent years explaining to people that the compiler should decide what to inline, with only some exceptions. Yet for Rust we shall decide ourselves. Why?