From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8F5611E1E01; Wed, 26 Feb 2025 21:55:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740606942; cv=none; b=P+NNNgY4foST94fuFRNPL5kKOlHqkGJbGUUWVOZDBsO/cU6ze1sLb1Ixado1iQj7NeAv+Bpdls9NlCEZf2lJuY33ffablZi/2WJCMS2rZEzt26+YLVovVBWtZoHGDULszXoIIaHDvfk0tyMPlB/p+qKS69s8ur+4uZFh3VB3V/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740606942; c=relaxed/simple; bh=AdC1eQ/rcm0w7OFs+Hk2SDojajEWDutq0tzUrs4cEKU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RnL5GC6fdiisVe04L3tsDxwrLK7VOqzKK4S+iPwuoPzNzNU1E4QUZViK6of2CPzNs7ctVw5uweguHdHbdpy1+cEwOEsbGXPXnyF/S8eF02AcmNvc3zBYCuEOUHPsxvPlE9vDHv204GvTY72kUlExV589nc3qDLLlCpmEtEDfPqk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04446C4CED6; Wed, 26 Feb 2025 21:55:38 +0000 (UTC) Date: Wed, 26 Feb 2025 16:56:19 -0500 From: Steven Rostedt To: Linus Torvalds Cc: Martin Uecker , Ralf Jung , "Paul E. McKenney" , Alice Ryhl , Ventura Jack , Kent Overstreet , Gary Guo , airlied@gmail.com, boqun.feng@gmail.com, david.laight.linux@gmail.com, ej@inai.de, gregkh@linuxfoundation.org, hch@infradead.org, hpa@zytor.com, ksummit@lists.linux.dev, linux-kernel@vger.kernel.org, miguel.ojeda.sandonis@gmail.com, rust-for-linux@vger.kernel.org Subject: Re: C aggregate passing (Rust kernel policy) Message-ID: <20250226165619.64998576@gandalf.local.home> In-Reply-To: References: <20250222141521.1fe24871@eugeo> <6pwjvkejyw2wjxobu6ffeyolkk2fppuuvyrzqpigchqzhclnhm@v5zhfpmirk2c> <5d7363b0-785c-4101-8047-27cb7afb0364@ralfj.de> <20250226162655.65ba4b51@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 26 Feb 2025 13:42:29 -0800 Linus Torvalds wrote: > On Wed, 26 Feb 2025 at 13:26, Steven Rostedt wrote: > > > > As a bystander here, I just want to ask, do you mean basically to treat all > > reads as READ_ONCE() and all writes as WRITE_ONCE()? > > Absolutely not. > > I thought I made that clear: Sorry, I didn't make myself clear. I shouldn't have said "all reads". What I meant was the the "initial read". Basically: r = READ_ONCE(*p); and use what 'r' is from then on. Where the compiler reads the source once and works with what it got. To keep it from changing: r = *p; if (r > 1000) goto out; x = r; to: if (*p > 1000) goto out; x = *p; -- Steve