From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (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 1A8C81F5822 for ; Thu, 27 Feb 2025 18:13:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740680029; cv=none; b=q+dfI53a3KfOHZu4O1QxOWm3I198kMgHiGPtdaxkg7tcNXMIrn6Ah9RkzFZDHGE/p/ociEjS1VYRlASXhgVdmPlXHMzZTT8I7RsqyZV2d6XeykgPcbiz1hTCeF1QnNTGpu3yhDbUneoVmNuDlAT7eKh+rzdNhFSkrxUxfNqfigQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740680029; c=relaxed/simple; bh=7imsQZUmHAdh0eNzgSer2Z0qckCWf9otlLGyNA+uz/0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iNpBBBjvRsa0eXq9ULyM84eofEBH4qjCQ/C8IoX7dSwg1ecP+P7V1eotJ/z5ozPjS9xkLBPuBEefCftQUE9Wnsmo/66iM4sNsmT89m6IFuUkKnnCvd4f/W4bAuXeTJFzFRjIQ/d/IkRFuSGfBPX7XHyWk6zQIBw1rhZ33wPBXPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=QY9aK830; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="QY9aK830" Date: Thu, 27 Feb 2025 13:13:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1740680026; h=from:from: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=SDLHKCyT2rrolHtXm3DioQqLj/OwZed4ywF3mGt1m3k=; b=QY9aK830EGCr7nXAJ0NuKY2XFe+53n+1RGSy8yoJZTVI4Luj+fJ+taJd7btgRmbXyZL4te hI/d3ZLOqaPfqN5mjpflbtlh22CRuqCfhrbozHppNADeEnpPqVay7VRrIpQtcvscjeWjGQ 51lejRUI4eKECiyqI5toQxZgZ9kpqVw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: "Paul E. McKenney" Cc: Steven Rostedt , Martin Uecker , Linus Torvalds , Ralf Jung , Alice Ryhl , Ventura Jack , 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: References: <5d7363b0-785c-4101-8047-27cb7afb0364@ralfj.de> <09e282a9c02fb07ba4fc248f14c0173d9b19179a.camel@tugraz.at> <2f5a537b895250c40676d122a08d31e23a575b81.camel@tugraz.at> <20250227092949.137a39e9@gandalf.local.home> <54b92e98-cabf-4ddc-b51b-496626ac3ccb@paulmck-laptop> Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54b92e98-cabf-4ddc-b51b-496626ac3ccb@paulmck-laptop> X-Migadu-Flow: FLOW_OUT On Thu, Feb 27, 2025 at 09:35:10AM -0800, Paul E. McKenney wrote: > On Thu, Feb 27, 2025 at 09:29:49AM -0500, Steven Rostedt wrote: > > On Thu, 27 Feb 2025 07:56:47 +0100 > > Martin Uecker wrote: > > > > > Observable is I/O and volatile accesses. These are things considered > > > observable from the outside of a process and the only things an > > > optimizer has to preserve.   > > > > > > Visibility is related to when stores are visible to other threads of > > > the same process. But this is just an internal concept to give > > > evaluation of expressions semantics in a multi-threaded  > > > program when objects are accessed from different threads. But  > > > the compiler is free to change any aspect of it, as  long as the  > > > observable behavior stays the same. > > > > > > In practice the difference is not so big for a traditional > > > optimizer that only has a limited local view and where > > > "another thread" is basically part of the "outside world". > > > > So basically you are saying that if the compiler has access to the entire > > program (sees the use cases for variables in all threads) that it can > > determine what is visible to other threads and what is not, and optimize > > accordingly? > > > > Like LTO in the kernel? > > LTO is a small step in that direction. In the most extreme case, the > compiler simply takes a quick glance at the code and the input data and > oracularly generates the output. > > Which is why my arguments against duplicating atomic loads have been > based on examples where doing so breaks basic arithmetic. :-/ Please tell me that wasn't something that seriously needed to be said...