From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40F1F63D5 for ; Thu, 19 Oct 2023 06:38:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NC0JQ+tV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697697510; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2nh52jDJ6PylCe2C2NgD1C26nReaVji3095976lKB7Q=; b=NC0JQ+tV9yAXeDy6k4J9B9TmafdJHw19tv0KqjwKGKRUEsbBMhQLOpyuGUwap3rDt52o2A i+XidLWaIrNrpMSHIjJJRtNZIZE/FHYVWr657hCovVA1ctEgN1ZpeBRmKXQIUHHR3mKiy8 /xa9Jrtjg9nfmSoRayQw/TWTQAqcDgs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-348-c435XEXIMiuqm1oACU9GcA-1; Thu, 19 Oct 2023 02:38:28 -0400 X-MC-Unique: c435XEXIMiuqm1oACU9GcA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 62D592823819 for ; Thu, 19 Oct 2023 06:38:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B37A492BEE for ; Thu, 19 Oct 2023 06:38:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 18AEB1946A44 for ; Thu, 19 Oct 2023 06:38:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E2C0419466F6 for ; Thu, 19 Oct 2023 00:33:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AE37D503C; Thu, 19 Oct 2023 00:33:51 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A52037412 for ; Thu, 19 Oct 2023 00:33:51 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 80AD9881F01 for ; Thu, 19 Oct 2023 00:33:51 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-159-OV2TUDXKOjCgxE_RebJKZA-1; Wed, 18 Oct 2023 20:33:43 -0400 X-MC-Unique: OV2TUDXKOjCgxE_RebJKZA-1 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 038DEB808CD; Thu, 19 Oct 2023 00:27:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2589C433C9; Thu, 19 Oct 2023 00:27:54 +0000 (UTC) Date: Wed, 18 Oct 2023 17:27:54 -0700 From: Jakub Kicinski To: Alexander Lobakin 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> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mailman-Approved-At: Thu, 19 Oct 2023 06:33:51 +0000 X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390@vger.kernel.org, ntfs3@lists.linux.dev, Yury Norov , Przemek Kitszel , David Ahern , Rasmus Villemoes , dm-devel@redhat.com, linux-kernel@vger.kernel.org, Eric Dumazet , netdev@vger.kernel.org, Alexander Potapenko , Simon Horman , Andy Shevchenko , linux-btrfs@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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. 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 4939DCDB483 for ; Thu, 19 Oct 2023 00:28:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232194AbjJSA2A (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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.