Skip to content

Commit c126a53

Browse files
committed
arch: remove GENERIC_FIND_FIRST_BIT entirely
In 5.12 cycle we enabled GENERIC_FIND_FIRST_BIT config option for ARM64 and MIPS. It increased performance and shrunk .text size; and so far I didn't receive any negative feedback on the change. https://lore.kernel.org/linux-arch/[email protected]/ Now I think it's a good time to switch all architectures to use find_{first,last}_bit() unconditionally, and so remove corresponding config option. The patch does't introduce functioal changes for arc, arm, arm64, mips, m68k, s390 and x86, for other architectures I expect improvement both in performance and .text size. Signed-off-by: Yury Norov <[email protected]> Tested-by: Alexander Lobakin <[email protected]> (mips) Reviewed-by: Alexander Lobakin <[email protected]> (mips) Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Will Deacon <[email protected]> Tested-by: Wolfram Sang <[email protected]>
1 parent 47d8c15 commit c126a53

File tree

8 files changed

+0
-22
lines changed

8 files changed

+0
-22
lines changed

arch/arc/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ config ARC
2020
select COMMON_CLK
2121
select DMA_DIRECT_REMAP
2222
select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC)
23-
select GENERIC_FIND_FIRST_BIT
2423
# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
2524
select GENERIC_IRQ_SHOW
2625
select GENERIC_PCI_IOMAP

arch/arm64/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ config ARM64
120120
select GENERIC_CPU_AUTOPROBE
121121
select GENERIC_CPU_VULNERABILITIES
122122
select GENERIC_EARLY_IOREMAP
123-
select GENERIC_FIND_FIRST_BIT
124123
select GENERIC_IDLE_POLL_SETUP
125124
select GENERIC_IRQ_IPI
126125
select GENERIC_IRQ_PROBE

arch/mips/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ config MIPS
3232
select GENERIC_ATOMIC64 if !64BIT
3333
select GENERIC_CMOS_UPDATE
3434
select GENERIC_CPU_AUTOPROBE
35-
select GENERIC_FIND_FIRST_BIT
3635
select GENERIC_GETTIMEOFDAY
3736
select GENERIC_IOMAP
3837
select GENERIC_IRQ_PROBE

arch/s390/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ config S390
127127
select GENERIC_CPU_AUTOPROBE
128128
select GENERIC_CPU_VULNERABILITIES
129129
select GENERIC_ENTRY
130-
select GENERIC_FIND_FIRST_BIT
131130
select GENERIC_GETTIMEOFDAY
132131
select GENERIC_PTDUMP
133132
select GENERIC_SMP_IDLE_THREAD

arch/x86/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ config X86
136136
select GENERIC_CPU_VULNERABILITIES
137137
select GENERIC_EARLY_IOREMAP
138138
select GENERIC_ENTRY
139-
select GENERIC_FIND_FIRST_BIT
140139
select GENERIC_IOMAP
141140
select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
142141
select GENERIC_IRQ_MATRIX_ALLOCATOR if X86_LOCAL_APIC

arch/x86/um/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ endmenu
88

99
config UML_X86
1010
def_bool y
11-
select GENERIC_FIND_FIRST_BIT
1211

1312
config 64BIT
1413
bool "64-bit kernel" if "$(SUBARCH)" = "x86"

include/linux/find.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
101101
}
102102
#endif
103103

104-
#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
105-
106104
#ifndef find_first_bit
107105
/**
108106
* find_first_bit - find the first set bit in a memory region
@@ -147,17 +145,6 @@ unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
147145
}
148146
#endif
149147

150-
#else /* CONFIG_GENERIC_FIND_FIRST_BIT */
151-
152-
#ifndef find_first_bit
153-
#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
154-
#endif
155-
#ifndef find_first_zero_bit
156-
#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
157-
#endif
158-
159-
#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
160-
161148
#ifndef find_last_bit
162149
/**
163150
* find_last_bit - find the last set bit in a memory region

lib/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ config GENERIC_STRNLEN_USER
6565
config GENERIC_NET_UTILS
6666
bool
6767

68-
config GENERIC_FIND_FIRST_BIT
69-
bool
70-
7168
source "lib/math/Kconfig"
7269

7370
config NO_GENERIC_PCI_IOPORT_MAP

0 commit comments

Comments
 (0)