All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] all: remove GENERIC_FIND_FIRST_BIT
@ 2021-05-10 23:34 Yury Norov
  2021-05-11  1:53 ` kernel test robot
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Yury Norov @ 2021-05-10 23:34 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Yury Norov, Alexander Lobakin, Alexey Klimov, Andy Shevchenko,
	Anton Ivanov, Arnd Bergmann, Borislav Petkov, Catalin Marinas,
	Christian Borntraeger, Dan Williams, H. Peter Anvin,
	Heiko Carstens, Ingo Molnar, Jacob Keller, Jarkko Sakkinen,
	Jeff Dike, Kees Cook, Mark Brown, Matti Vaittinen, Nick Terrell,
	Palmer Dabbelt, Rasmus Villemoes, Richard Weinberger,
	Thomas Bogendoerfer, Thomas Gleixner, Vasily Gorbik,
	Vijayanand Jitta, Vineet Gupta, Will Deacon, Yogesh Lal

In the 5.12 cycle we enabled the 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/20210225135700.1381396-1-yury.norov@gmail.com/

I think it's time to make all architectures use find_{first,last}_bit()
unconditionally and remove the corresponding config option.

This patch doesn't introduce functional changes for arc, arm64, mips,
s390 and x86 because they already enable GENERIC_FIND_FIRST_BIT. There
will be no changes for arm because it implements find_{first,last}_bit
in arch code. For other architectures I expect improvement both in
performance and .text size.

It would be great if people with an access to real hardware would share
the output of bloat-o-meter and lib/find_bit_benchmark.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
 arch/arc/Kconfig                  |  1 -
 arch/arm64/Kconfig                |  1 -
 arch/mips/Kconfig                 |  1 -
 arch/s390/Kconfig                 |  1 -
 arch/x86/Kconfig                  |  1 -
 arch/x86/um/Kconfig               |  1 -
 include/asm-generic/bitops/find.h | 12 ------------
 lib/Kconfig                       |  3 ---
 8 files changed, 21 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index bc8d6aecfbbd..9c991ba50db3 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -19,7 +19,6 @@ config ARC
 	select COMMON_CLK
 	select DMA_DIRECT_REMAP
 	select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC)
-	select GENERIC_FIND_FIRST_BIT
 	# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
 	select GENERIC_IRQ_SHOW
 	select GENERIC_PCI_IOMAP
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index e09a9591af45..9d5b36f7d981 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -108,7 +108,6 @@ config ARM64
 	select GENERIC_CPU_AUTOPROBE
 	select GENERIC_CPU_VULNERABILITIES
 	select GENERIC_EARLY_IOREMAP
-	select GENERIC_FIND_FIRST_BIT
 	select GENERIC_IDLE_POLL_SETUP
 	select GENERIC_IRQ_IPI
 	select GENERIC_IRQ_PROBE
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index b72458215d20..3ddae7918386 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -27,7 +27,6 @@ config MIPS
 	select GENERIC_ATOMIC64 if !64BIT
 	select GENERIC_CMOS_UPDATE
 	select GENERIC_CPU_AUTOPROBE
-	select GENERIC_FIND_FIRST_BIT
 	select GENERIC_GETTIMEOFDAY
 	select GENERIC_IOMAP
 	select GENERIC_IRQ_PROBE
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index c1ff874e6c2e..3a10ceb8a097 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -125,7 +125,6 @@ config S390
 	select GENERIC_CPU_AUTOPROBE
 	select GENERIC_CPU_VULNERABILITIES
 	select GENERIC_ENTRY
-	select GENERIC_FIND_FIRST_BIT
 	select GENERIC_GETTIMEOFDAY
 	select GENERIC_PTDUMP
 	select GENERIC_SMP_IDLE_THREAD
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b83364a15d34..6a7d8305365e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -123,7 +123,6 @@ config X86
 	select GENERIC_CPU_VULNERABILITIES
 	select GENERIC_EARLY_IOREMAP
 	select GENERIC_ENTRY
-	select GENERIC_FIND_FIRST_BIT
 	select GENERIC_IOMAP
 	select GENERIC_IRQ_EFFECTIVE_AFF_MASK	if SMP
 	select GENERIC_IRQ_MATRIX_ALLOCATOR	if X86_LOCAL_APIC
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index 95d26a69088b..40d6a06e41c8 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -8,7 +8,6 @@ endmenu
 
 config UML_X86
 	def_bool y
-	select GENERIC_FIND_FIRST_BIT
 
 config 64BIT
 	bool "64-bit kernel" if "$(SUBARCH)" = "x86"
diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h
index 0d132ee2a291..8a7b70c79e15 100644
--- a/include/asm-generic/bitops/find.h
+++ b/include/asm-generic/bitops/find.h
@@ -95,8 +95,6 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
 }
 #endif
 
-#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
-
 /**
  * find_first_bit - find the first set bit in a memory region
  * @addr: The address to start the search at
@@ -136,16 +134,6 @@ unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
 
 	return _find_first_zero_bit(addr, size);
 }
-#else /* CONFIG_GENERIC_FIND_FIRST_BIT */
-
-#ifndef find_first_bit
-#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
-#endif
-#ifndef find_first_zero_bit
-#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
-#endif
-
-#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
 
 #ifndef find_last_bit
 /**
diff --git a/lib/Kconfig b/lib/Kconfig
index a38cc61256f1..8346b3181214 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -59,9 +59,6 @@ config GENERIC_STRNLEN_USER
 config GENERIC_NET_UTILS
 	bool
 
-config GENERIC_FIND_FIRST_BIT
-	bool
-
 source "lib/math/Kconfig"
 
 config NO_GENERIC_PCI_IOPORT_MAP
-- 
2.25.1


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

* Re: [PATCH] all: remove GENERIC_FIND_FIRST_BIT
  2021-05-10 23:34 [PATCH] all: remove GENERIC_FIND_FIRST_BIT Yury Norov
@ 2021-05-11  1:53 ` kernel test robot
  2021-05-11 13:53 ` Alexander Lobakin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-05-11  1:53 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 17431 bytes --]

Hi Yury,

I love your patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on s390/features linus/master v5.13-rc1 next-20210510]
[cannot apply to arm64/for-next/core tip/x86/core uml/linux-next arc/for-next asm-generic/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yury-Norov/all-remove-GENERIC_FIND_FIRST_BIT/20210511-073448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd860052c99b1e088352bdd4fb7aef46f8d2ef47
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/843a54481be51456235f7c2cd87e1b20f60ba6a2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yury-Norov/all-remove-GENERIC_FIND_FIRST_BIT/20210511-073448
        git checkout 843a54481be51456235f7c2cd87e1b20f60ba6a2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/asm-generic/bug.h:20,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/page-flags.h:10,
                    from kernel/bounds.c:10:
>> arch/m68k/include/asm/bitops.h:396:24: error: conflicting types for 'find_first_bit'
     396 | #define find_first_bit find_first_bit
         |                        ^~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:107:15: note: in expansion of macro 'find_first_bit'
     107 | unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:373:19: note: previous definition of 'find_first_bit' was here
     373 | static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
         |                   ^~~~~~~~~~~~~~
>> arch/m68k/include/asm/bitops.h:341:29: error: conflicting types for 'find_first_zero_bit'
     341 | #define find_first_zero_bit find_first_zero_bit
         |                             ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:127:15: note: in expansion of macro 'find_first_zero_bit'
     127 | unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:317:19: note: previous definition of 'find_first_zero_bit' was here
     317 | static inline int find_first_zero_bit(const unsigned long *vaddr,
         |                   ^~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from kernel//locking/locktorture.c:14:
>> arch/m68k/include/asm/bitops.h:396:24: error: conflicting types for 'find_first_bit'
     396 | #define find_first_bit find_first_bit
         |                        ^~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:107:15: note: in expansion of macro 'find_first_bit'
     107 | unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:373:19: note: previous definition of 'find_first_bit' was here
     373 | static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
         |                   ^~~~~~~~~~~~~~
>> arch/m68k/include/asm/bitops.h:341:29: error: conflicting types for 'find_first_zero_bit'
     341 | #define find_first_zero_bit find_first_zero_bit
         |                             ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:127:15: note: in expansion of macro 'find_first_zero_bit'
     127 | unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:317:19: note: previous definition of 'find_first_zero_bit' was here
     317 | static inline int find_first_zero_bit(const unsigned long *vaddr,
         |                   ^~~~~~~~~~~~~~~~~~~
   In file included from include/linux/mmzone.h:19,
                    from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:16,
                    from kernel//locking/locktorture.c:15:
   include/linux/page-flags-layout.h:6:10: fatal error: generated/bounds.h: No such file or directory
       6 | #include <generated/bounds.h>
         |          ^~~~~~~~~~~~~~~~~~~~
   compilation terminated.
--
   In file included from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from include/linux/debugfs.h:15,
                    from kernel//time/test_udelay.c:13:
>> arch/m68k/include/asm/bitops.h:396:24: error: conflicting types for 'find_first_bit'
     396 | #define find_first_bit find_first_bit
         |                        ^~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:107:15: note: in expansion of macro 'find_first_bit'
     107 | unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:373:19: note: previous definition of 'find_first_bit' was here
     373 | static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
         |                   ^~~~~~~~~~~~~~
>> arch/m68k/include/asm/bitops.h:341:29: error: conflicting types for 'find_first_zero_bit'
     341 | #define find_first_zero_bit find_first_zero_bit
         |                             ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:127:15: note: in expansion of macro 'find_first_zero_bit'
     127 | unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:317:19: note: previous definition of 'find_first_zero_bit' was here
     317 | static inline int find_first_zero_bit(const unsigned long *vaddr,
         |                   ^~~~~~~~~~~~~~~~~~~
   In file included from include/linux/dcache.h:14,
                    from include/linux/fs.h:8,
                    from include/linux/debugfs.h:15,
                    from kernel//time/test_udelay.c:13:
   include/linux/lockref.h:19:10: fatal error: generated/bounds.h: No such file or directory
      19 | #include <generated/bounds.h>
         |          ^~~~~~~~~~~~~~~~~~~~
   compilation terminated.
--
   In file included from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/asm-generic/bug.h:20,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/page-flags.h:10,
                    from kernel/bounds.c:10:
>> arch/m68k/include/asm/bitops.h:396:24: error: conflicting types for 'find_first_bit'
     396 | #define find_first_bit find_first_bit
         |                        ^~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:107:15: note: in expansion of macro 'find_first_bit'
     107 | unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:373:19: note: previous definition of 'find_first_bit' was here
     373 | static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
         |                   ^~~~~~~~~~~~~~
>> arch/m68k/include/asm/bitops.h:341:29: error: conflicting types for 'find_first_zero_bit'
     341 | #define find_first_zero_bit find_first_zero_bit
         |                             ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:127:15: note: in expansion of macro 'find_first_zero_bit'
     127 | unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:317:19: note: previous definition of 'find_first_zero_bit' was here
     317 | static inline int find_first_zero_bit(const unsigned long *vaddr,
         |                   ^~~~~~~~~~~~~~~~~~~
   make[2]: *** [scripts/Makefile.build:117: kernel/bounds.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [Makefile:1232: prepare0] Error 2
   make[1]: Target 'modules_prepare' not remade because of errors.
   make: *** [Makefile:215: __sub-make] Error 2
   make: Target 'modules_prepare' not remade because of errors.
--
   scripts/genksyms/parse.y: warning: 9 shift/reduce conflicts [-Wconflicts-sr]
   scripts/genksyms/parse.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr]
   In file included from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/asm-generic/bug.h:20,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/page-flags.h:10,
                    from kernel/bounds.c:10:
>> arch/m68k/include/asm/bitops.h:396:24: error: conflicting types for 'find_first_bit'
     396 | #define find_first_bit find_first_bit
         |                        ^~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:107:15: note: in expansion of macro 'find_first_bit'
     107 | unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:373:19: note: previous definition of 'find_first_bit' was here
     373 | static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
         |                   ^~~~~~~~~~~~~~
>> arch/m68k/include/asm/bitops.h:341:29: error: conflicting types for 'find_first_zero_bit'
     341 | #define find_first_zero_bit find_first_zero_bit
         |                             ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/find.h:127:15: note: in expansion of macro 'find_first_zero_bit'
     127 | unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
         |               ^~~~~~~~~~~~~~~~~~~
   arch/m68k/include/asm/bitops.h:317:19: note: previous definition of 'find_first_zero_bit' was here
     317 | static inline int find_first_zero_bit(const unsigned long *vaddr,
         |                   ^~~~~~~~~~~~~~~~~~~
   make[2]: *** [scripts/Makefile.build:117: kernel/bounds.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [Makefile:1232: prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:215: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.


vim +/find_first_bit +396 arch/m68k/include/asm/bitops.h

171d809df1896c Greg Ungerer 2011-05-17  316  
171d809df1896c Greg Ungerer 2011-05-17  317  static inline int find_first_zero_bit(const unsigned long *vaddr,
171d809df1896c Greg Ungerer 2011-05-17  318  				      unsigned size)
171d809df1896c Greg Ungerer 2011-05-17  319  {
171d809df1896c Greg Ungerer 2011-05-17  320  	const unsigned long *p = vaddr;
171d809df1896c Greg Ungerer 2011-05-17  321  	int res = 32;
171d809df1896c Greg Ungerer 2011-05-17  322  	unsigned int words;
171d809df1896c Greg Ungerer 2011-05-17  323  	unsigned long num;
171d809df1896c Greg Ungerer 2011-05-17  324  
171d809df1896c Greg Ungerer 2011-05-17  325  	if (!size)
171d809df1896c Greg Ungerer 2011-05-17  326  		return 0;
171d809df1896c Greg Ungerer 2011-05-17  327  
171d809df1896c Greg Ungerer 2011-05-17  328  	words = (size + 31) >> 5;
171d809df1896c Greg Ungerer 2011-05-17  329  	while (!(num = ~*p++)) {
171d809df1896c Greg Ungerer 2011-05-17  330  		if (!--words)
171d809df1896c Greg Ungerer 2011-05-17  331  			goto out;
171d809df1896c Greg Ungerer 2011-05-17  332  	}
171d809df1896c Greg Ungerer 2011-05-17  333  
171d809df1896c Greg Ungerer 2011-05-17  334  	__asm__ __volatile__ ("bfffo %1{#0,#0},%0"
171d809df1896c Greg Ungerer 2011-05-17  335  			      : "=d" (res) : "d" (num & -num));
171d809df1896c Greg Ungerer 2011-05-17  336  	res ^= 31;
171d809df1896c Greg Ungerer 2011-05-17  337  out:
171d809df1896c Greg Ungerer 2011-05-17  338  	res += ((long)p - (long)vaddr - 4) * 8;
171d809df1896c Greg Ungerer 2011-05-17  339  	return res < size ? res : size;
171d809df1896c Greg Ungerer 2011-05-17  340  }
171d809df1896c Greg Ungerer 2011-05-17 @341  #define find_first_zero_bit find_first_zero_bit
171d809df1896c Greg Ungerer 2011-05-17  342  
171d809df1896c Greg Ungerer 2011-05-17  343  static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
171d809df1896c Greg Ungerer 2011-05-17  344  				     int offset)
171d809df1896c Greg Ungerer 2011-05-17  345  {
171d809df1896c Greg Ungerer 2011-05-17  346  	const unsigned long *p = vaddr + (offset >> 5);
171d809df1896c Greg Ungerer 2011-05-17  347  	int bit = offset & 31UL, res;
171d809df1896c Greg Ungerer 2011-05-17  348  
171d809df1896c Greg Ungerer 2011-05-17  349  	if (offset >= size)
171d809df1896c Greg Ungerer 2011-05-17  350  		return size;
171d809df1896c Greg Ungerer 2011-05-17  351  
171d809df1896c Greg Ungerer 2011-05-17  352  	if (bit) {
171d809df1896c Greg Ungerer 2011-05-17  353  		unsigned long num = ~*p++ & (~0UL << bit);
171d809df1896c Greg Ungerer 2011-05-17  354  		offset -= bit;
171d809df1896c Greg Ungerer 2011-05-17  355  
171d809df1896c Greg Ungerer 2011-05-17  356  		/* Look for zero in first longword */
171d809df1896c Greg Ungerer 2011-05-17  357  		__asm__ __volatile__ ("bfffo %1{#0,#0},%0"
171d809df1896c Greg Ungerer 2011-05-17  358  				      : "=d" (res) : "d" (num & -num));
171d809df1896c Greg Ungerer 2011-05-17  359  		if (res < 32) {
171d809df1896c Greg Ungerer 2011-05-17  360  			offset += res ^ 31;
171d809df1896c Greg Ungerer 2011-05-17  361  			return offset < size ? offset : size;
171d809df1896c Greg Ungerer 2011-05-17  362  		}
171d809df1896c Greg Ungerer 2011-05-17  363  		offset += 32;
171d809df1896c Greg Ungerer 2011-05-17  364  
171d809df1896c Greg Ungerer 2011-05-17  365  		if (offset >= size)
171d809df1896c Greg Ungerer 2011-05-17  366  			return size;
171d809df1896c Greg Ungerer 2011-05-17  367  	}
171d809df1896c Greg Ungerer 2011-05-17  368  	/* No zero yet, search remaining full bytes for a zero */
171d809df1896c Greg Ungerer 2011-05-17  369  	return offset + find_first_zero_bit(p, size - offset);
171d809df1896c Greg Ungerer 2011-05-17  370  }
171d809df1896c Greg Ungerer 2011-05-17  371  #define find_next_zero_bit find_next_zero_bit
171d809df1896c Greg Ungerer 2011-05-17  372  
171d809df1896c Greg Ungerer 2011-05-17  373  static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
171d809df1896c Greg Ungerer 2011-05-17  374  {
171d809df1896c Greg Ungerer 2011-05-17  375  	const unsigned long *p = vaddr;
171d809df1896c Greg Ungerer 2011-05-17  376  	int res = 32;
171d809df1896c Greg Ungerer 2011-05-17  377  	unsigned int words;
171d809df1896c Greg Ungerer 2011-05-17  378  	unsigned long num;
171d809df1896c Greg Ungerer 2011-05-17  379  
171d809df1896c Greg Ungerer 2011-05-17  380  	if (!size)
171d809df1896c Greg Ungerer 2011-05-17  381  		return 0;
171d809df1896c Greg Ungerer 2011-05-17  382  
171d809df1896c Greg Ungerer 2011-05-17  383  	words = (size + 31) >> 5;
171d809df1896c Greg Ungerer 2011-05-17  384  	while (!(num = *p++)) {
171d809df1896c Greg Ungerer 2011-05-17  385  		if (!--words)
171d809df1896c Greg Ungerer 2011-05-17  386  			goto out;
171d809df1896c Greg Ungerer 2011-05-17  387  	}
171d809df1896c Greg Ungerer 2011-05-17  388  
171d809df1896c Greg Ungerer 2011-05-17  389  	__asm__ __volatile__ ("bfffo %1{#0,#0},%0"
171d809df1896c Greg Ungerer 2011-05-17  390  			      : "=d" (res) : "d" (num & -num));
171d809df1896c Greg Ungerer 2011-05-17  391  	res ^= 31;
171d809df1896c Greg Ungerer 2011-05-17  392  out:
171d809df1896c Greg Ungerer 2011-05-17  393  	res += ((long)p - (long)vaddr - 4) * 8;
171d809df1896c Greg Ungerer 2011-05-17  394  	return res < size ? res : size;
171d809df1896c Greg Ungerer 2011-05-17  395  }
171d809df1896c Greg Ungerer 2011-05-17 @396  #define find_first_bit find_first_bit
171d809df1896c Greg Ungerer 2011-05-17  397  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 60442 bytes --]

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

* Re: [PATCH] all: remove GENERIC_FIND_FIRST_BIT
  2021-05-10 23:34 [PATCH] all: remove GENERIC_FIND_FIRST_BIT Yury Norov
  2021-05-11  1:53 ` kernel test robot
