From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 682C01DF662 for ; Fri, 2 Aug 2024 11:12:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722597154; cv=none; b=ahZ9pOxt4IgLoFPRF1yTQ0hZjU6Sy+bwzKauVpsFUCJRuqrKyY6VAa9v2VRCUgEwOFtSMMmlZ2KSLNhNHoXKdijRz0aR5qDBgilKK17VWM5M1oy0M1WdptLZrK0tvjhc6n/CjZ8SXD2yPTubBmTrEhEW7EhOU3qLmjLDAzg0L0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722597154; c=relaxed/simple; bh=gnO4O/zcd8S789cTMN1Qt5kvGy1SLpzswI2NiU04r2A=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=L4dRmc54FXQZHvlRxsNcjbnTODD5LWGn8aCKaQNsToDACpNgg9ncUp+sYfuBFrZiHVslAvQkKe3YpQGjfMnYLxOgcPoVSoJTdT5oSlsT8yi0HsFDy3EtPQEpXs0KWMGt7oldmXzNlUlSgww/AWCjr6DqASFzGoraF8ke12gLqQc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NzRv3Uf8; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NzRv3Uf8" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-428141be2ddso53073485e9.2 for ; Fri, 02 Aug 2024 04:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722597151; x=1723201951; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NckEZuTbgzBxmHzYz0RgKDaRsejCSb0E4WOQCnSKCEw=; b=NzRv3Uf8j9XYUci2hOMz58fa6xCSuLN9oR9B9p2cnSSUklhka/SOfrJufOaFSIoFS2 G5RIlYRXHOWRtOdKCwtw3CTiivlkA0+SSuNAGhfU16W8E5C2dwnr3w1TEqM5ZYQLEFrq qBxng01LxP3SyJ0+adunwLkIYAwFZflp6YNwipjnjgacBhuR4k8oIcauyqC+YO25MpET P6rbgOqcADJuZN0jG78fHF00juYAk6Qh1IG6jWX76CFWtTZtUPheXJ3MZxspJ/uEWOUp sS0gNltaZbQvXj5oC5jHoyydBsBZ/UGUr8i3lNJ1rya7VJfohzPdQgjzDbtnpznNeSgB N7Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722597151; x=1723201951; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NckEZuTbgzBxmHzYz0RgKDaRsejCSb0E4WOQCnSKCEw=; b=moelP2QllAWBnYqFZwUKrxSSXdsSADGziODf1O3s2c/OA7P4YpydHyNgCv/nDECzqN Tmq0Bp9SpYFH4C8fBbP6o4AKb1WBUbZyK+l3nhHXs/cYERd3cq5rpmWJ2xMWc/DMOvge mxsqlFVnWy+efoyFVEJwy7N1Q9WeA0VrzxbheFqsPAsfF78M0m1TVlkDU5F2yA0qu60P Rfk2W/n3wo/vHpdvA9mJMMcNGhGT6tF5tddkeJuz/0AWRqM6dVABVRqQYS9OSvPmYcLW PIYouZMtg4sHG2yFG6sOSjy9AIrrc5aDGOtowbskj2e33KKWNl2AzOkKVs7wfgjwPj+t hI1A== X-Forwarded-Encrypted: i=1; AJvYcCWnFQ8pSEdFO8ito9tKX7CH2VnSkzxg71MQwHcRYazibA3lrYzy2g0IGxRBSRiuV35o3f8Ud7J+VnpT5NXlDVj2MDOiy3gIrss4RrCFjY4= X-Gm-Message-State: AOJu0YxNuVhEQ6rGI+DMmL0BQ1c+MZFayFDueU1UzZR7nNnHLrrPTXAD WZpG21feYdPjOP9+mPmjghD5tWCF0kl1XpBrXEhqyy/SKHy2XI5qHYxvDFVnyHMUxAxZZv5dsbr jpo4m3LLc1Q6vPakjkyD9VecSQ8xnv4FnQl8c X-Google-Smtp-Source: AGHT+IHG8YT0Tl3r67jSeYzzG/u+IjzVWq2bWRMReS90gVbkEE3+W7//BJg0NubXE694omwJobmhmLbd7NfxN4kakP4= X-Received: by 2002:a5d:4003:0:b0:368:4edc:611e with SMTP id ffacd0b85a97d-36bbc0db7c9mr1721957f8f.14.1722597150322; Fri, 02 Aug 2024 04:12:30 -0700 (PDT) Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240802-tracepoint-v5-0-faa164494dcb@google.com> <20240802-tracepoint-v5-1-faa164494dcb@google.com> <20240802093954.GH39708@noisy.programming.kicks-ass.net> In-Reply-To: <20240802093954.GH39708@noisy.programming.kicks-ass.net> From: Alice Ryhl Date: Fri, 2 Aug 2024 13:12:17 +0200 Message-ID: Subject: Re: [PATCH v5 1/2] rust: add static_key_false To: Peter Zijlstra Cc: Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Josh Poimboeuf , Jason Baron , Ard Biesheuvel , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , linux-trace-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , linux-arch@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Sean Christopherson , Uros Bizjak , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , Mark Rutland , Ryan Roberts , Fuad Tabba , linux-arm-kernel@lists.infradead.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Andrew Jones , Alexandre Ghiti , Conor Dooley , Samuel Holland , linux-riscv@lists.infradead.org, Huacai Chen , WANG Xuerui , Bibo Mao , Tiezhu Yang , Andrew Morton , Tianrui Zhao , loongarch@lists.linux.dev, WANG Rui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Aug 2, 2024 at 11:40=E2=80=AFAM Peter Zijlstra wrote: > > On Fri, Aug 02, 2024 at 09:31:27AM +0000, Alice Ryhl wrote: > > Add just enough support for static key so that we can use it from > > tracepoints. Tracepoints rely on `static_key_false` even though it is > > deprecated, so we add the same functionality to Rust. > > > > It is not possible to use the existing C implementation of > > arch_static_branch because it passes the argument `key` to inline > > assembly as an 'i' parameter, so any attempt to add a C helper for this > > function will fail to compile because the value of `key` must be known > > at compile-time. > > > > One disadvantage of this patch is that it introduces a fair amount of > > duplicated inline assembly. However, this is a limited and temporary > > situation: > > > > 1. Most inline assembly has no reason to be duplicated like this. It is > > only needed here due to the use of 'i' parameters. > > > > 2. Alice will submit a patch along the lines of [1] that removes the > > duplication. This will happen as a follow-up to this patch series. > > You're talking about yourself in the 3rd person? I'm not sure if commit messages are supposed to be a personal message from me, or an impersonal description of the patch. I'm happy to reword. > What's the rush, why not do it right first? Well for one, this version of the series mostly just makes changes to the second patch. But also, maybe I'm being too aggressive about it, but I have large amounts of out-of-tree code that I've been working on upstreaming, and it's a lot of work to keep it all up-to-date and rebased. I want to reduce it as much as I can. I was hoping that I could get the changes to include/linux/tracepoint.h off my plate, even if more work is needed on the static_key side of things. Alice