Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp40875rdb; Wed, 18 Oct 2023 17:28:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEK212YKqG1AzC0SAyoH9UbL8kVM+72BRPYWCB38oV52YXyI7/zhm2T/FktPxdX4oRJ846H X-Received: by 2002:a05:6a20:1011:b0:137:514a:984f with SMTP id gs17-20020a056a20101100b00137514a984fmr517700pzc.35.1697675322254; Wed, 18 Oct 2023 17:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697675322; cv=none; d=google.com; s=arc-20160816; b=TOKkn9CBGvirdL81NtwBGLf+yczPt00jrCTsPPO42Az3jgcXhrOpubNByzmdKnYcF0 4epmVUzVdUj9dFX551GwbZCZV5CB/jqpndThI/KKYf62vJBhOS12Czb/whdCaqx3NqxI alriekMgqnaAYC7Py+1uPWRKdBReo8SFsZOVdYSGo6g0tm/8ypt4WXRvFtlRWISlD7T5 U369KrSPw6v3qKk2IA0omzKeZB09HoaAKTqbECtCM5tc2cTwj3HKe0l1Ahe1BFtIn5dY 5oU00hpci0V6oK6yhtIX2a080bPPrDQksoj00k6yZHFzOwJuf5QWRuNQDIpK88dYaE8P 2rkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2nh52jDJ6PylCe2C2NgD1C26nReaVji3095976lKB7Q=; fh=eYtakmuseU1/RdU9IfQLvVqLeajJVaAcLRC3klsM0+4=; b=xxbv/lhW/fRVG59hLiViT1yXsaurtaF/ecVHtiASM48NTK1hX8W/xrrdtJRmTvJuGF 3BmXDX8LdfrryH2+oAT9z44oBYVWATY2wHnJLkx9GdWnniYQrPAQUUp3a7DhBToYkGqa 0oyY+lfMss5qAkZLCuXfLTpV7J2ExpDZvzeX/r1ZhZC1q389kl4zX9K7Il2ShKFDqNaC fLM2J/yO2Hu8u9KU6+MIDVdo6tuTJ3YmQzLkSGn/YlpIl1DeOcNfen17GuCFZgjb8Yzd eSqqW/FqPJUXtSPICqbKqjE8QuGEfLSJJ74VbQn0ZV1qqum7O9gixC/W3zXr88HfNwNU 3ymQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F8jNVxjw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y15-20020a17090a154f00b00258996c09e4si972913pja.22.2023.10.18.17.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 17:28:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F8jNVxjw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1DF0F823F5F7; Wed, 18 Oct 2023 17:28:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232218AbjJSA2A (ORCPT + 99 others); Wed, 18 Oct 2023 20:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232169AbjJSA15 (ORCPT ); Wed, 18 Oct 2023 20:27:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFA16120; Wed, 18 Oct 2023 17:27:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2589C433C9; Thu, 19 Oct 2023 00:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697675275; bh=2nh52jDJ6PylCe2C2NgD1C26nReaVji3095976lKB7Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=F8jNVxjwwNREaqtRMYhgWQLYcGrhhAcFqAvHSRLvDEMXpLEpQc5vcEyuuBIlaLBCc 8eYPCv/oKbh9BlkdyIo0MoAgFO+EVrmwbn8hPcy5+rAmK6c+Th3k3zd6r48xwfnMOC npMX7cw86HSBBrcNGpXgmUSlyjScWsxfCRIcDMtF52OzyVtZZsdDRJm3NQOwMcWrfY H/5Uy8uNIG7mc8qcgS5ZZOwjFMoy4r5jNBWCoc4fIHcO/NDB7C3gJOuOQ66wFZpkU+ 2q2A4H6YDDL2cuC9g+fEzYj4Y/XKBwus5qeGAG/hbsj/6EszF8rXcnfkDo//f0fQ5j 6MCqABy3D2JfA== Date: Wed, 18 Oct 2023 17:27:54 -0700 From: Jakub Kicinski To: Alexander Lobakin Cc: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Alexander Potapenko , Eric Dumazet , David Ahern , Przemek Kitszel , Simon Horman , netdev@vger.kernel.org, linux-btrfs@vger.kernel.org, dm-devel@redhat.com, ntfs3@lists.linux.dev, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 04/13] linkmode: convert linkmode_{test,set,clear,mod}_bit() to macros Message-ID: <20231018172754.3eec4885@kernel.org> In-Reply-To: <20231016165247.14212-5-aleksander.lobakin@intel.com> References: <20231016165247.14212-1-aleksander.lobakin@intel.com> <20231016165247.14212-5-aleksander.lobakin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 17:28:35 -0700 (PDT) On Mon, 16 Oct 2023 18:52:38 +0200 Alexander Lobakin wrote: > Since commit b03fc1173c0c ("bitops: let optimize out non-atomic bitops > on compile-time constants"), the non-atomic bitops are macros which can > be expanded by the compilers into compile-time expressions, which will > result in better optimized object code. Unfortunately, turned out that > passing `volatile` to those macros discards any possibility of > optimization, as the compilers then don't even try to look whether > the passed bitmap is known at compilation time. In addition to that, > the mentioned linkmode helpers are marked with `inline`, not > `__always_inline`, meaning that it's not guaranteed some compiler won't > uninline them for no reason, which will also effectively prevent them > from being optimized (it's a well-known thing the compilers sometimes > uninline `2 + 2`). > Convert linkmode_*_bit() from inlines to macros. Their calling > convention are 1:1 with the corresponding bitops, so that it's not even > needed to enumerate and map the arguments, only the names. No changes in > vmlinux' object code (compiled by LLVM for x86_64) whatsoever, but that > doesn't necessarily means the change is meaningless. Acked-by: Jakub Kicinski This one can go in with the rest, it's trivial enough.