@ 2021-05-11 13:53 ` Alexander Lobakin
  2021-05-26 18:33 ` Will Deacon
  2021-06-07 15:39 ` Andy Shevchenko
  3 siblings, 0 replies; 6+ messages in thread
From: Alexander Lobakin @ 2021-05-11 13:53 UTC (permalink / raw)
  To: Yury Norov
  Cc: Alexander Lobakin, linux-kernel, linux-arch, Alexey Klimov,
	Andy Shevchenko, Anton Ivanov, Arnd Bergmann, Borislav Petkov,
	Catalin Marinas, Christian Borntraeger, Dan Williams,
	H. Peter Anvin, Heiko Carstens, Ingo Molnar, Jacob Keller,
	Jarkko Sakkinen, Jeff Dike, Kees Cook, Mark Brown,
	Matti Vaittinen, Nick Terrell, Palmer Dabbelt, Rasmus Villemoes,
	Richard Weinberger, Thomas Bogendoerfer, Thomas Gleixner,
	Vasily Gorbik, Vijayanand Jitta, Vineet Gupta, Will Deacon,
	Yogesh Lal

From: Yury Norov <yury.norov@gmail.com>
Date: Mon, 10 May 2021 16:34:21 -0700

> In the 5.12 cycle we enabled the 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/20210225135700.1381396-1-yury.norov@gmail.com/
>
> I think it's time to make all architectures use find_{first,last}_bit()
> unconditionally and remove the corresponding config option.
>
> This patch doesn't introduce functional changes for arc, arm64, mips,
> s390 and x86 because they already enable GENERIC_FIND_FIRST_BIT. There
> will be no changes for arm because it implements find_{first,last}_bit
> in arch code. For other architectures I expect improvement both in
> performance and .text size.
>
> It would be great if people with an access to real hardware would share
> the output of bloat-o-meter and lib/find_bit_benchmark.
>
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> ---
>  arch/arc/Kconfig                  |  1 -
>  arch/arm64/Kconfig                |  1 -
>  arch/mips/Kconfig                 |  1 -

MIPS bit:

Reviewed-by: Alexander Lobakin <alobakin@pm.me>
Tested-by: Alexander Lobakin <alobakin@pm.me>

>  arch/s390/Kconfig                 |  1 -
>  arch/x86/Kconfig                  |  1 -
>  arch/x86/um/Kconfig               |  1 -
>  include/asm-generic/bitops/find.h | 12 ------------
>  lib/Kconfig                       |  3 ---
>  8 files changed, 21 deletions(-)

Thanks,
Al


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

* Re: [PATCH] all: remove GENERIC_FIND_FIRST_BIT
  2021-05-10 23:34 [PATCH] all: remove GENERIC_FIND_FIRST_BIT Yury Norov
  2021-05-11  1:53 ` kernel test robot
  2021-05-11 13:53 ` Alexander Lobakin
@ 2021-05-26 18:33 ` Will Deacon
  2021-06-07 15:39 ` Andy Shevchenko
  3 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2021-05-26 18:33 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-kernel, linux-arch, Alexander Lobakin, Alexey Klimov,
	Andy Shevchenko, Anton Ivanov, Arnd Bergmann, Borislav Petkov,
	Catalin Marinas, Christian Borntraeger, Dan Williams,
	H. Peter Anvin, Heiko Carstens, Ingo Molnar, Jacob Keller,
	Jarkko Sakkinen, Jeff Dike, Kees Cook, Mark Brown,
	Matti Vaittinen, Nick Terrell, Palmer Dabbelt, Rasmus Villemoes,
	Richard Weinberger, Thomas Bogendoerfer, Thomas Gleixner,
	Vasily Gorbik, Vijayanand Jitta, Vineet Gupta, Yogesh Lal

On Mon, May 10, 2021 at 04:34:21PM -0700, Yury Norov wrote:
> In the 5.12 cycle we enabled the 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/20210225135700.1381396-1-yury.norov@gmail.com/
> 
> I think it's time to make all architectures use find_{first,last}_bit()
> unconditionally and remove the corresponding config option.
> 
> This patch doesn't introduce functional changes for arc, arm64, mips,
> s390 and x86 because they already enable GENERIC_FIND_FIRST_BIT. There
> will be no changes for arm because it implements find_{first,last}_bit
> in arch code. For other architectures I expect improvement both in
> performance and .text size.
> 
> It would be great if people with an access to real hardware would share
> the output of bloat-o-meter and lib/find_bit_benchmark.
> 
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> ---
>  arch/arc/Kconfig                  |  1 -
>  arch/arm64/Kconfig                |  1 -
>  arch/mips/Kconfig                 |  1 -
>  arch/s390/Kconfig                 |  1 -
>  arch/x86/Kconfig                  |  1 -
>  arch/x86/um/Kconfig               |  1 -
>  include/asm-generic/bitops/find.h | 12 ------------
>  lib/Kconfig                       |  3 ---
>  8 files changed, 21 deletions(-)

Acked-by: Will Deacon <will@kernel.org>

Will

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

* Re: [PATCH] all: remove GENERIC_FIND_FIRST_BIT
  2021-05-10 23:34 [PATCH] all: remove GENERIC_FIND_FIRST_BIT Yury Norov
                   ` (2 preceding siblings ...)
  2021-05-26 18:33 ` Will Deacon
@ 2021-06-07 15:39 ` Andy Shevchenko
  2021-06-09 17:27   ` Yury Norov
  3 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2021-06-07 15:39 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-kernel, linux-arch, Alexander Lobakin, Alexey Klimov,
	Anton Ivanov, Arnd Bergmann, Borislav Petkov, Catalin Marinas,
	Christian Borntraeger, Dan Williams, H. Peter Anvin,
	Heiko Carstens, Ingo Molnar, Jacob Keller, Jarkko Sakkinen,
	Jeff Dike, Kees Cook, Mark Brown, Matti Vaittinen, Nick Terrell,
	Palmer Dabbelt, Rasmus Villemoes, Richard Weinberger,
	Thomas Bogendoerfer, Thomas Gleixner, Vasily Gorbik,
	Vijayanand Jitta, Vineet Gupta, Will Deacon, Yogesh Lal

On Mon, May 10, 2021 at 04:34:21PM -0700, Yury Norov wrote:
> In the 5.12 cycle we enabled the 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/20210225135700.1381396-1-yury.norov@gmail.com/
> 
> I think it's time to make all architectures use find_{first,last}_bit()
> unconditionally and remove the corresponding config option.
> 
> This patch doesn't introduce functional changes for arc, arm64, mips,
> s390 and x86 because they already enable GENERIC_FIND_FIRST_BIT. There
> will be no changes for arm because it implements find_{first,last}_bit
> in arch code. For other architectures I expect improvement both in
> performance and .text size.

Subject like s/all:/arch:/.

> It would be great if people with an access to real hardware would share
> the output of bloat-o-meter and lib/find_bit_benchmark.

This is rather comment (should be below cutter '---' line).

Anyway, seems good to my by the code:
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> ---
>  arch/arc/Kconfig                  |  1 -
>  arch/arm64/Kconfig                |  1 -
>  arch/mips/Kconfig                 |  1 -
>  arch/s390/Kconfig                 |  1 -
>  arch/x86/Kconfig                  |  1 -
>  arch/x86/um/Kconfig               |  1 -
>  include/asm-generic/bitops/find.h | 12 ------------
>  lib/Kconfig                       |  3 ---
>  8 files changed, 21 deletions(-)
> 
> diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
> index bc8d6aecfbbd..9c991ba50db3 100644
> --- a/arch/arc/Kconfig
> +++ b/arch/arc/Kconfig
> @@ -19,7 +19,6 @@ config ARC
>  	select COMMON_CLK
>  	select DMA_DIRECT_REMAP
>  	select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC)
> -	select GENERIC_FIND_FIRST_BIT
>  	# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
>  	select GENERIC_IRQ_SHOW
>  	select GENERIC_PCI_IOMAP
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index e09a9591af45..9d5b36f7d981 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -108,7 +108,6 @@ config ARM64
>  	select GENERIC_CPU_AUTOPROBE
>  	select GENERIC_CPU_VULNERABILITIES
>  	select GENERIC_EARLY_IOREMAP
> -	select GENERIC_FIND_FIRST_BIT
>  	select GENERIC_IDLE_POLL_SETUP
>  	select GENERIC_IRQ_IPI
>  	select GENERIC_IRQ_PROBE
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index b72458215d20..3ddae7918386 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -27,7 +27,6 @@ config MIPS
>  	select GENERIC_ATOMIC64 if !64BIT
>  	select GENERIC_CMOS_UPDATE
>  	select GENERIC_CPU_AUTOPROBE
> -	select GENERIC_FIND_FIRST_BIT
>  	select GENERIC_GETTIMEOFDAY
>  	select GENERIC_IOMAP
>  	select GENERIC_IRQ_PROBE
> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> index c1ff874e6c2e..3a10ceb8a097 100644
> --- a/arch/s390/Kconfig
> +++ b/arch/s390/Kconfig
> @@ -125,7 +125,6 @@ config S390
>  	select GENERIC_CPU_AUTOPROBE
>  	select GENERIC_CPU_VULNERABILITIES
>  	select GENERIC_ENTRY
> -	select GENERIC_FIND_FIRST_BIT
>  	select GENERIC_GETTIMEOFDAY
>  	select GENERIC_PTDUMP
>  	select GENERIC_SMP_IDLE_THREAD
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index b83364a15d34..6a7d8305365e 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -123,7 +123,6 @@ config X86
>  	select GENERIC_CPU_VULNERABILITIES
>  	select GENERIC_EARLY_IOREMAP
>  	select GENERIC_ENTRY
> -	select GENERIC_FIND_FIRST_BIT
>  	select GENERIC_IOMAP
>  	select GENERIC_IRQ_EFFECTIVE_AFF_MASK	if SMP
>  	select GENERIC_IRQ_MATRIX_ALLOCATOR	if X86_LOCAL_APIC
> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> index 95d26a69088b..40d6a06e41c8 100644
> --- a/arch/x86/um/Kconfig
> +++ b/arch/x86/um/Kconfig
> @@ -8,7 +8,6 @@ endmenu
>  
>  config UML_X86
>  	def_bool y
> -	select GENERIC_FIND_FIRST_BIT
>  
>  config 64BIT
>  	bool "64-bit kernel" if "$(SUBARCH)" = "x86"
> diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h
> index 0d132ee2a291..8a7b70c79e15 100644
> --- a/include/asm-generic/bitops/find.h
> +++ b/include/asm-generic/bitops/find.h
> @@ -95,8 +95,6 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
>  }
>  #endif
>  
> -#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
> -
>  /**
>   * find_first_bit - find the first set bit in a memory region
>   * @addr: The address to start the search at
> @@ -136,16 +134,6 @@ unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
>  
>  	return _find_first_zero_bit(addr, size);
>  }
> -#else /* CONFIG_GENERIC_FIND_FIRST_BIT */
> -
> -#ifndef find_first_bit
> -#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
> -#endif
> -#ifndef find_first_zero_bit
> -#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
> -#endif
> -
> -#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
>  
>  #ifndef find_last_bit
>  /**
> diff --git a/lib/Kconfig b/lib/Kconfig
> index a38cc61256f1..8346b3181214 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -59,9 +59,6 @@ config GENERIC_STRNLEN_USER
>  config GENERIC_NET_UTILS
>  	bool
>  
> -config GENERIC_FIND_FIRST_BIT
> -	bool
> -
>  source "lib/math/Kconfig"
>  
>  config NO_GENERIC_PCI_IOPORT_MAP
> -- 
> 2.25.1
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] all: remove GENERIC_FIND_FIRST_BIT
  2021-06-07 15:39 ` Andy Shevchenko
