Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1106128rdg; Wed, 11 Oct 2023 14:56:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHU9knzwno5qFl/SsUfXILVBUFf46nLIvAaxdxi/XZGLWpcbBGu7e9cdhAxezLQVidkRZYa X-Received: by 2002:a05:6870:1b85:b0:1e9:9eba:327a with SMTP id hm5-20020a0568701b8500b001e99eba327amr2129272oab.28.1697061372205; Wed, 11 Oct 2023 14:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697061372; cv=none; d=google.com; s=arc-20160816; b=gSTsKifAwtBzQUNROk+m7N4sI9Tl99YArM3hBDhpL0Rfe4jAeIfDG+Ysuq8LmZR0yf X3pRsNBxhh2O0yP+opSXKrVmqR7xHsA7+PQw1yCBeNc0wXhD5txedYb/AnYQm8ul92ia Vj7lWrDdoEO4cGBAJNnFj+M+IMPNtQt44A4MQTr8plIoJUX7u9DLOicwq5Ab63Y3S3OA 3sX1B22U61AQsVHgRi51TKpNwOowB0aeAHcNDxc79YtIH241ZCLjnqI9/doOOm3VbVI2 qzoXd3wA+5SAAwVs5U3OJMgktnqLWmeHCBo/7E+eet+Zc1x9SGCpDbucMgA1UIJEoxUR 5Lmw== 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=qkNPkWU4uC8r9HLUSAcPYPPySazCPD04LYjtxitM3AU=; fh=tjTgmckDq+6np/qE1dRBElYxO/MxkLOZr8/d8pBW+/0=; b=Ob5JPEOU7lMYFnb1N7YQtPdzuzPnA/ROYFDn2xW4wgyxOG8cwuzv2MVC0e2ol5i5wQ g0te4OG91huQaKe/S7py5N5nFXoDvt2HtH2dTwA55WOGFwwd9gmcLGOwV9dF9BQQYuga CXK6eIN2ipKps/1aqqrpRLEzpZ2tH2mRZVCTDj7jIvVUXkJTxM6Uf/EHSppW7ph/i4rB wkSaz5xArYZ8IiEZ4Zn6DJNqN0qvsbefgdA5vTz9PgePAb/ohlN8XkZZJ+aHJVo5xbdR k4Uz68/DbqNQcCbJ04uytYPb6tQIGR1QrJwy4A8Scuidadaq27AzR0V3XbjmabQaH40F nGpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="FlP0H/nW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id v135-20020a63618d000000b00573f8a5337esi658836pgb.461.2023.10.11.14.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 14:56:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="FlP0H/nW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 23A5E809541C; Wed, 11 Oct 2023 14:55:26 -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 S233582AbjJKVzJ (ORCPT + 99 others); Wed, 11 Oct 2023 17:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233339AbjJKVzI (ORCPT ); Wed, 11 Oct 2023 17:55:08 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46E65AF for ; Wed, 11 Oct 2023 14:55:06 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9b1ebc80d0aso46983866b.0 for ; Wed, 11 Oct 2023 14:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1697061304; x=1697666104; 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=qkNPkWU4uC8r9HLUSAcPYPPySazCPD04LYjtxitM3AU=; b=FlP0H/nWVdlvjxh9oY3YSZzd+laBO4kZmClgwd+BuPeHAArmtk4xilz4RsUtpXjYov dTY5zb1xMA12AD9CsUqgmnaoj9KW7khUWiUBFfXMUNe3ujb9G8Q/ZtLOD66ebtDBROUN dAzbsMjKPMd2r4GqLfeKLiESRYpQmlkU9PlO8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697061304; x=1697666104; 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=qkNPkWU4uC8r9HLUSAcPYPPySazCPD04LYjtxitM3AU=; b=Bd2yWjn+LA+gNPdq+E0gVZYETH4GAj2VzUi4nvWIFdYLSrE8iI8hVKDA2yGaDK/yia hEb/1Mh3PMe9UFZFYaNO3thCGsGIslcf3jyqkifMH1hPkp/Oh4nO4W89yncZ3yS+FyhQ 41OFzritGEWXNkqoyeohIJCyW820Jg3/AUxoX5lpQ+18TQDWX4GizzhF/70HNSlI1jG0 sDQOZnsIi41k2fpcRIbB2+/nX809lu0zxWQOgyxB6cDDG9LU9J8U4KQl4MDnVcIlOqfo TKdU166BDQbPTJIsTAB8YxiSlpuXTDfnKx/ge3Cjr7uPbuoAlMNmjVdoAVTJCBTurNcK yRow== X-Gm-Message-State: AOJu0YzGQ3UClvDMP/NSDlf54Kzq5kE8TsKfH6dTBURAhzUNmkoIUO8z GHpmyNt00cr6+LuOCBg/aKcDmtjPoeAqnT8gWeQ9Dd9W X-Received: by 2002:a17:906:186:b0:9ba:dcbf:6f53 with SMTP id 6-20020a170906018600b009badcbf6f53mr4504411ejb.35.1697061304651; Wed, 11 Oct 2023 14:55:04 -0700 (PDT) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com. [209.85.208.45]) by smtp.gmail.com with ESMTPSA id m15-20020a1709066d0f00b00982a352f078sm10093832ejr.124.2023.10.11.14.55.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Oct 2023 14:55:03 -0700 (PDT) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-53d9b94731aso669359a12.1 for ; Wed, 11 Oct 2023 14:55:03 -0700 (PDT) X-Received: by 2002:a05:6402:35cb:b0:53d:fe98:fd48 with SMTP id z11-20020a05640235cb00b0053dfe98fd48mr745022edc.3.1697061303242; Wed, 11 Oct 2023 14:55:03 -0700 (PDT) MIME-Version: 1.0 References: <20231010164234.140750-1-ubizjak@gmail.com> In-Reply-To: From: Linus Torvalds Date: Wed, 11 Oct 2023 14:54:45 -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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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, 11 Oct 2023 14:55:26 -0700 (PDT) X-Spam-Level: ** On Wed, 11 Oct 2023 at 14:33, Uros Bizjak wrote: > > Reading the above, it looks to me that we don't want to play games > with "const aliased" versions of current_task [1], as proposed by > Nadav in his patch series. Well, maybe I'd like it if I saw what the effect of it was, but that patch mentions "sync_mm_rss()" which doesn't actually exist (SPLIT_RSS_COUNTING is never defined, the split version is gone and hasn't existed since commit f1a7941243c1 "mm: convert mm's rss stats into percpu_counter") I'm not sure why gcc used to get code generation wrong there, and I don't see what could be improved in the current implementation of 'current_task', but I guess there could be things that could be done to make gcc more likely to CSE the cases.. IOW, I don't understand why Navad's patch would improve gcc code gen. It presumably depends on some gcc internal issue (ie "gcc just happens to be better at optimization X"). Which is obviously a valid thing in general. Linus