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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E0419C433F5 for ; Mon, 20 Dec 2021 16:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5yIGIs3phlNOQrxdWMN1ji3hJW9KEQ3+tXTW89XMqxU=; b=F8jkcayD0Zl9Ra oO9ztg6j5oKDtA3AD1cR60vggJU9UDKbFVhX/Are7c3uN6ImFRs1GwYwhVsRHsdiHwYsxcbbnGBrF qYe5MFkF1GBlc/KOaW7YdAa82vNzmvrZ7Q4fsJuLIs0ZVtISaQJLlANn40dvES+8QwbtRwF7A/SNi 4sQw1NAJqGH2Eq3bXxkMuhQvbPVE7oHU9IBywH7ww/Jn7/QkuohZ911IVyLGbpAgjx6Rame3lLNsn nTt9OLUciwMSvtrpuXnWC0TyvpC3Zh5JbrulkZoEXDV0SFfU3zmbKADdSxkinBfTqZ7n1OvReEhDL pR2NnKQxkyKthQc541Ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzLip-003LEw-Cd; Mon, 20 Dec 2021 16:41:11 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzLil-003LB0-Tf; Mon, 20 Dec 2021 16:41:10 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 500EDB80F98; Mon, 20 Dec 2021 16:41:06 +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-Disposition: inline In-Reply-To: <20211218212014.1315894-9-yury.norov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211220_084108_251692_FD8D5370 X-CRM114-Status: GOOD ( 19.61 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv