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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9DCDC47DD9 for ; Wed, 28 Feb 2024 16:24:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6508060E85; Wed, 28 Feb 2024 16:24:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ACtRL6DedWiS; Wed, 28 Feb 2024 16:24:47 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org AC79E60E7F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1709137487; bh=6yiyiSurF95Yilk417AKvUkFM0dsA83koDFik74Ewi4=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=pcZTD/tYscSXQnm6uTCg9dyE7v0fvacWl/RbOx9FJZNyWrWjcoQjZ7+bmUC6zJzwW P7nzRauwsfikHrU6qsBbrK5o6Y9qKvQYLQbb9om6hMkZU4j6IYOzJNRR4M2Vqrg86v X27zrIlGyhFZl6ooyEzUYUmOmTQgY14KLo4Ef5tfy76Ez7ic/Kdo2+IDtufzl4d8m6 rWnmqlWaVFiwkAa8M6vmir5EEE5W6vRTbESmUQdEkQfdPlE2ujhPYMxKgedxkpe4ip 499SyNng150Khum85ffYQbQD2gEVyBY5yKNDsPJ+CuDWvXo4zkaEk1GntAf4SDCwA2 ZKOpnEp8+o0iA== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id AC79E60E7F; Wed, 28 Feb 2024 16:24:47 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id E7A881BF2B3 for ; Wed, 28 Feb 2024 16:24:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D45A360E7F for ; Wed, 28 Feb 2024 16:24:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lYssmu21OrAq for ; Wed, 28 Feb 2024 16:24:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::b2d; helo=mail-yb1-xb2d.google.com; envelope-from=yury.norov@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 263A960E7D DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 263A960E7D Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by smtp3.osuosl.org (Postfix) with ESMTPS id 263A960E7D for ; Wed, 28 Feb 2024 16:24:44 +0000 (UTC) Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-dc6d24737d7so5182129276.0 for ; Wed, 28 Feb 2024 08:24:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709137484; x=1709742284; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6yiyiSurF95Yilk417AKvUkFM0dsA83koDFik74Ewi4=; b=vs3UZJF2pQbGxPezq4m2QFbCYKZiAxRA0rpl6GOhSdb+JUtOJvHKZCIaNjooXkQYef 8edD58JVkumBMqhP2DjwLTRBnWP0I5yQmW5ejLiaANqMsCZMRMzIP5cAgDqRhwJ3CAlA 3PcCATYWJaN3Upnw51PJGaP69YcAB5rsClog55stwUgyPEvMPEMPqFezMVoGTdulAkpg Vcv/i0nfyy3ApxRhwbp4ljs7CuCJuq7//0rX9BPGrJVXDTg0cm1tlv+jPYglY0Uxwmv+ QKboFOBiQc5HRE7el1ZKbAgdDCW0S/DT70yaIjynN+PKMctMP0zceRNS4FW5HQgcbtsQ frgQ== X-Forwarded-Encrypted: i=1; AJvYcCUefoW0Cmrzwc4vW6i8cv5Qd33GQZNUqOwcXHsKr1O0XkWViN6EGVLiPOpbJA8seuD7KT9otdGepKI220M/xiNbQ1L4k2EaVbrWG2GdaV+A3A== X-Gm-Message-State: AOJu0YxD8d1l86evywszLPrT0uDnki5WtAHxA4UbwT1mK0676gG8xnt7 NDbNcZQIKCcKpa+Odt87GGJ1911gUkmpX/8p8YZDGmtEOZMNuy8E X-Google-Smtp-Source: AGHT+IE97AzDCtBDNO2Sn49xrnDEk1v4Xi/j9mx5F7dqZo00YL4uAX4pijipgcc3CcWP0xNp3S6Muw== X-Received: by 2002:a5b:c0b:0:b0:dcf:2cfe:c82e with SMTP id f11-20020a5b0c0b000000b00dcf2cfec82emr2516397ybq.55.1709137483760; Wed, 28 Feb 2024 08:24:43 -0800 (PST) Received: from localhost ([2601:344:8301:57f0:2256:57ae:919c:373f]) by smtp.gmail.com with ESMTPSA id z1-20020a25a101000000b00dcc234241c4sm2063668ybh.55.2024.02.28.08.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 08:24:43 -0800 (PST) Date: Wed, 28 Feb 2024 08:24:42 -0800 From: Yury Norov To: Alexander Lobakin Message-ID: References: <20240201122216.2634007-1-aleksander.lobakin@intel.com> <20240201122216.2634007-8-aleksander.lobakin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240201122216.2634007-8-aleksander.lobakin@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709137484; x=1709742284; darn=lists.osuosl.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6yiyiSurF95Yilk417AKvUkFM0dsA83koDFik74Ewi4=; b=Fu45ehQr9x1cYFKyhYY2GSQaXOxYXM2qwscRtyO3gZvZoVRPo60LZT6HMOUyEbntNF yCo9P7QZ9IHbbb2lE0O5hHd5yNAqtozsuEu4KklArE0b7cLWS8WS1/JMIf2sQz4VKNIj J2TJj9XS77P5w6O0yw6FYjfbICrh5sXyWOstlH0cQPwxKJQqO0Cof89GSCHf2MOB38Z2 YUOUbNjrrjZAxdtKiWObn+db4zSkKLgwb/oFEoT8nxEDFqZZ4ShFtbB87JHubwJpN7HP FLhyYaNMP8yNo2rkp2DDCRLoOAcQ1cqIFCjsS/ioqYoxVXfhS+AJS5TBOIwQuiXH0sUZ 3GGw== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Fu45ehQr Subject: Re: [Intel-wired-lan] [PATCH net-next v5 07/21] linkmode: convert linkmode_{test, set, clear, mod}_bit() to macros X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andy Shevchenko , linux-s390@vger.kernel.org, ntfs3@lists.linux.dev, Wojciech Drewek , Ido Schimmel , Rasmus Villemoes , dm-devel@redhat.com, linux-kernel@vger.kernel.org, Jiri Pirko , Eric Dumazet , Marcin Szycik , Alexander Potapenko , Simon Horman , Michal Swiatkowski , Przemek Kitszel , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , "David S. Miller" , linux-btrfs@vger.kernel.org, intel-wired-lan@lists.osuosl.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, Feb 01, 2024 at 01:22:02PM +0100, 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. > > Reviewed-by: Przemek Kitszel > Acked-by: Jakub Kicinski > Signed-off-by: Alexander Lobakin Acked-by: Yury Norov From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBB5B6EF08; Wed, 28 Feb 2024 16:24:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709137486; cv=none; b=mbIorVO+cvdL21G3db+b3KB+1z3NH+7adn2S0DJQMrBiW0OI2EQbtqas0rC0jaNfCTQD2lFTdTDGT4JHUqML4ZElqPX4CGx33KAbbMoF2HjI7+gvIZPcJPsxcU7fFukt0pcHlKAxv8YgMlrjDXBnNGXE6glEbEnV9DFN6JRXeH8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709137486; c=relaxed/simple; bh=vKUF/IwoOUPHwhneZ5hpyMp0Qy1d0T7jwb6stGL3VXY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YzKtEWTroH2B9xiVgoNYZQuPCdg1sV4G5aJEwbQWP9XDe/8BNuKFNOEXcy0BviiiJDp9ojan7sIpc8+enOl2mA7VYmwwgLOzC63MrHD+eFOyuVWmrP5Cn1kV4uxbEdduu1p6QNTxQTCe5E2oAb/CtPdo+Fr3MhnJn9FAWfBI5bw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QQzZf/by; arc=none smtp.client-ip=209.85.219.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QQzZf/by" Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-dc6d8bd618eso5967043276.3; Wed, 28 Feb 2024 08:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709137484; x=1709742284; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6yiyiSurF95Yilk417AKvUkFM0dsA83koDFik74Ewi4=; b=QQzZf/by3O68oh7fq094Sp+a0l6isHtSWzC2QTezrC18b4dJIpZRTZbsvvmSmx6HwO Aqfw+UGef2cRQBy7csWmZcDE8bF+H2tGj806aCX/pP9/DQzqKNzO4o409Ulh+QQXxTPe w4XpIh9UUe9Our0R0w9MyTwc99FcvRfmCKDBgmYf7jvH+Ptk1jU4M2MzzWmJ4SDkeUiM ArItkLku0pkhIijeeCB+sYFZ0WK1us0UzhGrINv+fgw6Zp9ZXClUu3IUXsZhQE1ERANe 8+0VS+iMig4KxLkDdFpqJw0SCU7SZfeXKsvHb19kgIysARCfGjA0MBHgXOphZ1y3aeAt vXyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709137484; x=1709742284; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6yiyiSurF95Yilk417AKvUkFM0dsA83koDFik74Ewi4=; b=cDwRjD7hyfPlWa6/j9VZvk+7nNZv750O66Vbkb0ng7i74/08ZMBcU62f1BZDyGJ2Gi VXLUMKOr/vGUhZOJ5Dxp6ysOs9fcB/+1i6upQHuUJPA2deM0oeQahWAKSLzxAGL8MARs t56aRBF9Suc4SU/1PZ39JpZA6faY4EmYjX52shU+8GN9NsyWitex0ICdrtobyzpLVofB 4knukTefBb0sizbFF+01LRhtORDcChLrMql6vtjWgNcgff24RMCIX0Ek92kRupU+t9su gBRYh/iYyhghibXnlMEol51zOuRHuEfVgbFmLmqTu7kk3WN6quuznwYt5LIdSFxI3yBd IPcw== X-Forwarded-Encrypted: i=1; AJvYcCXbAqtgEEQ4JmCEMlnC9ArVexWQVh3adivd4UB9Ee3M0eqe1PbV6GtAkAj1gaIEPkRmSuKzIIXv1fUnL/V25s57PX0WQSKEqsJ2D72ccWwBw1n+iAfl5oE+HGxTZUAYK1WbrJ4yzoT+LNXAk/CyXLhD26//mzb6I3PqwKGMmmdXgl14Ht9Km/vK6SDl2N2A9rqgsNLMgQz26jDdKPUr X-Gm-Message-State: AOJu0YzjwmbFeUwk0Fyu5kgZhVMgfsYPyjmdz7jsylRLZBm18vNO7/YO BtpeVR2Gr1BxLUkHnfbybFADwTH210V+GQN2ueWrk/B85qn2uK2T X-Google-Smtp-Source: AGHT+IE97AzDCtBDNO2Sn49xrnDEk1v4Xi/j9mx5F7dqZo00YL4uAX4pijipgcc3CcWP0xNp3S6Muw== X-Received: by 2002:a5b:c0b:0:b0:dcf:2cfe:c82e with SMTP id f11-20020a5b0c0b000000b00dcf2cfec82emr2516397ybq.55.1709137483760; Wed, 28 Feb 2024 08:24:43 -0800 (PST) Received: from localhost ([2601:344:8301:57f0:2256:57ae:919c:373f]) by smtp.gmail.com with ESMTPSA id z1-20020a25a101000000b00dcc234241c4sm2063668ybh.55.2024.02.28.08.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 08:24:43 -0800 (PST) Date: Wed, 28 Feb 2024 08:24:42 -0800 From: Yury Norov To: Alexander Lobakin Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Michal Swiatkowski , Marcin Szycik , Wojciech Drewek , Andy Shevchenko , Rasmus Villemoes , Alexander Potapenko , Jiri Pirko , Ido Schimmel , Przemek Kitszel , Simon Horman , linux-btrfs@vger.kernel.org, dm-devel@redhat.com, ntfs3@lists.linux.dev, linux-s390@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v5 07/21] linkmode: convert linkmode_{test,set,clear,mod}_bit() to macros Message-ID: References: <20240201122216.2634007-1-aleksander.lobakin@intel.com> <20240201122216.2634007-8-aleksander.lobakin@intel.com> Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240201122216.2634007-8-aleksander.lobakin@intel.com> On Thu, Feb 01, 2024 at 01:22:02PM +0100, 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. > > Reviewed-by: Przemek Kitszel > Acked-by: Jakub Kicinski > Signed-off-by: Alexander Lobakin Acked-by: Yury Norov