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 44388C433EF for ; Mon, 20 Dec 2021 16:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235822AbhLTQlI (ORCPT ); Mon, 20 Dec 2021 11:41:08 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:60774 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233061AbhLTQlG (ORCPT ); Mon, 20 Dec 2021 11:41:06 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A788761219; Mon, 20 Dec 2021 16:41:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8EC6C36AE2; Mon, 20 Dec 2021 16:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1640018465; bh=TuP185pT5gdSlNtfNfQ+Kye5lOB+euhTli9+HNxshOM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=enGWQQJij7Gn5KXQIvc6DgLGhW8TsmstPvfbBL0Frpv76daIROB5Wk6RyCml6X1M0 INr/wU0RVuAcWcOkPbgbi5U7MaR0NTk6+o3rhiyEe0vywSW27g/jS59FjbvlDzhRr3 ovNt3nB3npaxHStYKaqE8ptag4HrP8L17DKCvcbQ= Date: Mon, 20 Dec 2021 17:41:02 +0100 From: Greg Kroah-Hartman To: Yury Norov Cc: linux-kernel@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , "Paul E. McKenney" , "Rafael J. Wysocki" , Alexander Shishkin , Alexey Klimov , Amitkumar Karwar , Andi Kleen , Andrew Lunn , Andrew Morton , Andy Gross , Andy Lutomirski , Andy Shevchenko , Anup Patel , Ard Biesheuvel , Arnaldo Carvalho de Melo , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Christoph Lameter , Daniel Vetter , Dave Hansen , David Airlie , David Laight , Dennis Zhou , Emil Renner Berthing , Geert Uytterhoeven , Geetha sowjanya , Guo Ren , Hans de Goede , Heiko Carstens , Ian Rogers , Ingo Molnar , Jakub Kicinski , Jason Wessel , Jens Axboe , Jiri Olsa , Joe Perches , Jonathan Cameron , Juri Lelli , Kees Cook , Krzysztof Kozlowski , Lee Jones , Marc Zyngier , Marcin Wojtas , Mark Gross , Mark Rutland , Matti Vaittinen , Mauro Carvalho Chehab , Mel Gorman , Michael Ellerman , Mike Marciniszyn , Nicholas Piggin , Palmer Dabbelt , Peter Zijlstra , Petr Mladek , Randy Dunlap , Rasmus Villemoes , Russell King , Saeed Mahameed , Sagi Grimberg , Sergey Senozhatsky , Solomon Peachy , Stephen Boyd , Stephen Rothwell , Steven Rostedt , Subbaraya Sundeep , Sudeep Holla , Sunil Goutham , Tariq Toukan , Tejun Heo , Thomas Bogendoerfer , Thomas Gleixner , Ulf Hansson , Vincent Guittot , Vineet Gupta , Viresh Kumar , Vivien Didelot , Vlastimil Babka , Will Deacon , bcm-kernel-feedback-list@broadcom.com, kvm@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-snps-arc@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 08/17] all: replace bitmap_weight with bitmap_weight_{eq,gt,ge,lt,le} where appropriate Message-ID: References: <20211218212014.1315894-1-yury.norov@gmail.com> <20211218212014.1315894-9-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211218212014.1315894-9-yury.norov@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 18, 2021 at 01:20:04PM -0800, Yury Norov wrote: > Kernel code calls bitmap_weight() to compare the weight of bitmap with > a given number. We can do it more efficiently with bitmap_weight_{eq, ...} > because conditional bitmap_weight may stop traversing the bitmap earlier, > as soon as condition is met. > > This patch replaces bitmap_weight with conditional versions where possible, > except for small bitmaps which size is not configurable and known at > constant time. In that case conditional version of bitmap_weight would not > benefit due to small_const_nbits() optimization; but readability may > suffer. > > Signed-off-by: Yury Norov > --- > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- > drivers/iio/dummy/iio_simple_dummy_buffer.c | 4 ++-- > drivers/iio/industrialio-trigger.c | 2 +- > drivers/memstick/core/ms_block.c | 4 ++-- > drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 2 +- > .../net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 2 +- > .../net/ethernet/marvell/octeontx2/nic/otx2_flows.c | 4 ++-- > drivers/net/ethernet/mellanox/mlx4/cmd.c | 10 +++------- > drivers/net/ethernet/mellanox/mlx4/eq.c | 4 ++-- > drivers/net/ethernet/mellanox/mlx4/fw.c | 4 ++-- > drivers/net/ethernet/mellanox/mlx4/main.c | 2 +- > drivers/perf/thunderx2_pmu.c | 4 ++-- > drivers/staging/media/tegra-video/vi.c | 2 +- > 13 files changed, 21 insertions(+), 25 deletions(-) "all" is not how to submit changes to the kernel. Please break them up into subsystem-specific patches, and send them after your core changes are accepted. good luck! greg k-h