From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Date: Mon, 20 Dec 2021 16:41:02 +0000 Subject: Re: [PATCH 08/17] all: replace bitmap_weight with bitmap_weight_{eq,gt,ge,lt,le} where appropriate Message-Id: List-Id: References: <20211218212014.1315894-1-yury.norov@gmail.com> <20211218212014.1315894-9-yury.norov@gmail.com> In-Reply-To: <20211218212014.1315894-9-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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