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 A80BEC27C4F for ; Thu, 13 Jun 2024 10:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GIe/v2HAveVm0PCJ9u8SjRXF7liLaeR1w4HeIjWUI70=; b=ltyyCLIUaGbaHqENlBcCOOosiw 2RYMQ6lKHr+CGg2B+wzsZNITGbrbBvyFBPZWOq6K2bdHXapazOvVSXOxPff1DkkYdRW0ITxhuvP69 IBs1mqaiUi6jIRy0bVOET+vuFeK+thuxLUlK2QAcjbYZrmtma2f0YFAp+X+OGL97i92WOcVgjPxDZ /8iEDgcJUzQN75jf2pIbApPxGKXyo/j9G+feUbQz3KYLyf3ilkgn+SsFrPVdAzDkz+1EeWB3sQV3o jRj1gCiwiyzWL5BaVDwLW7Y2YhgzgrqRY24EPBBa0UflR0WsQ3aVt/1E3A1HX5b2ufStH2/DC97ZR f4HiW5xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHhog-0000000GAXJ-29Re; Thu, 13 Jun 2024 10:36:26 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHhoZ-0000000GAUL-33gX for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2024 10:36:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4C82113D5; Thu, 13 Jun 2024 03:36:43 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CD2203F5A1; Thu, 13 Jun 2024 03:36:12 -0700 (PDT) Date: Thu, 13 Jun 2024 11:36:10 +0100 From: Mark Rutland To: Peter Zijlstra Cc: Greg Kroah-Hartman , 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 , =?utf-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Alan Stern , Andrea Parri , Will Deacon , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Joel Fernandes , Nathan Chancellor , Nick Desaulniers , kent.overstreet@gmail.com, elver@google.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , torvalds@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, Trevor Gross , dakr@redhat.com Subject: Re: [RFC 1/2] rust: Introduce atomic API helpers Message-ID: References: <20240612223025.1158537-1-boqun.feng@gmail.com> <20240612223025.1158537-2-boqun.feng@gmail.com> <2024061341-whole-snowfall-89a6@gregkh> <20240613091747.GB17707@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240613091747.GB17707@noisy.programming.kicks-ass.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240613_033619_846209_A3F6F9E9 X-CRM114-Status: GOOD ( 21.39 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 13, 2024 at 11:17:47AM +0200, Peter Zijlstra wrote: > On Thu, Jun 13, 2024 at 07:38:51AM +0200, Greg Kroah-Hartman wrote: > > On Wed, Jun 12, 2024 at 03:30:24PM -0700, Boqun Feng wrote: > > > +// Generated by scripts/atomic/gen-rust-atomic-helpers.sh > > > +// DO NOT MODIFY THIS FILE DIRECTLY > > > > Why not just build this at build time and not check the file into the > > tree if it is always automatically generated? That way it never gets > > out of sync. We do this for other types of auto-generated files in the > > kernel today already. > > Part of the problem is, is that a *TON* of files depend on the atomic.h > headers. If we'd generate it on every build, you'd basically get to > rebuild the whole kernel every single time. > > Also, these files don't change too often. And if you look, there's a > hash in those files which is used to check if things somehow got stale. That and: 1) The generation is currently slow (multiple seconds), which gets people angry if they have to wait for it for a clean build. Improving that would require changing the way we generate the headers (e.g. rewrite that in something else to avoid the subshell fork problem). Last I looked there wasn't an obvious better way to do this, because nice options ended up pulling in more build-time dependencies. 2) Linus wanted git grep to work, which meant checking in the generated files: https://lore.kernel.org/all/CA+55aFxjU0op8QLLu0n-RjHBs7gQsLvD8jcyedgw6jeZFN7B+Q@mail.gmail.com/ Mark.