Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp540584rdb; Thu, 19 Oct 2023 11:23:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcAR5E4vhfGxPpbXBJbb1NvmVqRlw+j4257KtHsteAsoHqLCxzopYEfCzAVivwIBXKGfD6 X-Received: by 2002:a05:6a00:10c4:b0:6b2:5992:9e89 with SMTP id d4-20020a056a0010c400b006b259929e89mr3013788pfu.9.1697739805037; Thu, 19 Oct 2023 11:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697739805; cv=none; d=google.com; s=arc-20160816; b=qT3FOCXyk19tvsGWbAsX+78uFrJB30qyN8fdzVYj1Tqtj9sSATEfaidncZgu89j1nI yzucqp7cj52RXF2CnCs5ecwR5yBbeHGQx4F7rSExZdfrExIwD8Ppxo0Cnvj0ksUB8G6g Aog5g8b2+IECW5CX1RFzKaJBQRxlctc9co/Cn6mEo0+CVVkIDdVrwKK7WMB98Z+GKRFX gKuWkJOH4szm7VRNrXFm60ULjpZY3eZ3Xn2Lo8Uy291yHVk+5rkUqXM5TrtezAR7xMt4 FHUJMdITutmZq+eGAXC/MKrwpqvjzNj9bF0QNrgJ5+rNoeUu4jMCDK3aAjHyNyuv96d5 p9oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=B+Dy0MUMF9MZCSycKOdW+CXIYj6FYRJemuf8QIgQ7dk=; fh=BiBJRk7t7xIt6eit3tOjOCusDLWEyRGs7keAxJy7pp8=; b=o/XK9y5cumb4chPI19BfnLaq1Mo92Gljd9INkdpy7/yokill+eGnZKzs2mf9aGvfSV HckVhUKT/LoNApErtJK1DtOLXDknmWYPSq42vH1a+bpDLAmVlsF4jsq3H2UMvsIytq9v O6rksIzZRZyDoXMCekS5mQloITIZTye4/aWz3p/3bWZ/KLdnJj/4JBuBAzejMuB1HyZX 2LEe1mW5oM+s5WMFYDEh8RwLETsMnPotieGGIrj7r+pdXYJ4+Ckgqe+rse/AzbXZVIYs AbkqVQrHn/LAMcsF9B8C+ZA1OVD+rgxeGPBw2jI9TPXgGNeQ4NbEVyVrMFsVWGz65Fml gr9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=T4D53ncI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bx18-20020a056a02051200b0057745d87b53si149720pgb.686.2023.10.19.11.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:23:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=T4D53ncI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 8C7408363651; Thu, 19 Oct 2023 11:23:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346408AbjJSSXD (ORCPT + 99 others); Thu, 19 Oct 2023 14:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346411AbjJSSXB (ORCPT ); Thu, 19 Oct 2023 14:23:01 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC21712A for ; Thu, 19 Oct 2023 11:22:58 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9bda758748eso151866b.2 for ; Thu, 19 Oct 2023 11:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1697739777; x=1698344577; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=B+Dy0MUMF9MZCSycKOdW+CXIYj6FYRJemuf8QIgQ7dk=; b=T4D53ncIzJWVVkwMuFT4mG8nIEotQ5W1BrVJfdO3z4yE8LjvwJwOA89kOpH7A/EYsZ yZjtH3EpdevSntZ0znHxj9vuEeDBFkZq9LeQ8kCyLlJ8JXHvk/HOJeK8O2p17qiUZRMv Mx0LLwiyMbQ0NemO4ED8mvYbogOK3fupL4WBQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697739777; x=1698344577; h=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=B+Dy0MUMF9MZCSycKOdW+CXIYj6FYRJemuf8QIgQ7dk=; b=PmlIEwG48WLquip3Oaxj5cKLUiFiVTqwdNCNcnyFl7Dt3vjvARZu6wz9iXxb3tmwWQ QTuPtenFeiGltJH9fBOWxwuSJetG7d33fCBByGDiXGhskoJQiPA5k4GUFM2mPEm4wX6a mkJHRqCFKV+nHYds6i6nM4IAN+CEKaoNHJHGzs3WukKWXKrbUznx3kL92INlVs8qStiu cvk5xHprVLTM92yzGJ8mlIqPZh7wR6Wb4yh7rwu0eYM3uAtGPCK1jPO1RE4agj/q7NK9 rAIPk05DKQwKNJXe2SHfZCCp/Q9Ro+CRlDv40xzkUFuQyOKd3Y1VUbfZ7KT4PCXv2jcV IGUw== X-Gm-Message-State: AOJu0YxcwEMFIZiEiiWqcoIliCSQXX7KoJ3lmMrJELhp/GXH6m8nuGou Z0rV2acVY9VICuqp2EPrLMgBbrJx+9sl08/DaOTTl59e X-Received: by 2002:a17:907:3687:b0:9be:cdca:dae9 with SMTP id bi7-20020a170907368700b009becdcadae9mr2241620ejc.36.1697739777177; Thu, 19 Oct 2023 11:22:57 -0700 (PDT) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com. [209.85.218.43]) by smtp.gmail.com with ESMTPSA id xa17-20020a170907b9d100b00982a92a849asm8374ejc.91.2023.10.19.11.22.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Oct 2023 11:22:56 -0700 (PDT) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-9bda758748eso147766b.2 for ; Thu, 19 Oct 2023 11:22:56 -0700 (PDT) X-Received: by 2002:a17:907:983:b0:9ae:6ad0:f6db with SMTP id bf3-20020a170907098300b009ae6ad0f6dbmr2275816ejc.71.1697739776227; Thu, 19 Oct 2023 11:22:56 -0700 (PDT) MIME-Version: 1.0 References: <20231019085432.GQ33217@noisy.programming.kicks-ass.net> <20231019181359.GA35308@noisy.programming.kicks-ass.net> In-Reply-To: <20231019181359.GA35308@noisy.programming.kicks-ass.net> From: Linus Torvalds Date: Thu, 19 Oct 2023 11:22:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr() To: Peter Zijlstra Cc: Uros Bizjak , Nadav Amit , "the arch/x86 maintainers" , Linux Kernel Mailing List , Andy Lutomirski , Brian Gerst , Denys Vlasenko , "H . Peter Anvin" , Thomas Gleixner , Josh Poimboeuf , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 11:23:22 -0700 (PDT) On Thu, 19 Oct 2023 at 11:14, Peter Zijlstra wrote: > > But are you really saying this_cpu_read() should not imply READ_ONCE()? Well, Uros is saying that we may be *forced* to have that implication, much as I really hate it (and wonder at the competence of a compiler that forces the code-pessimizing 'volatile'). And the "it's not volatile" is actually our historical behavior. The volatile really is new, and didn't exist before your commit b59167ac7baf ("x86/percpu: Fix this_cpu_read()"). So the whole "implies READ_ONCE()" really seems to be due to that *one* mistake in our percpu sequence locking code. Yes, it's been that way for 5 years now, but it was the other way around for the preceding decade.... Linus