linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] riscv: enable GENERIC_FIND_FIRST_BIT
@ 2021-07-17 16:14 Jisheng Zhang
  2021-09-08 15:04 ` Jisheng Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Jisheng Zhang @ 2021-07-17 16:14 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou; +Cc: linux-riscv, linux-kernel

From: Jisheng Zhang <jszhang@kernel.org>

riscv doesn't implement architecture-optimized bitsearching functions
such as find_first_{zero}_bit() etc.

When GENERIC_FIND_FIRST_BIT=n, find_first_bit() is implemented with
find_next_bit() which is less efficient. Enable GENERIC_FIND_FIRST_BIT
for riscv to get more optimized find_first_bit() implementation, an
initial test(lib/find_bit_benchmark) shows find_first_bit() performance
is improved by nearly 32%.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 8fcceb8eda07..7ebc54c5c245 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -47,6 +47,7 @@ config RISCV
 	select GENERIC_ATOMIC64 if !64BIT
 	select GENERIC_CLOCKEVENTS_BROADCAST if SMP
 	select GENERIC_EARLY_IOREMAP
+	select GENERIC_FIND_FIRST_BIT
 	select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
 	select GENERIC_IOREMAP
 	select GENERIC_IRQ_MULTI_HANDLER
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-09 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-17 16:14 [PATCH] riscv: enable GENERIC_FIND_FIRST_BIT Jisheng Zhang
2021-09-08 15:04 ` Jisheng Zhang
2021-09-09  0:58   ` Kefeng Wang
2021-09-09 13:49     ` Jisheng Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).