Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp530930rdg; Thu, 12 Oct 2023 12:41:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlP4e0TSQxnKj3KmppWVM6XuXOaWVGTR8ITj0SBAYgW+Mpczo8yGLdeRZzdZvFPJMkVzh2 X-Received: by 2002:a17:902:ab12:b0:1c3:868f:5958 with SMTP id ik18-20020a170902ab1200b001c3868f5958mr25984764plb.20.1697139712986; Thu, 12 Oct 2023 12:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697139712; cv=none; d=google.com; s=arc-20160816; b=gLZDyS2EqES16ibDwmtNamYwuwkGPqpfXBxM0bLlLJiPfwOqiBoKMv8wT0mY6vkaNG 0vm/hStv32aR+Bu80iqLNSn1SNU8mDnf0Yo3Ho8Al0uXgtsGiyq0CXfEGq1q0crIq/V3 /ZkDHOZJtFoMgCEHkYgy81FBuXI8WjAM+75ZmoOhU17HlQmkcERkEcpnAU2+IBSVdeR5 7qbG0ozdp+UPd82VGiE52fE9yeArtz4N5GFAWGFzLUOQbFdfrDjaatiwRdYlvgSgUoUc 7mptMWAenSp9gG5hmbPi2aB3ghdqzMbdnMawximUBNBXeHuTaGgJX4hyNOBZYioOxJHJ Xwmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZuaDBcAqFMciEz4ZI1c+gQ/QSSvF5sHgbYm/hkimkbM=; fh=2W7QWOT4LLEZc93hpAJV9qeXTsNW2Zd+/+ufcs7IIZU=; b=gxkn1NyNue0w70u3jN0DVQX7B39qM1zm2bCU96xNQdHLM9ux0m7n2EksuNBT09HUvF I+4pmRdK47tY5NJWN/Cq5pKKrFLEyXGrb26/3rC6cnr4kOEuIcG8m2BmqiKsgVYNLWL0 hSTvPv5/THXg7O42gqrw0NDu7R4Gp95KVFl5bvTRcyrwJ+cB5CMedcjsz+78/blJ00hi q461JqJE7syI5UJ5FZNJVJFmAFg59jm5LEjyVA13MLb3C2tgmLxERgJfOPMVD4TwKx++ 1RW2lq7nr/eUHrhmF3vxWzvmnIYzRQ6C2XQW56VWj4GXXij7HQtUDy5Tfl8JDzxvhH80 MntA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=R2SKaFnt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u13-20020a056a00098d00b006901a3cc55csi16284726pfg.180.2023.10.12.12.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:41:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=R2SKaFnt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 41E95825F1CB; Thu, 12 Oct 2023 12:41:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442254AbjJLTlR (ORCPT + 99 others); Thu, 12 Oct 2023 15:41:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442210AbjJLTlP (ORCPT ); Thu, 12 Oct 2023 15:41:15 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B082BB for ; Thu, 12 Oct 2023 12:41:13 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-522bd411679so2377227a12.0 for ; Thu, 12 Oct 2023 12:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1697139672; x=1697744472; 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=ZuaDBcAqFMciEz4ZI1c+gQ/QSSvF5sHgbYm/hkimkbM=; b=R2SKaFntGR15mNVDq37kEYa7Fhki4ATMHhI0vEk4L81Vk+voHhia2gmNUU9GrzCpA6 MGJMrViy0BC5BYIrk0v94eF+OfGVcjGsTPiaL1LZyVDEo2OYky7EtOZTvlpnGbt3Q1/5 4cG9w9ffwT4vl6kRPzm1qJSj0OzheB3EtkbDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697139672; x=1697744472; 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=ZuaDBcAqFMciEz4ZI1c+gQ/QSSvF5sHgbYm/hkimkbM=; b=r6rzgaUegk41ETXPyAtn1Y/yz3nibE+fxFlSpCZayy15Ps+pbHS/uLABw2plzQfU4T urtFOHmrOf+Dpoqjfdy6+T4/yWqBk0M1dp5EHa7Oi/bS2S0DmDJogBUSzM5jERtu06jy XUPwnI2+WmigBBucDQA1ewTOAFpCGxsTVPfwnnwDBt+0QXXMDKnjVY4GbX9WJhMr+bnw +rhFtWK3mdYbvbjhTTF8zI2BDEgfEpGrgLhGrlFn71KPW+AyfgJJtp93zoGhaN96sWSy yTyM0H22WTmm2HJCIpLq0x1H0hu5TX4gN8e81U//Bg7OD56juusYwxg1AM/uAD/ZlU5g s4iA== X-Gm-Message-State: AOJu0YyEpYwuir98LhANvZ0ktb61XrVS0qIfef7QOs83aBtsdnPeaATl ebc9ARFAgNcijZV5LPjbs/HWBeTOedkTTcVTP0GkIQ== X-Received: by 2002:a17:906:11e:b0:9bd:84af:e67a with SMTP id 30-20020a170906011e00b009bd84afe67amr4294819eje.54.1697139671937; Thu, 12 Oct 2023 12:41:11 -0700 (PDT) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id re9-20020a170906d8c900b0099b8234a9fesm11409379ejb.1.2023.10.12.12.41.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Oct 2023 12:41:10 -0700 (PDT) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-99c1c66876aso220151166b.2 for ; Thu, 12 Oct 2023 12:41:10 -0700 (PDT) X-Received: by 2002:a17:906:1da1:b0:9ba:65e:752b with SMTP id u1-20020a1709061da100b009ba065e752bmr14307248ejh.39.1697139670299; Thu, 12 Oct 2023 12:41:10 -0700 (PDT) MIME-Version: 1.0 References: <20231010164234.140750-1-ubizjak@gmail.com> <0617BB2F-D08F-410F-A6EE-4135BB03863C@vmware.com> <6EB66FDE-DDE1-40FA-A391-AEFF963CA97E@vmware.com> In-Reply-To: <6EB66FDE-DDE1-40FA-A391-AEFF963CA97E@vmware.com> From: Linus Torvalds Date: Thu, 12 Oct 2023 12:40:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr() To: Nadav Amit Cc: Uros Bizjak , "the arch/x86 maintainers" , Linux Kernel Mailing List , Andy Lutomirski , Brian Gerst , Denys Vlasenko , "H . Peter Anvin" , Peter Zijlstra , Thomas Gleixner , Josh Poimboeuf , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 12 Oct 2023 12:41:42 -0700 (PDT) On Thu, 12 Oct 2023 at 12:32, Nadav Amit wrote: > > If you refer to the difference between DECLARE_PER_CPU_ALIGNED() and > DECLARE_PER_CPU() - that=E2=80=99s just a silly mistake that I made porti= ng my > old patch (I also put =E2=80=9Cconst=E2=80=9D in the wrong place of the d= eclaration, sorry). Yes, the only difference is the ALIGNED and the 'const', but I think also the alias attribute. However, I'd be happier if we had just one place that declares them, not tw= o. Even if the two were identical, it seems wrong to have two declarations for the same thing. > The =E2=80=9Ctrick=E2=80=9D that the patch does is to expose a new const_= pcpu_hot symbol that has > a =E2=80=9Cconst=E2=80=9D qualifier. For compilation units from which the= symbol is effectively > constant, we use const_pcpu_hot. The compiler then knows that the value w= ould not > change. Oh, I don't disagree with that part. I just don't see why the 'asm' version would have any difference. For that too, the compiler should see that the result of the asm doesn't change. So my confusion / worry is not about the const alias. I like that part. My worry is literally "in other situations we _have_ to use asm(), and it's not clear why gcc wouldn't do as well for it". Linus