From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F04CC67861 for ; Tue, 9 Apr 2024 04:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5Qq4kZorJi/BnZgBdLZ3L8PhGCC/xoJKe4QsxUne9Lw=; b=0FAAY0QmC/Xyny ohGTEyMpfZxLCFtrOhGmM3en+DoUcfGBexgv4L3IWxVaT90ylJYmUncCTRXnTDs1xdfRtWqS16cFf kTOeMJmqPU1IqD+4isWwYA/Gt8Qv1MMpA810YDVfCcsQglmW84CL2fU8niZUfwZdKTWKqlpy5FNqn 99P1W2yEjrUnmt3IYer6vN8CFU0R9kmtw7emOo4Q4GvdsDRYTxSisr/ILCbBCofoBu38r/jf/sRye oOklwk21KLCzSuLuN+e0prA0mMWsLbNhvYCbhghLeYFQb9U9/yPX6qUk4eBXoaQXMA9LRZpjhDhBA b8Xen14cFXdRTQKXAEcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru3O3-00000000L49-1DN7; Tue, 09 Apr 2024 04:47:11 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru3O0-00000000L2Q-23Hy for linux-arm-kernel@lists.infradead.org; Tue, 09 Apr 2024 04:47:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id DE480CE1CE4; Tue, 9 Apr 2024 04:47:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A1ABC433F1; Tue, 9 Apr 2024 04:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712638025; bh=/wRns2YHr/e81UAE5ln2nftiOF08Py5b8V2ul1ELJLo=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=X1TuIwKIKFgH28lx1aWSzHSc/l9q/5WsShWTyf1COXe+KH8o5qkJx/+4l/MZAGdp5 tY3Ii6O3xstLwGlLDwl0ILyJ7iLmlhqJpVaf9zwMAbt2nTNVKmLFa7ltyTVmS1NTjZ tGQeJYyeNoqkSiziXYMahy4CWp65HxqT8GXv8eYg5hxNH7UTpcJlX4wLvi5xJ22Ds+ gB4OedgEhtiGv0uIRIAN1xSU0atqatc0m59MImyALJFnXLBTf2f8uK3EZb/RfJs8NM /sxh6FUkFe9z/bUfWj9DDmpuNCe2M5nqp4kqYkxUFErlAYmYmP2tP3htmQfirFktDf Og+X9lFiXyI0g== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B751ACE12F2; Mon, 8 Apr 2024 21:47:04 -0700 (PDT) Date: Mon, 8 Apr 2024 21:47:04 -0700 From: "Paul E. McKenney" To: Kent Overstreet Cc: Matthew Wilcox , Linus Torvalds , Philipp Stanner , Boqun Feng , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, llvm@lists.linux.dev, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig , Joel Fernandes , Nathan Chancellor , Nick Desaulniers , kent.overstreet@gmail.com, Greg Kroah-Hartman , elver@google.com, Mark Rutland , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [WIP 0/3] Memory model and atomic API in Rust Message-ID: <6fa87fef-5676-4a26-86d9-45eca6ebd798@paulmck-laptop> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240408_214708_949372_7E7795ED X-CRM114-Status: GOOD ( 21.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: paulmck@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 08, 2024 at 08:58:18PM -0400, Kent Overstreet wrote: > On Mon, Apr 08, 2024 at 06:03:11PM +0100, Matthew Wilcox wrote: > > On Mon, Apr 08, 2024 at 09:55:23AM -0700, Paul E. McKenney wrote: > > > On Mon, Apr 08, 2024 at 05:02:37PM +0100, Matthew Wilcox wrote: > > > > In my ideal world, the compiler would turn this into: > > > > > > > > newfolio->flags |= folio->flags & MIGRATE_MASK; > > > > > > Why not accumulate the changes in a mask, and then apply the mask the > > > one time? (In situations where __folio_set_foo() need not apply.) > > > > But it irks me that we can't tell the compiler this is a safe > > transformation for it to make. There are a number of places where > > similar things happen. > > Same thing comes up with bignum code - you really want to be able to > tell the compiler "you can apply x/y/z optimizations for these > functions", e.g. replace add(mul(a, b), c) with fma(a, b, c). > > Compiler optimizations are just algebraic transformations, we just need > a way to tell the compiler what the algebraic properties of our > functions are. That might indeed be more straightforward than doing this on a per-type basis. But the C++ guys would likely just start shouting "template metaprogramming!!!" ;-) Thanx, Paul _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel