Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3975300rdg; Wed, 18 Oct 2023 11:02:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrBZbcn3W3S8XQBMmig/aEpqT43OEeAsQyBptHUFsd4XVWsqe3e1ahzr9dpkAPIXEtaMcN X-Received: by 2002:a17:902:d1d3:b0:1bb:77a2:edda with SMTP id g19-20020a170902d1d300b001bb77a2eddamr80930plb.36.1697652147806; Wed, 18 Oct 2023 11:02:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697652147; cv=none; d=google.com; s=arc-20160816; b=JAaIK9FE49SEU/nOrFw31eEhL/aXKAfOnz6r+EFSiAqv2SQWiUtqnq98FF1UQsguVr LJqJkYSOUSsLb4Y4XN2bxC3kHnwXvxPw40oz6V29I4mP9JhniDRHhNF3vWz75Es6vMXk ny1KEKj0TpJk9dg1bXTD8V7LlrBnZqIhVnL05Ke5WW5JTFF0IzAjgER3gQxDomS2vYt4 JfXFKa+SOwIS7J3ZjmV9lw8O+gAHy2Rh4aCxJNjkaw3297NtgLui1Xus0DM0h/2TkTgE 6O0AjAI5Hrfs+7Su48Iw2GVG8UzZ4XxMjv5SaaDxBwh03mGmjZPubMhclr96Q/AIHyhB mvzQ== 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=ZItgi/26ljXyDWT88p+j+vFHLDbnwaOnBmv/sklK2Kc=; fh=3hMqaci1aSMG0AFmuDTcNcT9Fdla45I/j/Dj+Dy/pas=; b=qZj7qEyQIPIL5/+ci9viK8bluHx/s1lmaMCNEb/lXnpxnnWzfxuW+6FOAIxjZksIiv rc85Jxx0wW+y8GMYpfoCXv+BHs8X8k2I98/0gYH6Nejd6mzgg9U0oq3QVHDYb09omvRT EKXUv6pvru2KOX0vgA+rAE4/M9izLKcJdfa02RHO2E+I+YE56OVXCBPK9/SNRsVPgiYD I3cSM1TGUKvIFMxonKAcJ3wPwHCmIXypRAdKCZY64Xv3D8DIEIysNO+yICb5PBfdALcY 0LZLRfEWu3ZQzhCBXnsXwr4XTUnhA/AGrCxjplSm1D8tFt4iqWJHoXtYbPenPHZXyAaN xNKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Zoj7MEUp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l13-20020a170903244d00b001b8c824e826si396225pls.533.2023.10.18.11.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:02:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Zoj7MEUp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id D3C878083ADD; Wed, 18 Oct 2023 11:02:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232542AbjJRSB6 (ORCPT + 99 others); Wed, 18 Oct 2023 14:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbjJRSB4 (ORCPT ); Wed, 18 Oct 2023 14:01:56 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46B64B8 for ; Wed, 18 Oct 2023 11:01:51 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-507ad511315so5129352e87.0 for ; Wed, 18 Oct 2023 11:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1697652109; x=1698256909; 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=ZItgi/26ljXyDWT88p+j+vFHLDbnwaOnBmv/sklK2Kc=; b=Zoj7MEUpsEnvemtSZf1WZ86taRnPp24Lq2J1F9gFKl9kxaGrskh8WKN7YBS5dpi82z UTTdCP2SDmLR/7F0JO8n0EmvcT9LKUK3zb9olH5+dgJLHEs+JuTGln7PfMARagFIqjpb rIBxB+jm8O+wuuqM+znToOVgzRnKwZ8QWizf8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697652109; x=1698256909; 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=ZItgi/26ljXyDWT88p+j+vFHLDbnwaOnBmv/sklK2Kc=; b=p1r03hufL8GHFTQcs4BXryWfickj/q8ZhXULuWl+2fdLv3RUWDfkiY7YNI7Cr9bL7C 5fxCAW4+5Y9Iwl1qhMw6YhE0oRWO3SXBPL5HH/LPyq5M0rAg2SAT8iW5g2PlJIoIOTIW GfBAJUn53F3eFBJf7dOTvrHQhtcPAndJC4E63AUCQO0IKSjD1Xhz6vu5r5mckEgfeeMt kMsLbLNI+NjNYBJUsi/f/Lqfjrpw80J+wg3fJ3h0WPjzPhiqcW+JgXvv2OckaAjoi74R XUQFQAR2+aHYwNheAur6Zdyi1IhP30HgzyC/f4fJfXNYH/OraGGDaCd0kC7gTll3brwm MhpA== X-Gm-Message-State: AOJu0YwV4hNBzEiXu1egkkZ3r/cIJd5uWFjLhWqulGCQ2vVUtIzE9lUF /nE7FJQ82IZ/nF6ys+2vYRSTMhB8gs4GM2IhJbkXmN8k X-Received: by 2002:ac2:5a4e:0:b0:502:ff3b:766f with SMTP id r14-20020ac25a4e000000b00502ff3b766fmr4156539lfn.6.1697652109307; Wed, 18 Oct 2023 11:01:49 -0700 (PDT) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id p10-20020ac24eca000000b0050300e013f3sm785544lfr.254.2023.10.18.11.01.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Oct 2023 11:01:48 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2c50cd16f3bso74909001fa.2 for ; Wed, 18 Oct 2023 11:01:48 -0700 (PDT) X-Received: by 2002:ac2:5ecd:0:b0:507:9787:6773 with SMTP id d13-20020ac25ecd000000b0050797876773mr4693334lfq.36.1697652108120; Wed, 18 Oct 2023 11:01:48 -0700 (PDT) MIME-Version: 1.0 References: <20231010164234.140750-1-ubizjak@gmail.com> <0617BB2F-D08F-410F-A6EE-4135BB03863C@vmware.com> <7D77A452-E61E-4B8B-B49C-949E1C8E257C@vmware.com> <9F926586-20D9-4979-AB7A-71124BBAABD3@vmware.com> In-Reply-To: From: Linus Torvalds Date: Wed, 18 Oct 2023 11:01:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr() To: Uros Bizjak Cc: Nadav Amit , "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" 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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:02:23 -0700 (PDT) On Wed, 18 Oct 2023 at 10:08, Uros Bizjak wrote: > > Sure. Now the patch looks quite slim, but works as expected, reducing > the number of current_task accesses from 3841 to 3220. Thanks, that patch looks lovely to me. Since you've done all the hard lifting and the testing, I'd suggest you submit this all to the x86, including my fpu patch. Take my sign-off, and the commit message might be something along the lines of x86: clean up fpu switching in the middle of task switching It happens to work, but it's very very wrong, because our 'current' macro is magic that is supposedly loading a stable value. It just happens to be not quite stable enough and the compilers re-load the value enough for this code to work. But it's wrong. It also generates worse code. So fix it. Signed-off-by: Linus Torvalds or add any verbiage you feel appropriate. Linus