@ 2021-06-09 17:27   ` Yury Norov
  0 siblings, 0 replies; 6+ messages in thread
From: Yury Norov @ 2021-06-09 17:27 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-kernel, linux-arch, Alexander Lobakin, Alexey Klimov,
	Anton Ivanov, Arnd Bergmann, Borislav Petkov, Catalin Marinas,
	Christian Borntraeger, Dan Williams, H. Peter Anvin,
	Heiko Carstens, Ingo Molnar, Jacob Keller, Jarkko Sakkinen,
	Jeff Dike, Kees Cook, Mark Brown, Matti Vaittinen, Nick Terrell,
	Palmer Dabbelt, Rasmus Villemoes, Richard Weinberger,
	Thomas Bogendoerfer, Thomas Gleixner, Vasily Gorbik,
	Vijayanand Jitta, Vineet Gupta, Will Deacon, Yogesh Lal

On Mon, Jun 07, 2021 at 06:39:38PM +0300, Andy Shevchenko wrote:
> On Mon, May 10, 2021 at 04:34:21PM -0700, Yury Norov wrote:
> > In the 5.12 cycle we enabled the 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/20210225135700.1381396-1-yury.norov@gmail.com/
> > 
> > I think it's time to make all architectures use find_{first,last}_bit()
> > unconditionally and remove the corresponding config option.
> > 
> > This patch doesn't introduce functional changes for arc, arm64, mips,
> > s390 and x86 because they already enable GENERIC_FIND_FIRST_BIT. There
> > will be no changes for arm because it implements find_{first,last}_bit
> > in arch code. For other architectures I expect improvement both in
> > performance and .text size.
> 
> Subject like s/all:/arch:/.

Ok, thanks. I will resend shortly as part of series, to fix m68k
issue.
 
> > It would be great if people with an access to real hardware would share
> > the output of bloat-o-meter and lib/find_bit_benchmark.
> 
> This is rather comment (should be below cutter '---' line).
> 
> Anyway, seems good to my by the code:
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> > Signed-off-by: Yury Norov <yury.norov@gmail.com>
> > ---
> >  arch/arc/Kconfig                  |  1 -
> >  arch/arm64/Kconfig                |  1 -
> >  arch/mips/Kconfig                 |  1 -
> >  arch/s390/Kconfig                 |  1 -
> >  arch/x86/Kconfig                  |  1 -
> >  arch/x86/um/Kconfig               |  1 -
> >  include/asm-generic/bitops/find.h | 12 ------------
> >  lib/Kconfig                       |  3 ---
> >  8 files changed, 21 deletions(-)
> > 
> > diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
> > index bc8d6aecfbbd..9c991ba50db3 100644
> > --- a/arch/arc/Kconfig
> > +++ b/arch/arc/Kconfig
> > @@ -19,7 +19,6 @@ config ARC
> >  	select COMMON_CLK
> >  	select DMA_DIRECT_REMAP
> >  	select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC)
> > -	select GENERIC_FIND_FIRST_BIT
> >  	# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
> >  	select GENERIC_IRQ_SHOW
> >  	select GENERIC_PCI_IOMAP
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index e09a9591af45..9d5b36f7d981 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -108,7 +108,6 @@ config ARM64
> >  	select GENERIC_CPU_AUTOPROBE
> >  	select GENERIC_CPU_VULNERABILITIES
> >  	select GENERIC_EARLY_IOREMAP
> > -	select GENERIC_FIND_FIRST_BIT
> >  	select GENERIC_IDLE_POLL_SETUP
> >  	select GENERIC_IRQ_IPI
> >  	select GENERIC_IRQ_PROBE
> > diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> > index b72458215d20..3ddae7918386 100644
> > --- a/arch/mips/Kconfig
> > +++ b/arch/mips/Kconfig
> > @@ -27,7 +27,6 @@ config MIPS
> >  	select GENERIC_ATOMIC64 if !64BIT
> >  	select GENERIC_CMOS_UPDATE
> >  	select GENERIC_CPU_AUTOPROBE
> > -	select GENERIC_FIND_FIRST_BIT
> >  	select GENERIC_GETTIMEOFDAY
> >  	select GENERIC_IOMAP
> >  	select GENERIC_IRQ_PROBE
> > diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> > index c1ff874e6c2e..3a10ceb8a097 100644
> > --- a/arch/s390/Kconfig
> > +++ b/arch/s390/Kconfig
> > @@ -125,7 +125,6 @@ config S390
> >  	select GENERIC_CPU_AUTOPROBE
> >  	select GENERIC_CPU_VULNERABILITIES
> >  	select GENERIC_ENTRY
> > -	select GENERIC_FIND_FIRST_BIT
> >  	select GENERIC_GETTIMEOFDAY
> >  	select GENERIC_PTDUMP
> >  	select GENERIC_SMP_IDLE_THREAD
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index b83364a15d34..6a7d8305365e 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -123,7 +123,6 @@ config X86
> >  	select GENERIC_CPU_VULNERABILITIES
> >  	select GENERIC_EARLY_IOREMAP
> >  	select GENERIC_ENTRY
> > -	select GENERIC_FIND_FIRST_BIT
> >  	select GENERIC_IOMAP
> >  	select GENERIC_IRQ_EFFECTIVE_AFF_MASK	if SMP
> >  	select GENERIC_IRQ_MATRIX_ALLOCATOR	if X86_LOCAL_APIC
> > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> > index 95d26a69088b..40d6a06e41c8 100644
> > --- a/arch/x86/um/Kconfig
> > +++ b/arch/x86/um/Kconfig
> > @@ -8,7 +8,6 @@ endmenu
> >  
> >  config UML_X86
> >  	def_bool y
> > -	select GENERIC_FIND_FIRST_BIT
> >  
> >  config 64BIT
> >  	bool "64-bit kernel" if "$(SUBARCH)" = "x86"
> > diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h
> > index 0d132ee2a291..8a7b70c79e15 100644
> > --- a/include/asm-generic/bitops/find.h
> > +++ b/include/asm-generic/bitops/find.h
> > @@ -95,8 +95,6 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
> >  }
> >  #endif
> >  
> > -#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
> > -
> >  /**
> >   * find_first_bit - find the first set bit in a memory region
> >   * @addr: The address to start the search at
> > @@ -136,16 +134,6 @@ unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
> >  
> >  	return _find_first_zero_bit(addr, size);
> >  }
> > -#else /* CONFIG_GENERIC_FIND_FIRST_BIT */
> > -
> > -#ifndef find_first_bit
> > -#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
> > -#endif
> > -#ifndef find_first_zero_bit
> > -#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
> > -#endif
> > -
> > -#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
> >  
> >  #ifndef find_last_bit
> >  /**
> > diff --git a/lib/Kconfig b/lib/Kconfig
> > index a38cc61256f1..8346b3181214 100644
> > --- a/lib/Kconfig
> > +++ b/lib/Kconfig
> > @@ -59,9 +59,6 @@ config GENERIC_STRNLEN_USER
> >  config GENERIC_NET_UTILS
> >  	bool
> >  
> > -config GENERIC_FIND_FIRST_BIT
> > -	bool
> > -
> >  source "lib/math/Kconfig"
> >  
> >  config NO_GENERIC_PCI_IOPORT_MAP
> > -- 
> > 2.25.1
> > 
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 

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

end of thread, other threads:[~2021-06-09 17:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 23:34 [PATCH] all: remove GENERIC_FIND_FIRST_BIT Yury Norov
2021-05-11  1:53 ` kernel test robot
2021-05-11 13:53 ` Alexander Lobakin
2021-05-26 18:33 ` Will Deacon
2021-06-07 15:39 ` Andy Shevchenko
2021-06-09 17:27   ` Yury Norov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.