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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 CAC49C47DD9 for ; Wed, 28 Feb 2024 16:11:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8951E416D9; Wed, 28 Feb 2024 16:11:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K4ndPIAUkJox; Wed, 28 Feb 2024 16:11:05 +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 smtp4.osuosl.org 755D3409FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1709136665; bh=UM7fB83xrY7g3CIrUJgpt+5lWVhOTXwWDbWvr1lXm3o=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=UYPzPj0z+0pN1O1adXUvxWnpdLGM1yx3gZSC7YH+azc4C6QwtZBICqLn8nYqRKe4I hYffEkYrv3epB3+CjBCeHIM/xh2J1OSSmvd7p/hlqgtZwhx6qSHthQ3PLZtpcWfPD/ J6RTPn7s0o35haj7WgD8CSPzcqUDllALftinAagJY4eOF4LnsNZdZfqj8iW70z2srz EHLSxJX8uImsRBCz4GSmHMI4eOroNltHvOmPMtIwUKRL+LT9DKwZ9zA/S/hyiEFQxY LcoUKk0a1U2pyYRxtD6hqz8BMvb2BRzPd1xnU9KoT7Spkp/mM2X4gwax5CVx6Cr59V w7fPtYtR2VTpw== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 755D3409FB; Wed, 28 Feb 2024 16:11:05 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8D7641BF2B3 for ; Wed, 28 Feb 2024 16:11:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 79B0481BD9 for ; Wed, 28 Feb 2024 16:11:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lz2xE6ei6jaP for ; Wed, 28 Feb 2024 16:11:02 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::c29; helo=mail-oo1-xc29.google.com; envelope-from=yury.norov@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 253CA81BA9 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 253CA81BA9 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by smtp1.osuosl.org (Postfix) with ESMTPS id 253CA81BA9 for ; Wed, 28 Feb 2024 16:11:01 +0000 (UTC) Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-5a095237eefso1584798eaf.1 for ; Wed, 28 Feb 2024 08:11:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709136661; x=1709741461; h=in-reply-to:content-transfer-encoding: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=UM7fB83xrY7g3CIrUJgpt+5lWVhOTXwWDbWvr1lXm3o=; b=K/RZv7jjGjKFRr4TdU7yrCQC/pXo9tg693Rnt5bRDTwKNNd5VV+7TTMS3taS0xJdlH sDiGvomngLiHQEQbnPFZVpdQTtTuITJwYJYz+fPRiVXOvDyCtP/6hhEsAlKcrEULbcdm gW5XeZFKckCdluumFKXMWslq74ZeVtlVByf2sQ+oL3Jrha9i9N7dDVV9Cbt9Pbdl/CI4 uMzCShOnUhW2t8UIJAyefBCWPG9Ge7W/bOsAUQJadr5QedoMXqxgUT0pmamy9k65ldqW xEeN3Tj/nBYh+VsEG9x0b1lCjAJoLgVjPyVrXKwWt9WxmA+afkhFeIdpzXM5UGGst6aQ xbFA== X-Forwarded-Encrypted: i=1; AJvYcCU9FbQ9pQBcJv0tVa+m/WXz8rHCwbIsk+9PxWz1q1OyyEfgwVWXhLWMZRDPoLkqbXGIrvSPnX77M5PZtUltAkYuVABsuiqtk3i19h/nGhBmEg== X-Gm-Message-State: AOJu0YzUtcmHjz5vjhR+mR0+JfzLxuPCKr0MGQ2cNBkRaRpo8M4xHoyw 1mxDjZO5j09oK/iMhzbgkT75k6mE/5f4C1qyFU2dEKSqXUYeu1PH X-Google-Smtp-Source: AGHT+IHVqmXgCjjpeT3Ayfgm29V7pLwkYccA07WjeKQIvCijKqteNCHyaFrBaReNdiJYMkPFdwfJlQ== X-Received: by 2002:a05:6359:4c0f:b0:178:94bc:72ef with SMTP id kj15-20020a0563594c0f00b0017894bc72efmr17459234rwc.25.1709136660774; Wed, 28 Feb 2024 08:11:00 -0800 (PST) Received: from localhost ([2601:344:8301:57f0:2256:57ae:919c:373f]) by smtp.gmail.com with ESMTPSA id h8-20020a255f48000000b00dcda5ddeccasm1939107ybm.30.2024.02.28.08.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 08:11:00 -0800 (PST) Date: Wed, 28 Feb 2024 08:10:59 -0800 From: Yury Norov To: Arnd Bergmann Message-ID: References: <20240201122216.2634007-1-aleksander.lobakin@intel.com> <20240201122216.2634007-2-aleksander.lobakin@intel.com> <3f6df876-4b25-4dc8-bbac-ce678c428d86@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709136661; x=1709741461; darn=lists.osuosl.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=UM7fB83xrY7g3CIrUJgpt+5lWVhOTXwWDbWvr1lXm3o=; b=kw4sbL0gUjPSkFCeLEydjA7gynINL9cbRB723ZTmqZKTTENgwz+2snU8UL6sxjA7Ay 8iY8FgY9oYefpScf+q+7diJxMGXGM/EDexQUFIOpza1wEu7Cs5fdkKEfB43MhZmm2qXJ TJgefQltQo5ZLE5SDIm2QqfiY5olZwsUqxmAH9orojYpoq8d9888lXVqcbploWk3hz6b Kws58NK0CK9ajizxxd80ckWbj249H/YkuTHQBdfvI+4T/yDlsP1aOLwQP3AELSP4v4Kp cRCrm8K265SAM7YJ0GjtCBxuxStVOTek2wEp3SWt47ZrdxxbAXjCb1qECpz8sAN0Cxkz xUwg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=kw4sbL0g Subject: Re: [Intel-wired-lan] [PATCH net-next v5 01/21] lib/bitmap: add bitmap_{read, write}() 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: Rasmus Villemoes , dm-devel@redhat.com, Alexander Potapenko , Jiri Pirko , linux-s390@vger.kernel.org, Przemek Kitszel , William Breathitt Gray , "intel-wired-lan@lists.osuosl.org" , Jakub Kicinski , Paolo Abeni , Wojciech Drewek , Ido Schimmel , Andy Shevchenko , Andy Shevchenko , Eric Dumazet , Netdev , linux-kernel@vger.kernel.org, Alexander Lobakin , Marcin Szycik , Simon Horman , Michal Swiatkowski , ntfs3@lists.linux.dev, Syed Nayyar Waris , "David S . Miller" , linux-btrfs@vger.kernel.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, Feb 01, 2024 at 03:02:50PM +0100, Arnd Bergmann wrote: > On Thu, Feb 1, 2024, at 14:45, Alexander Potapenko wrote: > > On Thu, Feb 1, 2024 at 2:23 PM Arnd Bergmann wrote: > >> On Thu, Feb 1, 2024, at 13:21, Alexander Lobakin wrote: > >> > >> As far as I can tell, the header ends up being included > >> indirectly almost everywhere, so just parsing these functions > >> likey adds not just dependencies but also compile time. > >> > > > > Removing particular functions from a header to reduce compilation time > > does not really scale. > > Do we know this case has a noticeable impact on the compilation time? > > If yes, maybe we need to tackle this problem in a different way (e.g. > > reduce the number of dependencies on it)? > > Cleaning up the header dependencies is definitely possible in > theory, and there are other places we could start this, but > it's also a multi-year effort that several people have tried > without much success. > > All I'm asking here is to not make it worse by adding this > one without need. If the function is not normally inlined > anyway, there is no benefit to having it in the header. > > Arnd Hi Arnd, I think Alexander has shown that the functions are normally inlined. If for some target that doesn't hold, we'd use __always_inline. They are very lightweight by nature - one or at max two word fetches followed by some shifting. We spent quite some cycles making sure that the generated code looks efficient, at least not worse than the existing bitmap_{get,set}_value8(), which is a special case of the bitmap_{read,write}. I agree that bitmap header is overwhelmed (like many other kernel headers), and I'm working on unloading it. I checked allyesconfig build time before and after this patch, and I found no difference for me. So if you're concerned about compilation time, this patch doesn't make things worse in this department. With all that, Alexander, can you please double-check that the functions get inlined, and if so: Signed-off-by: Yury Norov