From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20573CDB47E for ; Wed, 18 Oct 2023 18:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344557AbjJRSB7 (ORCPT ); Wed, 18 Oct 2023 14:01:59 -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-Google-Smtp-Source: AGHT+IFIWT/oi6A6BYZ+jOmbSEr8O5L43pFsyBimH3zfD+GoJe292TFes74rbFtkeB6t4w5oqmZLlQ== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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