Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp50155lqs; Thu, 13 Jun 2024 03:36:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYt3iCeZHzg7fyDE6w5Zs2/i7IZ1NuUPWEeBotB8pCKwCs44gFdSkcuIrX0XoiI9kAPXt8s1OqSdqHQEXuixwFh72w8ON6ZsHPI3RjHQ== X-Google-Smtp-Source: AGHT+IFxlVOTfB7EeL8yMi3vtpjWm3AWfFFQBMwugt5YKzvnxV+kahU1gAv3bjsvTaaSQhwi0uU4 X-Received: by 2002:a17:906:a90:b0:a6f:54fc:d921 with SMTP id a640c23a62f3a-a6f54fcf47amr100056666b.16.1718275003611; Thu, 13 Jun 2024 03:36:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718275003; cv=pass; d=google.com; s=arc-20160816; b=GUUMnzcJWCSOPDcJzNbMAlPpGZyWhAjOna8A/kB2QEaN80zDu8qsakRZzVNHLP7P1/ L86jRTOX+PILJvorqL4kqWn4H+buEt+PzQ731Ls6ex73Mw2yc/UrHmgA0HtHbzhwrfiA 4REMRjaJywoIL8KBynLA/n32Ix+2uJ1abkYBQkj+0BUfhY/mVU32+S9ISVUYDLJEPT6j +Mx+ZFb9cpkzK2oDGHjEyVfmQt/mnYLL3sUHNTq28STIW39ju50gzwscFOZsrU2wnJzH kB+PpWrMC9LjIT3ou/ttxg7VSlI57bCxshcbEMHjFT48mQOitDOlW2hGFekOm+lH9xDY iqRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=GIe/v2HAveVm0PCJ9u8SjRXF7liLaeR1w4HeIjWUI70=; fh=e9vJEE7vxcdYcVEOjrDUu/vg2EUhSbHvB8zL1ZEsP5A=; b=NrUeU/T8nYtgjLQekYotiBHEIEgIuv3hWIi20fRa2LUj8bqLxQxGhgvrPAd7hYP028 +phenMiQDtwqwlkMthJDCTN0q3Njk0Bk0y+FoVOfE+1W2ZSBrubIpIwvekdll8Kr9ggN C9BFbkvE3zzsyb6CEB2vBEfPtkTe2YPr2u8elgk3xA4A4Hy+Aj7heMRGmr0VN+6J/uwW EWR1n4diBc7VyDxhN4XcB/RSaqmkUISciMDhn2CpzR1NeX3eAwdCPuXshbGuSQhn2AmC xvnMYQ44lnONqlo0/0y3sUSSpxP66Ipx2naQLIN1XkCufWcpCtFMLaR1xWvfaTE8VjT2 AwEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-213032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56e3b433si56097566b.834.2024.06.13.03.36.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 03:36:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-213032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4B8D91F217EC for ; Thu, 13 Jun 2024 10:36:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A7441428F7; Thu, 13 Jun 2024 10:36:27 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 633C025632; Thu, 13 Jun 2024 10:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718274986; cv=none; b=b0z2+vRFtNbsGtRSzTZBvxDzirSZ/SgbSwz+UCEiDSHbsA0usAbG9R60h55u+su++pl81lOa6pOLVTofLQJfP6Fj/BcykqpQ4wZRqAfjUx2HDgboiRdMSay01NwV2k75CsrrfZef2osTTY2ijzAsSRvQInEnmevc1NLMg2toMsc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718274986; c=relaxed/simple; bh=cHpapWwllRR92WhnROTVW7uuoH/zjVZME5D0Uwcllug=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nFCdRzakVCdoG/G+WWu26nBhHmeEZcLdDqcRVoykWKUeiimrjmdDslp/mHZPrb2aU0SC3R3psftxrijHZc9r+jKGVNivZ8AOdcjPpcSFD1BPNTyecmuUdubcv44gONbq3YnHkaecqzah69Gti5z4N5tWKZHeECJUyiTsEgFCuXo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240613091747.GB17707@noisy.programming.kicks-ass.net> 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.