Skip to contentSkip to conversation

generic bitops

GIT PULL New Ingo Molnar 12 participants 34 messages Apr 24, 2008 – Apr 29, 2008

Subsystems (13)
lore
Share & tools
lore
#0 lore raw

Linus, please pull the generic bitops tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-generic-bitops.git for-linus

this started out as improvements/generalizations to x86 bitops, but grew generic impact (and generic optimizations) as well, so it's offered as a separate tree.

Thanks,

Ingo

------------------>
Alexander van Heukelum (12):
x86: change x86 to use generic find_next_bit
x86, uml: fix uml with generic find_next_bit for x86
x86, generic: optimize find_next_(zero_)bit for small constant-size bitmaps
x86: merge the simple bitops and move them to bitops.h
generic: introduce a generic __fls implementation
generic: implement __fls on all 64-bit archs
bitops: use __fls for fls64 on 64-bit archs
x86: generic versions of find_first_(zero_)bit, convert i386
x86: switch 64-bit to generic find_first_bit
x86: optimize find_first_bit for small bitmaps
x86, UML: remove x86-specific implementations of find_first_bit
x86: finalize bitops unification

Joe Perches (1):
x86: include/asm-x86/pgalloc.h/bitops.h: checkpatch cleanups - formatting only

 arch/um/Kconfig.i386               |    8 ++
 arch/um/Kconfig.x86_64             |    8 ++
 arch/um/sys-i386/Makefile          |    2 +-
 arch/um/sys-x86_64/Makefile        |    2 +-
 arch/x86/Kconfig                   |    6 ++
 arch/x86/Kconfig.cpu               |    2 +-
 arch/x86/lib/Makefile              |    3 +-
 arch/x86/lib/bitops_32.c           |   70 --------------
 arch/x86/lib/bitops_64.c           |  175 ------------------------------------
 include/asm-alpha/bitops.h         |    5 +
 include/asm-generic/bitops/__fls.h |   43 +++++++++
 include/asm-generic/bitops/find.h  |    2 +
 include/asm-generic/bitops/fls64.h |   22 +++++
 include/asm-ia64/bitops.h          |   16 ++++
 include/asm-mips/bitops.h          |    5 +
 include/asm-parisc/bitops.h        |    1 +
 include/asm-powerpc/bitops.h       |    5 +
 include/asm-s390/bitops.h          |    1 +
 include/asm-sh/bitops.h            |    1 +
 include/asm-sparc64/bitops.h       |    1 +
 include/asm-x86/bitops.h           |  149 ++++++++++++++++++++++++++++---
 include/asm-x86/bitops_32.h        |  166 ----------------------------------
 include/asm-x86/bitops_64.h        |  162 ---------------------------------
 include/linux/bitops.h             |  140 ++++++++++++++++++++++++++++
 lib/Makefile                       |    1 +
 lib/find_next_bit.c                |   77 +++++++++++++---
 26 files changed, 470 insertions(+), 603 deletions(-)
 delete mode 100644 arch/x86/lib/bitops_32.c
 delete mode 100644 arch/x86/lib/bitops_64.c
 create mode 100644 include/asm-generic/bitops/__fls.h
 delete mode 100644 include/asm-x86/bitops_32.h
 delete mode 100644 include/asm-x86/bitops_64.h
arch/um/Kconfig.i386 +8 -0
index e09edfa..49990ea 100644
@@ -39,6 +39,14 @@ config ARCH_REUSE_HOST_VSYSCALL_AREA
 	bool
 	default y
 
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+
 config GENERIC_HWEIGHT
 	bool
 	default y
arch/um/Kconfig.x86_64 +8 -0
index 3fbe69e..7a75043 100644
@@ -27,6 +27,14 @@ config SMP_BROKEN
 	bool
 	default y
 
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+
 config GENERIC_HWEIGHT
 	bool
 	default y
arch/um/sys-i386/Makefile +1 -1
index 964dc1a..598b5c1 100644
@@ -6,7 +6,7 @@ obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
 	ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
 	sys_call_table.o tls.o
 
-subarch-obj-y = lib/bitops_32.o lib/semaphore_32.o lib/string_32.o
+subarch-obj-y = lib/semaphore_32.o lib/string_32.o
 subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
 subarch-obj-$(CONFIG_MODULES) += kernel/module_32.o
 
arch/um/sys-x86_64/Makefile +1 -1
index 3c22de5..c8b4cce 100644
@@ -10,7 +10,7 @@ obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \
 
 obj-$(CONFIG_MODULES) += um_module.o
 
-subarch-obj-y = lib/bitops_64.o lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o
+subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o
 subarch-obj-$(CONFIG_MODULES) += kernel/module_64.o
 
 ldt-y = ../sys-i386/ldt.o
arch/x86/Kconfig +6 -0
index 87a693c..d1a5a44 100644
@@ -77,6 +77,12 @@ config GENERIC_BUG
 	def_bool y
 	depends on BUG
 
+config GENERIC_FIND_FIRST_BIT
+	def_bool y
+
+config GENERIC_FIND_NEXT_BIT
+	def_bool y
+
 config GENERIC_HWEIGHT
 	def_bool y
 
arch/x86/Kconfig.cpu +1 -1
index 57072f2..b9368f5 100644
@@ -398,7 +398,7 @@ config X86_TSC
 # generates cmov.
 config X86_CMOV
 	def_bool y
-	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7)
+	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || X86_64)
 
 config X86_MINIMUM_CPU_FAMILY
 	int
arch/x86/lib/Makefile +1 -2
index 25df1c1..76f60f5 100644
@@ -11,7 +11,7 @@ lib-y += memcpy_$(BITS).o
 ifeq ($(CONFIG_X86_32),y)
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += bitops_32.o semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
@@ -21,7 +21,6 @@ else
 
         lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
         lib-y += thunk_64.o clear_page_64.o copy_page_64.o
-        lib-y += bitops_64.o
         lib-y += memmove_64.o memset_64.o
         lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o
 endif
arch/x86/lib/bitops_32.c deleted +0 -70

70 lines not on this page · raw message

arch/x86/lib/bitops_64.c deleted +0 -175

175 lines not on this page · raw message

include/asm-alpha/bitops.h +5 -0
index 9e19a70..15f3ae2 100644
@@ -388,6 +388,11 @@ static inline int fls64(unsigned long x)
 }
 #endif
 
+static inline unsigned long __fls(unsigned long x)
+{
+	return fls64(x) - 1;
+}
+
 static inline int fls(int x)
 {
 	return fls64((unsigned int) x);
include/asm-generic/bitops/__fls.h new file +43 -0

43 lines not on this page · raw message

include/asm-generic/bitops/find.h +2 -0
index 72a51e5..1914e97 100644
@@ -1,11 +1,13 @@
 #ifndef _ASM_GENERIC_BITOPS_FIND_H_
 #define _ASM_GENERIC_BITOPS_FIND_H_
 
+#ifndef CONFIG_GENERIC_FIND_NEXT_BIT
 extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
 		size, unsigned long offset);
 
 extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
 		long size, unsigned long offset);
+#endif
 
 #define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
 #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
include/asm-generic/bitops/fls64.h +22 -0
index 1b6b17c..86d403f 100644
@@ -3,6 +3,18 @@
 
 #include <asm/types.h>
 
+/**
+ * fls64 - find last set bit in a 64-bit word
+ * @x: the word to search
+ *
+ * This is defined in a similar way as the libc and compiler builtin
+ * ffsll, but returns the position of the most significant set bit.
+ *
+ * fls64(value) returns 0 if value is 0 or the position of the last
+ * set bit if value is nonzero. The last (most significant) bit is
+ * at position 64.
+ */
+#if BITS_PER_LONG == 32
 static inline int fls64(__u64 x)
 {
 	__u32 h = x >> 32;
@@ -10,5 +22,15 @@ static inline int fls64(__u64 x)
 		return fls(h) + 32;
 	return fls(x);
 }
+#elif BITS_PER_LONG == 64
+static inline int fls64(__u64 x)
+{
+	if (x == 0)
+		return 0;
+	return __fls(x) + 1;
+}
+#else
+#error BITS_PER_LONG not 32 or 64
+#endif
 
 #endif /* _ASM_GENERIC_BITOPS_FLS64_H_ */
include/asm-ia64/bitops.h +16 -0
index 953d3df..e2ca800 100644
@@ -407,6 +407,22 @@ fls (int t)
 	return ia64_popcnt(x);
 }
 
+/*
+ * Find the last (most significant) bit set.  Undefined for x==0.
+ * Bits are numbered from 0..63 (e.g., __fls(9) == 3).
+ */
+static inline unsigned long
+__fls (unsigned long x)
+{
+	x |= x >> 1;
+	x |= x >> 2;
+	x |= x >> 4;
+	x |= x >> 8;
+	x |= x >> 16;
+	x |= x >> 32;
+	return ia64_popcnt(x) - 1;
+}
+
 #include <asm-generic/bitops/fls64.h>
 
 /*
include/asm-mips/bitops.h +5 -0
index ec75ce4..c2bd126 100644
@@ -591,6 +591,11 @@ static inline int __ilog2(unsigned long x)
 	return 63 - lz;
 }
 
+static inline unsigned long __fls(unsigned long x)
+{
+	return __ilog2(x);
+}
+
 #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
 
 /*
include/asm-parisc/bitops.h +1 -0
index f8eebcb..7a6ea10 100644
@@ -210,6 +210,7 @@ static __inline__ int fls(int x)
 	return ret;
 }
 
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/lock.h>
include/asm-powerpc/bitops.h +5 -0
index a99a749..897eade 100644
@@ -313,6 +313,11 @@ static __inline__ int fls(unsigned int x)
 	return 32 - lz;
 }
 
+static __inline__ unsigned long __fls(unsigned long x)
+{
+	return __ilog2(x);
+}
+
 /*
  * 64-bit can do this using one cntlzd (count leading zeroes doubleword)
  * instruction; for 32-bit we use the generic version, which does two
include/asm-s390/bitops.h +1 -0
index 965394e..b4eb24a 100644
@@ -769,6 +769,7 @@ static inline int sched_find_first_bit(unsigned long *b)
 }
 
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #include <asm-generic/bitops/hweight.h>
include/asm-sh/bitops.h +1 -0
index b6ba5a6..d7d382f 100644
@@ -95,6 +95,7 @@ static inline unsigned long ffz(unsigned long word)
 #include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #endif /* __KERNEL__ */
include/asm-sparc64/bitops.h +1 -0
index 982ce89..11f9d81 100644
@@ -34,6 +34,7 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr);
 #include <asm-generic/bitops/ffz.h>
 #include <asm-generic/bitops/__ffs.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #ifdef __KERNEL__
include/asm-x86/bitops.h +136 -13

167 lines not on this page · raw message

include/asm-x86/bitops_32.h deleted +0 -166

166 lines not on this page · raw message

include/asm-x86/bitops_64.h deleted +0 -162

162 lines not on this page · raw message

include/linux/bitops.h +140 -0

144 lines not on this page · raw message

lib/Makefile +1 -0
index bf8000f..2d7001b 100644
@@ -29,6 +29,7 @@ obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
 obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
+lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o
 lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o
 obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
 obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o
lib/find_next_bit.c +65 -12

102 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · Ingo Molnar

this started out as improvements/generalizations to x86 bitops, but grew generic impact (and generic optimizations) as well, so it's offered as a separate tree.

Can you do the config thing differently?

Quoted 6 lines
arch/um/Kconfig.i386 +0 -0
index e09edfa..49990ea 100644
@@ -39,6 +39,14 @@ config ARCH_REUSE_HOST_VSYSCALL_AREA
 	bool

arch/um/Kconfig.i386 config ARCH_REUSE_HOST_VSYSCALL_AREA · line 49

Quoted 10 lines
arch/um/Kconfig.i386 +8 -0
 	default y
 
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+

.. because instead of having each architecture do these kinds of things, we're trying to make the *generic* code (ie lib/Kconfig) do

config GENERIC_FIND_FIRST_BIT
bool
default n

so that you only have one single declaration (close to where the code actually exists), and then the architectures would just do

select GENERIC_FIND_FIRST_BIT
select GENERIC_FIND_NEXT_BIT

in their architecture settings. That's how we're now doing things like HAVE_IDE, HAVE_OPROFILE, etc etc.

Hmm?

Linus

#2 lore raw
Quoted 29 lines · Linus Torvalds
Quoted 4 lines · Ingo Molnar

this started out as improvements/generalizations to x86 bitops, but grew generic impact (and generic optimizations) as well, so it's offered as a separate tree.

Can you do the config thing differently?

Quoted 6 lines
arch/um/Kconfig.i386 +0 -0
index e09edfa..49990ea 100644
@@ -39,6 +39,14 @@ config ARCH_REUSE_HOST_VSYSCALL_AREA
 	bool

arch/um/Kconfig.i386 config ARCH_REUSE_HOST_VSYSCALL_AREA · line 49

Quoted 10 lines
arch/um/Kconfig.i386 +8 -0
 	default y
 
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+

.. because instead of having each architecture do these kinds of things, we're trying to make the *generic* code (ie lib/Kconfig) do

Quoted 3 lines

config GENERIC_FIND_FIRST_BIT
bool
default n

config HAVE_GENERIC_FIND_FIRST_BIT
def_bool n

(I know it defaults to n, but this pattern is becoming suggestive of features that must be selected, in addition to the HAVE_ prefix)

Although I think for lib stuff, we may want to think about WANT_ prefixes to suggest you have to opt in.

Harvey

#3 lore raw

PATCH 1/1 x86, bitops: select the generic bitmap search functions

In reply to Linus Torvalds

Introduce GENERIC_FIND_FIRST_BIT and GENERIC_FIND_NEXT_BIT in lib/Kconfig, defaulting to off. An arch that wants to use the generic implementation now only has to use a select statement to include them.

I added an always-y option (X86_CPU) to arch/x86/Kconfig.cpu and used that to select the generic search functions. This way ARCH=um SUBARCH=i386 automatically picks up the change too, and arch/um/Kconfig.i386 can therefore be simplified a bit. ARCH=um SUBARCH=x86_64 does things differently, but still compiles fine. It seems that a "def_bool y" always wins over a "def_bool n"?

---

 arch/um/Kconfig.i386 |    8 --------
 arch/x86/Kconfig     |    6 ------
 arch/x86/Kconfig.cpu |    5 +++++
 lib/Kconfig          |    6 ++++++
 4 files changed, 11 insertions(+), 14 deletions(-)

Hello Linus,

I think this is close to what you had in mind?

The patch applies on top of:

git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-generic-bitops.git for-linus

Compile tested um/i386, um/x86_64. Boot-tested using qemu for i386 and x86_64.

Greetings,
Alexander

arch/um/Kconfig.i386 +0 -8
index 49990ea..e09edfa 100644
@@ -39,14 +39,6 @@ config ARCH_REUSE_HOST_VSYSCALL_AREA
 	bool
 	default y
 
-config GENERIC_FIND_FIRST_BIT
-	bool
-	default y
-
-config GENERIC_FIND_NEXT_BIT
-	bool
-	default y
-
 config GENERIC_HWEIGHT
 	bool
 	default y
arch/x86/Kconfig +0 -6
index 004aad8..4d350b5 100644
@@ -77,12 +77,6 @@ config GENERIC_BUG
 	def_bool y
 	depends on BUG
 
-config GENERIC_FIND_FIRST_BIT
-	def_bool y
-
-config GENERIC_FIND_NEXT_BIT
-	def_bool y
-
 config GENERIC_HWEIGHT
 	def_bool y
 
arch/x86/Kconfig.cpu +5 -0
index b9368f5..b94b04e 100644
@@ -278,6 +278,11 @@ config GENERIC_CPU
 
 endchoice
 
+config X86_CPU
+	def_bool y
+	select GENERIC_FIND_FIRST_BIT
+	select GENERIC_FIND_NEXT_BIT
+
 config X86_GENERIC
 	bool "Generic x86 support"
 	depends on X86_32
lib/Kconfig +6 -0
index 2d53dc0..8cc8e87 100644
@@ -7,6 +7,12 @@ menu "Library routines"
 config BITREVERSE
 	tristate
 
+config GENERIC_FIND_FIRST_BIT
+	def_bool n
+
+config GENERIC_FIND_NEXT_BIT
+	def_bool n
+
 config CRC_CCITT
 	tristate "CRC-CCITT functions"
 	help
#4 lore raw

[git pull] generic bitops, take 2

In reply to Linus Torvalds
Quoted 5 lines · Linus Torvalds
Quoted 3 lines

this started out as improvements/generalizations to x86 bitops, but grew generic impact (and generic optimizations) as well, so it's offered as a separate tree.

Can you do the config thing differently?

i've added Alexander's patch that does the cleanup suggested by you, you can pull the updated tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-generic-bitops-v2.git for-linus

Thanks,

Ingo

------------------>
Alexander van Heukelum (13):
x86: change x86 to use generic find_next_bit
x86, uml: fix uml with generic find_next_bit for x86
x86, generic: optimize find_next_(zero_)bit for small constant-size bitmaps
x86: merge the simple bitops and move them to bitops.h
generic: introduce a generic __fls implementation
generic: implement __fls on all 64-bit archs
bitops: use __fls for fls64 on 64-bit archs
x86: generic versions of find_first_(zero_)bit, convert i386
x86: switch 64-bit to generic find_first_bit
x86: optimize find_first_bit for small bitmaps
x86, UML: remove x86-specific implementations of find_first_bit
x86: finalize bitops unification
x86, bitops: select the generic bitmap search functions

Joe Perches (1):
x86: include/asm-x86/pgalloc.h/bitops.h: checkpatch cleanups - formatting only

 arch/um/Kconfig.x86_64             |    8 ++
 arch/um/sys-i386/Makefile          |    2 +-
 arch/um/sys-x86_64/Makefile        |    2 +-
 arch/x86/Kconfig.cpu               |    7 ++-
 arch/x86/lib/Makefile              |    3 +-
 arch/x86/lib/bitops_32.c           |   70 --------------
 arch/x86/lib/bitops_64.c           |  175 ------------------------------------
 include/asm-alpha/bitops.h         |    5 +
 include/asm-generic/bitops/__fls.h |   43 +++++++++
 include/asm-generic/bitops/find.h  |    2 +
 include/asm-generic/bitops/fls64.h |   22 +++++
 include/asm-ia64/bitops.h          |   16 ++++
 include/asm-mips/bitops.h          |    5 +
 include/asm-parisc/bitops.h        |    1 +
 include/asm-powerpc/bitops.h       |    5 +
 include/asm-s390/bitops.h          |    1 +
 include/asm-sh/bitops.h            |    1 +
 include/asm-sparc64/bitops.h       |    1 +
 include/asm-x86/bitops.h           |  149 ++++++++++++++++++++++++++++---
 include/asm-x86/bitops_32.h        |  166 ----------------------------------
 include/asm-x86/bitops_64.h        |  162 ---------------------------------
 include/linux/bitops.h             |  140 ++++++++++++++++++++++++++++
 lib/Kconfig                        |    6 ++
 lib/Makefile                       |    1 +
 lib/find_next_bit.c                |   77 +++++++++++++---
 25 files changed, 467 insertions(+), 603 deletions(-)
 delete mode 100644 arch/x86/lib/bitops_32.c
 delete mode 100644 arch/x86/lib/bitops_64.c
 create mode 100644 include/asm-generic/bitops/__fls.h
 delete mode 100644 include/asm-x86/bitops_32.h
 delete mode 100644 include/asm-x86/bitops_64.h
arch/um/Kconfig.x86_64 +8 -0
index 3fbe69e..7a75043 100644
@@ -27,6 +27,14 @@ config SMP_BROKEN
 	bool
 	default y
 
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+
 config GENERIC_HWEIGHT
 	bool
 	default y
arch/um/sys-i386/Makefile +1 -1
index 964dc1a..598b5c1 100644
@@ -6,7 +6,7 @@ obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
 	ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
 	sys_call_table.o tls.o
 
-subarch-obj-y = lib/bitops_32.o lib/semaphore_32.o lib/string_32.o
+subarch-obj-y = lib/semaphore_32.o lib/string_32.o
 subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
 subarch-obj-$(CONFIG_MODULES) += kernel/module_32.o
 
arch/um/sys-x86_64/Makefile +1 -1
index 3c22de5..c8b4cce 100644
@@ -10,7 +10,7 @@ obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \
 
 obj-$(CONFIG_MODULES) += um_module.o
 
-subarch-obj-y = lib/bitops_64.o lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o
+subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o
 subarch-obj-$(CONFIG_MODULES) += kernel/module_64.o
 
 ldt-y = ../sys-i386/ldt.o
arch/x86/Kconfig.cpu +6 -1
index 57072f2..b94b04e 100644
@@ -278,6 +278,11 @@ config GENERIC_CPU
 
 endchoice
 
+config X86_CPU
+	def_bool y
+	select GENERIC_FIND_FIRST_BIT
+	select GENERIC_FIND_NEXT_BIT
+
 config X86_GENERIC
 	bool "Generic x86 support"
 	depends on X86_32
@@ -398,7 +403,7 @@ config X86_TSC
 # generates cmov.
 config X86_CMOV
 	def_bool y
-	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7)
+	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || X86_64)
 
 config X86_MINIMUM_CPU_FAMILY
 	int
arch/x86/lib/Makefile +1 -2
index 25df1c1..76f60f5 100644
@@ -11,7 +11,7 @@ lib-y += memcpy_$(BITS).o
 ifeq ($(CONFIG_X86_32),y)
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += bitops_32.o semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
@@ -21,7 +21,6 @@ else
 
         lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
         lib-y += thunk_64.o clear_page_64.o copy_page_64.o
-        lib-y += bitops_64.o
         lib-y += memmove_64.o memset_64.o
         lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o
 endif
arch/x86/lib/bitops_32.c deleted +0 -70

70 lines not on this page · raw message

arch/x86/lib/bitops_64.c deleted +0 -175

175 lines not on this page · raw message

include/asm-alpha/bitops.h +5 -0
index 9e19a70..15f3ae2 100644
@@ -388,6 +388,11 @@ static inline int fls64(unsigned long x)
 }
 #endif
 
+static inline unsigned long __fls(unsigned long x)
+{
+	return fls64(x) - 1;
+}
+
 static inline int fls(int x)
 {
 	return fls64((unsigned int) x);
include/asm-generic/bitops/__fls.h new file +43 -0

43 lines not on this page · raw message

include/asm-generic/bitops/find.h +2 -0
index 72a51e5..1914e97 100644
@@ -1,11 +1,13 @@
 #ifndef _ASM_GENERIC_BITOPS_FIND_H_
 #define _ASM_GENERIC_BITOPS_FIND_H_
 
+#ifndef CONFIG_GENERIC_FIND_NEXT_BIT
 extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
 		size, unsigned long offset);
 
 extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
 		long size, unsigned long offset);
+#endif
 
 #define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
 #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
include/asm-generic/bitops/fls64.h +22 -0
index 1b6b17c..86d403f 100644
@@ -3,6 +3,18 @@
 
 #include <asm/types.h>
 
+/**
+ * fls64 - find last set bit in a 64-bit word
+ * @x: the word to search
+ *
+ * This is defined in a similar way as the libc and compiler builtin
+ * ffsll, but returns the position of the most significant set bit.
+ *
+ * fls64(value) returns 0 if value is 0 or the position of the last
+ * set bit if value is nonzero. The last (most significant) bit is
+ * at position 64.
+ */
+#if BITS_PER_LONG == 32
 static inline int fls64(__u64 x)
 {
 	__u32 h = x >> 32;
@@ -10,5 +22,15 @@ static inline int fls64(__u64 x)
 		return fls(h) + 32;
 	return fls(x);
 }
+#elif BITS_PER_LONG == 64
+static inline int fls64(__u64 x)
+{
+	if (x == 0)
+		return 0;
+	return __fls(x) + 1;
+}
+#else
+#error BITS_PER_LONG not 32 or 64
+#endif
 
 #endif /* _ASM_GENERIC_BITOPS_FLS64_H_ */
include/asm-ia64/bitops.h +16 -0
index 953d3df..e2ca800 100644
@@ -407,6 +407,22 @@ fls (int t)
 	return ia64_popcnt(x);
 }
 
+/*
+ * Find the last (most significant) bit set.  Undefined for x==0.
+ * Bits are numbered from 0..63 (e.g., __fls(9) == 3).
+ */
+static inline unsigned long
+__fls (unsigned long x)
+{
+	x |= x >> 1;
+	x |= x >> 2;
+	x |= x >> 4;
+	x |= x >> 8;
+	x |= x >> 16;
+	x |= x >> 32;
+	return ia64_popcnt(x) - 1;
+}
+
 #include <asm-generic/bitops/fls64.h>
 
 /*
include/asm-mips/bitops.h +5 -0
index ec75ce4..c2bd126 100644
@@ -591,6 +591,11 @@ static inline int __ilog2(unsigned long x)
 	return 63 - lz;
 }
 
+static inline unsigned long __fls(unsigned long x)
+{
+	return __ilog2(x);
+}
+
 #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
 
 /*
include/asm-parisc/bitops.h +1 -0
index f8eebcb..7a6ea10 100644
@@ -210,6 +210,7 @@ static __inline__ int fls(int x)
 	return ret;
 }
 
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/lock.h>
include/asm-powerpc/bitops.h +5 -0
index a99a749..897eade 100644
@@ -313,6 +313,11 @@ static __inline__ int fls(unsigned int x)
 	return 32 - lz;
 }
 
+static __inline__ unsigned long __fls(unsigned long x)
+{
+	return __ilog2(x);
+}
+
 /*
  * 64-bit can do this using one cntlzd (count leading zeroes doubleword)
  * instruction; for 32-bit we use the generic version, which does two
include/asm-s390/bitops.h +1 -0
index 965394e..b4eb24a 100644
@@ -769,6 +769,7 @@ static inline int sched_find_first_bit(unsigned long *b)
 }
 
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #include <asm-generic/bitops/hweight.h>
include/asm-sh/bitops.h +1 -0
index b6ba5a6..d7d382f 100644
@@ -95,6 +95,7 @@ static inline unsigned long ffz(unsigned long word)
 #include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #endif /* __KERNEL__ */
include/asm-sparc64/bitops.h +1 -0
index 982ce89..11f9d81 100644
@@ -34,6 +34,7 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr);
 #include <asm-generic/bitops/ffz.h>
 #include <asm-generic/bitops/__ffs.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #ifdef __KERNEL__
include/asm-x86/bitops.h +136 -13

167 lines not on this page · raw message

include/asm-x86/bitops_32.h deleted +0 -166

166 lines not on this page · raw message

include/asm-x86/bitops_64.h deleted +0 -162

162 lines not on this page · raw message

include/linux/bitops.h +140 -0

144 lines not on this page · raw message

lib/Kconfig +6 -0
index 2d53dc0..8cc8e87 100644
@@ -7,6 +7,12 @@ menu "Library routines"
 config BITREVERSE
 	tristate
 
+config GENERIC_FIND_FIRST_BIT
+	def_bool n
+
+config GENERIC_FIND_NEXT_BIT
+	def_bool n
+
 config CRC_CCITT
 	tristate "CRC-CCITT functions"
 	help
lib/Makefile +1 -0
index bf8000f..2d7001b 100644
@@ -29,6 +29,7 @@ obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
 obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
+lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o
 lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o
 obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
 obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o
lib/find_next_bit.c +65 -12

102 lines not on this page · raw message

#5 lore raw

Re: [git pull] generic bitops, take 2

Quoted 2 lines · Ingo Molnar

i've added Alexander's patch that does the cleanup suggested by you

Well.. Not really:

Quoted 6 lines
arch/um/Kconfig.x86_64 +0 -0
index 3fbe69e..7a75043 100644
@@ -27,6 +27,14 @@ config SMP_BROKEN
 	bool

arch/um/Kconfig.x86_64 config SMP_BROKEN · line 37

Quoted 10 lines
arch/um/Kconfig.x86_64 +8 -0
 	default y
 
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+

It still declares this GENERIC_FIND_*_BIT thing separately for UM.

Yes, that may _work_, but it's wrong to define it in two different places.

It also makes me wonder why Kconfig.i386 can just include arch/x86/Kconfig.cpu, but x86_64 cannot?

Linus

#6 lore raw

Re: [git pull] generic bitops, take 2

Quoted 25 lines · Linus Torvalds
Quoted 2 lines · Ingo Molnar

i've added Alexander's patch that does the cleanup suggested by you

Well.. Not really:

Quoted 6 lines
arch/um/Kconfig.x86_64 +0 -0
index 3fbe69e..7a75043 100644
@@ -27,6 +27,14 @@ config SMP_BROKEN
 	bool

arch/um/Kconfig.x86_64 config SMP_BROKEN · line 37

Quoted 10 lines
arch/um/Kconfig.x86_64 +8 -0
 	default y
 
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+

It still declares this GENERIC_FIND_*_BIT thing separately for UM.

Quoted 4 lines

Yes, that may _work_, but it's wrong to define it in two different places.

It also makes me wonder why Kconfig.i386 can just include arch/x86/Kconfig.cpu, but x86_64 cannot?

hm, indeed arch/um/Kconfig.i386 is assymetric to Kconfig.x86_64. Jeff Cc:-ed.

trying to see whether changing that would still result in a working UML arch i found that current UML doesnt seem to build here:

arch/um/os-Linux/helper.c: In function 'run_helper':
arch/um/os-Linux/helper.c:73: error: 'PATH_MAX' undeclared (first use in this function)

it needs the patch below.

then it fails with:

mm/filemap.c: In function '__generic_file_aio_write_nolock':
mm/filemap.c:1831: sorry, unimplemented: inlining failed in call to 'generic_write_checks': function body not available

i used:

make ARCH=um SUBARCH=x86_64 -j64 linux

on x86-64, gcc-4.3.0-0.13. Config is:

http://redhat.com/~mingo/misc/.config.um

i also tried gcc 4.2.3, that built it fine but didnt link it:

/opt/crosstool/gcc-4.2.3-glibc-2.3.6/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/4.2.3/../../../../x86_64-unknown-linux-gnu/bin/ld:
warning: ld-linux-x86-64.so.2, needed by /opt/crosstool/gcc-4.2.3-glibc-2.3.6/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sys-root/lib/../lib64/libc.so.6, not found (try using -rpath or -rpath-link) /opt/crosstool/gcc-4.2.3-glibc-2.3.6/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sys-root/lib/../lib64/libc.so.6:
undefined reference to `_dl_argv@GLIBC_PRIVATE'

...
/opt/crosstool/gcc-4.2.3-glibc-2.3.6/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/4.2.3/../../../../x86_64-unknown-linux-gnu/bin/ld:
warning: .fini_array section has zero size collect2: ld returned 1 exit
status
distcc[29125] ERROR: compile (null) on localhost failed
KSYM .tmp_kallsyms1.S
/opt/crosstool/gcc-4.2.3-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-nm:
'.tmp_vmlinux1': No such file

perhaps the combination of distcc and crosscompilers doesnt work well on UML? (it works fine with other architectures)

Ingo

--------------->
Subject: uml: fix
From: Ingo Molnar <[email protected]>
Date: Sat Apr 26 18:59:42 CEST 2008

---
 arch/um/os-Linux/helper.c |    1 +
 1 file changed, 1 insertion(+)
arch/um/os-Linux/helper.c +1 -0
Index: linux-x86.q/arch/um/os-Linux/helper.c
===================================================================
@@ -14,6 +14,7 @@
 #include "os.h"
 #include "um_malloc.h"
 #include "user.h"
+#include <linux/limits.h>
 
 struct helper_data {
 	void (*pre_exec)(void*);
#7 lore raw

Re: [git pull] generic bitops, take 2

Quoted 2 lines · Ingo Molnar

perhaps the combination of distcc and crosscompilers doesnt work well on UML? (it works fine with other architectures)

so i tried a third build method, gcc 3.4, and that built it fine but UML crashed during bootup:

dione:~/linux/linux-x86.q> ./linux
Core dump limits :
soft - 0
hard - NONE
Checking that ptrace can change system call numbers...OK Checking syscall emulation patch for ptrace...OK Checking advanced syscall emulation patch for ptrace...OK Checking for tmpfs mount on /dev/shm...OK Checking PROT_EXEC mmap in /dev/shm/...OK Checking for the skas3 patch in the host:
- /proc/mm...not found: No such file or directory
- PTRACE_FAULTINFO...not found
- PTRACE_LDT...not found
UML running in SKAS0 mode
Segmentation fault

(gdb) bt

#0  0x000000006020fd92 in txInit ()
#1  0x000000006000a4c1 in init_jfs_fs ()
#2  0x0000000060001794 in do_initcalls ()
#3  0x000000006000196d in do_basic_setup ()
#4  0x0000000060001a14 in kernel_init ()
#5  0x0000000060028427 in run_kernel_thread ()
#6  0x000000006001d020 in new_thread_handler ()
#7  0x0000000000000000 in ?? ()

rip 0x6020fd92 0x6020fd92 <txInit+306>

txInit is in JFS.

but at least i could build UML. (this is all with pristine -git)

So i checked the patch below. And it built fine, and boo^H^Hcrashed just like it did before:

- PTRACE_FAULTINFO...not found
- PTRACE_LDT...not found
UML running in SKAS0 mode
Segmentation fault

so i guess this is the way to go?

Ingo

---------------------->
Subject: uml: kconfig cleanup
From: Ingo Molnar <[email protected]>
Date: Sat Apr 26 19:10:17 CEST 2008

---
 arch/um/Kconfig.x86_64 |    7 +++++++
 1 file changed, 7 insertions(+)
arch/um/Kconfig.x86_64 +7 -0
Index: linux-x86.q/arch/um/Kconfig.x86_64
===================================================================
@@ -1,3 +1,10 @@
+
+menu "Host processor type and features"
+
+source "arch/x86/Kconfig.cpu"
+
+endmenu
+
 config UML_X86
 	bool
 	default y
#8 lore raw

[git pull] generic bitops, take 3

Quoted 3 lines · Ingo Molnar

So i checked the patch below. [...]

so i guess this is the way to go?

i think it is. I just put these fixes into the bitops tree and 64-bit UML seems unaffected and properly picks up these symbols from the x86 Kconfig.cpu file. I pushed out the v3 tree to:

git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-generic-bitops-v3.git for-linus

find the shortlog and diff below.

this is against your very latest tree (which i rebased against to pick up the VFS fix). 5 successful build+bootup tests done with this fresh tree:

#0, Sat_Apr_26_19_35_34_CEST_2008
#1, Sat_Apr_26_19_37_02_CEST_2008
#2, Sat_Apr_26_19_38_48_CEST_2008
#3, Sat_Apr_26_19_41_36_CEST_2008
#4, Sat_Apr_26_19_43_28_CEST_2008

on x86, mixed 32-bit/64-bit.

Ingo

------------------>
Alexander van Heukelum (13):
x86: change x86 to use generic find_next_bit
x86, uml: fix uml with generic find_next_bit for x86
x86, generic: optimize find_next_(zero_)bit for small constant-size bitmaps
x86: merge the simple bitops and move them to bitops.h
generic: introduce a generic __fls implementation
generic: implement __fls on all 64-bit archs
bitops: use __fls for fls64 on 64-bit archs
x86: generic versions of find_first_(zero_)bit, convert i386
x86: switch 64-bit to generic find_first_bit
x86: optimize find_first_bit for small bitmaps
x86, UML: remove x86-specific implementations of find_first_bit
x86: finalize bitops unification
x86, bitops: select the generic bitmap search functions

Ingo Molnar (2):
uml: fix build error
uml: Kconfig cleanup

Joe Perches (1):
x86: include/asm-x86/pgalloc.h/bitops.h: checkpatch cleanups - formatting only

 arch/um/Kconfig.x86_64             |    7 ++
 arch/um/os-Linux/helper.c          |    1 +
 arch/um/sys-i386/Makefile          |    2 +-
 arch/um/sys-x86_64/Makefile        |    2 +-
 arch/x86/Kconfig.cpu               |    7 ++-
 arch/x86/lib/Makefile              |    3 +-
 arch/x86/lib/bitops_32.c           |   70 --------------
 arch/x86/lib/bitops_64.c           |  175 ------------------------------------
 include/asm-alpha/bitops.h         |    5 +
 include/asm-generic/bitops/__fls.h |   43 +++++++++
 include/asm-generic/bitops/find.h  |    2 +
 include/asm-generic/bitops/fls64.h |   22 +++++
 include/asm-ia64/bitops.h          |   16 ++++
 include/asm-mips/bitops.h          |    5 +
 include/asm-parisc/bitops.h        |    1 +
 include/asm-powerpc/bitops.h       |    5 +
 include/asm-s390/bitops.h          |    1 +
 include/asm-sh/bitops.h            |    1 +
 include/asm-sparc64/bitops.h       |    1 +
 include/asm-x86/bitops.h           |  149 ++++++++++++++++++++++++++++---
 include/asm-x86/bitops_32.h        |  166 ----------------------------------
 include/asm-x86/bitops_64.h        |  162 ---------------------------------
 include/linux/bitops.h             |  140 ++++++++++++++++++++++++++++
 lib/Kconfig                        |    6 ++
 lib/Makefile                       |    1 +
 lib/find_next_bit.c                |   77 +++++++++++++---
 26 files changed, 467 insertions(+), 603 deletions(-)
 delete mode 100644 arch/x86/lib/bitops_32.c
 delete mode 100644 arch/x86/lib/bitops_64.c
 create mode 100644 include/asm-generic/bitops/__fls.h
 delete mode 100644 include/asm-x86/bitops_32.h
 delete mode 100644 include/asm-x86/bitops_64.h
arch/um/Kconfig.x86_64 +7 -0
index 3fbe69e..5696e7b 100644
@@ -1,3 +1,10 @@
+
+menu "Host processor type and features"
+
+source "arch/x86/Kconfig.cpu"
+
+endmenu
+
 config UML_X86
 	bool
 	default y
arch/um/os-Linux/helper.c +1 -0
index f4bd349..f25c29a 100644
@@ -14,6 +14,7 @@
 #include "os.h"
 #include "um_malloc.h"
 #include "user.h"
+#include <linux/limits.h>
 
 struct helper_data {
 	void (*pre_exec)(void*);
arch/um/sys-i386/Makefile +1 -1
index 964dc1a..598b5c1 100644
@@ -6,7 +6,7 @@ obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
 	ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
 	sys_call_table.o tls.o
 
-subarch-obj-y = lib/bitops_32.o lib/semaphore_32.o lib/string_32.o
+subarch-obj-y = lib/semaphore_32.o lib/string_32.o
 subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
 subarch-obj-$(CONFIG_MODULES) += kernel/module_32.o
 
arch/um/sys-x86_64/Makefile +1 -1
index 3c22de5..c8b4cce 100644
@@ -10,7 +10,7 @@ obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \
 
 obj-$(CONFIG_MODULES) += um_module.o
 
-subarch-obj-y = lib/bitops_64.o lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o
+subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o
 subarch-obj-$(CONFIG_MODULES) += kernel/module_64.o
 
 ldt-y = ../sys-i386/ldt.o
arch/x86/Kconfig.cpu +6 -1
index 4da3cdb..7ef18b0 100644
@@ -278,6 +278,11 @@ config GENERIC_CPU
 
 endchoice
 
+config X86_CPU
+	def_bool y
+	select GENERIC_FIND_FIRST_BIT
+	select GENERIC_FIND_NEXT_BIT
+
 config X86_GENERIC
 	bool "Generic x86 support"
 	depends on X86_32
@@ -398,7 +403,7 @@ config X86_TSC
 # generates cmov.
 config X86_CMOV
 	def_bool y
-	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7)
+	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || X86_64)
 
 config X86_MINIMUM_CPU_FAMILY
 	int
arch/x86/lib/Makefile +1 -2
index 25df1c1..76f60f5 100644
@@ -11,7 +11,7 @@ lib-y += memcpy_$(BITS).o
 ifeq ($(CONFIG_X86_32),y)
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += bitops_32.o semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
@@ -21,7 +21,6 @@ else
 
         lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
         lib-y += thunk_64.o clear_page_64.o copy_page_64.o
-        lib-y += bitops_64.o
         lib-y += memmove_64.o memset_64.o
         lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o
 endif
arch/x86/lib/bitops_32.c deleted +0 -70

70 lines not on this page · raw message

arch/x86/lib/bitops_64.c deleted +0 -175

175 lines not on this page · raw message

include/asm-alpha/bitops.h +5 -0
index 9e19a70..15f3ae2 100644
@@ -388,6 +388,11 @@ static inline int fls64(unsigned long x)
 }
 #endif
 
+static inline unsigned long __fls(unsigned long x)
+{
+	return fls64(x) - 1;
+}
+
 static inline int fls(int x)
 {
 	return fls64((unsigned int) x);
include/asm-generic/bitops/__fls.h new file +43 -0

43 lines not on this page · raw message

include/asm-generic/bitops/find.h +2 -0
index 72a51e5..1914e97 100644
@@ -1,11 +1,13 @@
 #ifndef _ASM_GENERIC_BITOPS_FIND_H_
 #define _ASM_GENERIC_BITOPS_FIND_H_
 
+#ifndef CONFIG_GENERIC_FIND_NEXT_BIT
 extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
 		size, unsigned long offset);
 
 extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
 		long size, unsigned long offset);
+#endif
 
 #define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
 #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
include/asm-generic/bitops/fls64.h +22 -0
index 1b6b17c..86d403f 100644
@@ -3,6 +3,18 @@
 
 #include <asm/types.h>
 
+/**
+ * fls64 - find last set bit in a 64-bit word
+ * @x: the word to search
+ *
+ * This is defined in a similar way as the libc and compiler builtin
+ * ffsll, but returns the position of the most significant set bit.
+ *
+ * fls64(value) returns 0 if value is 0 or the position of the last
+ * set bit if value is nonzero. The last (most significant) bit is
+ * at position 64.
+ */
+#if BITS_PER_LONG == 32
 static inline int fls64(__u64 x)
 {
 	__u32 h = x >> 32;
@@ -10,5 +22,15 @@ static inline int fls64(__u64 x)
 		return fls(h) + 32;
 	return fls(x);
 }
+#elif BITS_PER_LONG == 64
+static inline int fls64(__u64 x)
+{
+	if (x == 0)
+		return 0;
+	return __fls(x) + 1;
+}
+#else
+#error BITS_PER_LONG not 32 or 64
+#endif
 
 #endif /* _ASM_GENERIC_BITOPS_FLS64_H_ */
include/asm-ia64/bitops.h +16 -0
index 953d3df..e2ca800 100644
@@ -407,6 +407,22 @@ fls (int t)
 	return ia64_popcnt(x);
 }
 
+/*
+ * Find the last (most significant) bit set.  Undefined for x==0.
+ * Bits are numbered from 0..63 (e.g., __fls(9) == 3).
+ */
+static inline unsigned long
+__fls (unsigned long x)
+{
+	x |= x >> 1;
+	x |= x >> 2;
+	x |= x >> 4;
+	x |= x >> 8;
+	x |= x >> 16;
+	x |= x >> 32;
+	return ia64_popcnt(x) - 1;
+}
+
 #include <asm-generic/bitops/fls64.h>
 
 /*
include/asm-mips/bitops.h +5 -0
index ec75ce4..c2bd126 100644
@@ -591,6 +591,11 @@ static inline int __ilog2(unsigned long x)
 	return 63 - lz;
 }
 
+static inline unsigned long __fls(unsigned long x)
+{
+	return __ilog2(x);
+}
+
 #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
 
 /*
include/asm-parisc/bitops.h +1 -0
index f8eebcb..7a6ea10 100644
@@ -210,6 +210,7 @@ static __inline__ int fls(int x)
 	return ret;
 }
 
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/lock.h>
include/asm-powerpc/bitops.h +5 -0
index a99a749..897eade 100644
@@ -313,6 +313,11 @@ static __inline__ int fls(unsigned int x)
 	return 32 - lz;
 }
 
+static __inline__ unsigned long __fls(unsigned long x)
+{
+	return __ilog2(x);
+}
+
 /*
  * 64-bit can do this using one cntlzd (count leading zeroes doubleword)
  * instruction; for 32-bit we use the generic version, which does two
include/asm-s390/bitops.h +1 -0
index 965394e..b4eb24a 100644
@@ -769,6 +769,7 @@ static inline int sched_find_first_bit(unsigned long *b)
 }
 
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #include <asm-generic/bitops/hweight.h>
include/asm-sh/bitops.h +1 -0
index b6ba5a6..d7d382f 100644
@@ -95,6 +95,7 @@ static inline unsigned long ffz(unsigned long word)
 #include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #endif /* __KERNEL__ */
include/asm-sparc64/bitops.h +1 -0
index 982ce89..11f9d81 100644
@@ -34,6 +34,7 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr);
 #include <asm-generic/bitops/ffz.h>
 #include <asm-generic/bitops/__ffs.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #ifdef __KERNEL__
include/asm-x86/bitops.h +136 -13

167 lines not on this page · raw message

include/asm-x86/bitops_32.h deleted +0 -166

166 lines not on this page · raw message

include/asm-x86/bitops_64.h deleted +0 -162

162 lines not on this page · raw message

include/linux/bitops.h +140 -0

144 lines not on this page · raw message

lib/Kconfig +6 -0
index 2d53dc0..8cc8e87 100644
@@ -7,6 +7,12 @@ menu "Library routines"
 config BITREVERSE
 	tristate
 
+config GENERIC_FIND_FIRST_BIT
+	def_bool n
+
+config GENERIC_FIND_NEXT_BIT
+	def_bool n
+
 config CRC_CCITT
 	tristate "CRC-CCITT functions"
 	help
lib/Makefile +1 -0
index bf8000f..2d7001b 100644
@@ -29,6 +29,7 @@ obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
 obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
+lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o
 lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o
 obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
 obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o
lib/find_next_bit.c +65 -12

102 lines not on this page · raw message

#9 lore raw

Re: [git pull] generic bitops, take 2

In reply to Ingo Molnar
Quoted 28 lines · Ingo Molnar
Quoted 25 lines · Linus Torvalds
Quoted 2 lines · Ingo Molnar

i've added Alexander's patch that does the cleanup suggested by you

Well.. Not really:

Quoted 6 lines
arch/um/Kconfig.x86_64 +0 -0
index 3fbe69e..7a75043 100644
@@ -27,6 +27,14 @@ config SMP_BROKEN
 	bool

arch/um/Kconfig.x86_64 config SMP_BROKEN · line 37

Quoted 10 lines
arch/um/Kconfig.x86_64 +8 -0
 	default y
 
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+

It still declares this GENERIC_FIND_*_BIT thing separately for UM.

Quoted 7 lines
Quoted 4 lines

Yes, that may _work_, but it's wrong to define it in two different places.

It also makes me wonder why Kconfig.i386 can just include arch/x86/Kconfig.cpu, but x86_64 cannot?

hm, indeed arch/um/Kconfig.i386 is assymetric to Kconfig.x86_64. Jeff Cc:-ed.

I may be able to explain why..
Before the x68 merge we had an arch/i386/Kconfig.cpu but we did not have any arch/x86_64/Kconfig.cpu.
When we merged i386 and x86_64 we included the 64 bit stuff in arch/x86/Kconfig.cpu and thus it became used by both 32bit and 64bit x86. But during this process we did not do the proper unification of um - so here we live with the old style.
Blame the one who did the Kconfig unification..

I would assume um should do similar unifaction and get rid of the i386/x86_64 split (bot I have not looked at doing it).

Sam

#10 lore raw

Re: [git pull] generic bitops, take 2

In reply to Ingo Molnar
Quoted 5 lines

then it fails with:

mm/filemap.c: In function '__generic_file_aio_write_nolock':
mm/filemap.c:1831: sorry, unimplemented: inlining failed in call to 'generic_write_checks': function body not available

Quoted 7 lines

i used:

   make ARCH=um SUBARCH=x86_64 -j64 linux

on x86-64, gcc-4.3.0-0.13. Config is:

http://redhat.com/~mingo/misc/.config.um

I just hit this bug as well:

make linux ARCH=um

on i686, gcc 4.3.0, config at
http://uml.nagafix.co.uk/kernels/kernel32-2.6.25.config

Thanks.

#11 lore raw

PATCH 1/1 reiserfs: some functions mustn't be inline

In reply to Ingo Molnar

This patch fixes the following build errors with UML and gcc 4.3:

<-- snip -->

...
CC fs/reiserfs/do_balan.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c: In function ‘balance_leaf’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c:34: sorry, unimplemented: inlining failed in call to ‘do_balance_mark_leaf_dirty’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c:1018: sorry, unimplemented: called from here /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c:34: sorry, unimplemented: inlining failed in call to ‘do_balance_mark_leaf_dirty’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c:1174: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/do_balan.o] Error 1
...
CC fs/reiserfs/namei.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/namei.c: In function ‘search_by_entry_key’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/namei.c:66: sorry, unimplemented: inlining failed in call to ‘set_de_name_and_namelen’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/namei.c:162: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/namei.o] Error 1
...
CC fs/reiserfs/inode.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/inode.c: In function ‘reiserfs_get_block’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/inode.c:108: sorry, unimplemented: inlining failed in call to ‘make_le_item_head’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/inode.c:776: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/inode.o] Error 1
...
CC fs/reiserfs/stree.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c: In function ‘comp_keys’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:86: sorry, unimplemented: inlining failed in call to ‘comp_short_keys’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:111: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/stree.o] Error 1
...
CC fs/reiserfs/stree.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c: In function ‘get_lkey’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:61: sorry, unimplemented: inlining failed in call to ‘B_IS_IN_TREE’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:265: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/stree.o] Error 1
...
CC fs/reiserfs/stree.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c: In function ‘key_in_buffer’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:294: sorry, unimplemented: inlining failed in call to ‘get_rkey’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:356: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/stree.o] Error 1
...
CC fs/reiserfs/stree.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c: In function ‘prepare_for_delete_or_cut’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:74: sorry, unimplemented: inlining failed in call to ‘copy_item_head’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:1041: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/stree.o] Error 1
...
CC fs/reiserfs/stree.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c: In function ‘reiserfs_delete_solid_item’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:153: sorry, unimplemented: inlining failed in call to ‘le_key2cpu_key’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:1335: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/stree.o] Error 1
...
CC fs/reiserfs/stree.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c: In function ‘decrement_counters_in_path’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:362: sorry, unimplemented: inlining failed in call to ‘decrement_bcount’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/stree.c:387: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/stree.o] Error 1

<-- snip -->

---

 fs/reiserfs/do_balan.c |    4 ++--
 fs/reiserfs/inode.c    |    8 ++++----
 fs/reiserfs/namei.c    |    2 +-
 fs/reiserfs/stree.c    |   17 ++++++++---------
 4 files changed, 15 insertions(+), 16 deletions(-)

da1507ac13cfd50db5dddc0186e0ff1f1ae26517 diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c index 7ee4208..42be2a6 100644

fs/reiserfs/do_balan.c +2 -2
@@ -29,8 +29,8 @@ struct tree_balance *cur_tb = NULL;	/* detects whether more than one
 					   is interrupting do_balance */
 #endif
 
-inline void do_balance_mark_leaf_dirty(struct tree_balance *tb,
-				       struct buffer_head *bh, int flag)
+void do_balance_mark_leaf_dirty(struct tree_balance *tb,
+				struct buffer_head *bh, int flag)
 {
 	journal_mark_dirty(tb->transaction_handle,
 			   tb->transaction_handle->t_super, bh);
fs/reiserfs/inode.c +4 -4
index 5791793..3e06b99 100644
@@ -101,10 +101,10 @@ void make_cpu_key(struct cpu_key *key, struct inode *inode, loff_t offset,
 //
 // when key is 0, do not set version and short key
 //
-inline void make_le_item_head(struct item_head *ih, const struct cpu_key *key,
-			      int version,
-			      loff_t offset, int type, int length,
-			      int entry_count /*or ih_free_space */ )
+void make_le_item_head(struct item_head *ih, const struct cpu_key *key,
+		       int version,
+		       loff_t offset, int type, int length,
+		       int entry_count /*or ih_free_space */ )
 {
 	if (key) {
 		ih->ih_key.k_dir_id = cpu_to_le32(key->on_disk_key.k_dir_id);
fs/reiserfs/namei.c +1 -1
index 8867533..f592296 100644
@@ -62,7 +62,7 @@ static inline void set_de_item_location(struct reiserfs_dir_entry *de,
 }
 
 // de_bh, de_ih, de_deh (points to first element of array), de_item_num is set
-inline void set_de_name_and_namelen(struct reiserfs_dir_entry *de)
+void set_de_name_and_namelen(struct reiserfs_dir_entry *de)
 {
 	struct reiserfs_de_head *deh = de->de_deh + de->de_entry_num;
 
fs/reiserfs/stree.c +8 -9
index d2db241..9b84b4c 100644
@@ -57,7 +57,7 @@
 #include <linux/quotaops.h>
 
 /* Does the buffer contain a disk block which is in the tree. */
-inline int B_IS_IN_TREE(const struct buffer_head *p_s_bh)
+int B_IS_IN_TREE(const struct buffer_head *p_s_bh)
 {
 
 	RFALSE(B_LEVEL(p_s_bh) > MAX_HEIGHT,
@@ -69,8 +69,7 @@ inline int B_IS_IN_TREE(const struct buffer_head *p_s_bh)
 //
 // to gets item head in le form
 //
-inline void copy_item_head(struct item_head *p_v_to,
-			   const struct item_head *p_v_from)
+void copy_item_head(struct item_head *p_v_to, const struct item_head *p_v_from)
 {
 	memcpy(p_v_to, p_v_from, IH_SIZE);
 }
@@ -81,8 +80,8 @@ inline void copy_item_head(struct item_head *p_v_to,
    Returns: -1 if key1 < key2 
    0 if key1 == key2
    1 if key1 > key2 */
-inline int comp_short_keys(const struct reiserfs_key *le_key,
-			   const struct cpu_key *cpu_key)
+int comp_short_keys(const struct reiserfs_key *le_key,
+		    const struct cpu_key *cpu_key)
 {
 	__u32 n;
 	n = le32_to_cpu(le_key->k_dir_id);
@@ -150,7 +149,7 @@ inline int comp_short_le_keys(const struct reiserfs_key *key1,
 	return 0;
 }
 
-inline void le_key2cpu_key(struct cpu_key *to, const struct reiserfs_key *from)
+void le_key2cpu_key(struct cpu_key *to, const struct reiserfs_key *from)
 {
 	int version;
 	to->on_disk_key.k_dir_id = le32_to_cpu(from->k_dir_id);
@@ -289,8 +288,8 @@ static inline const struct reiserfs_key *get_lkey(const struct treepath
 }
 
 /* Get delimiting key of the buffer at the path and its right neighbor. */
-inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
-					   const struct super_block *p_s_sb)
+const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
+				    const struct super_block *p_s_sb)
 {
 	int n_position, n_path_offset = p_s_chk_path->path_length;
 	struct buffer_head *p_s_parent;
@@ -359,7 +358,7 @@ static inline int key_in_buffer(struct treepath *p_s_chk_path,	/* Path which sho
 	return 1;
 }
 
-inline void decrement_bcount(struct buffer_head *p_s_bh)
+void decrement_bcount(struct buffer_head *p_s_bh)
 {
 	if (p_s_bh) {
 		if (atomic_read(&(p_s_bh->b_count))) {

--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#12 lore raw

Re: [2.6 patch] reiserfs: some functions mustn't be inline

Quoted 4 lines · Adrian Bunk

This patch fixes the following build errors with UML and gcc 4.3:

<-- snip -->

Quoted 8 lines

...
CC fs/reiserfs/do_balan.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c: In function ‘balance_leaf’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c:34: sorry, unimplemented: inlining failed in call to ‘do_balance_mark_leaf_dirty’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c:1018: sorry, unimplemented: called from here /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c:34: sorry, unimplemented: inlining failed in call to ‘do_balance_mark_leaf_dirty’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/reiserfs/do_balan.c:1174: sorry, unimplemented: called from here
make[3]: *** [fs/reiserfs/do_balan.o] Error 1

Hello.
I would make some of them static inline (my version is appended).

Thanks,
Edward.

Make the following functions static inline:

. do_balance_mark_leaf_dirty
. set_de_name_and_namelen
. comp_short_keys
. B_IS_IN_TREE
. copy_item_head
. le_key2cpu_key
. decrement_bcount

---
 linux-2.6.25-mm1/fs/reiserfs/do_balan.c      |   10 --
 linux-2.6.25-mm1/fs/reiserfs/inode.c         |    8 +-
 linux-2.6.25-mm1/fs/reiserfs/namei.c         |   12 ---
 linux-2.6.25-mm1/fs/reiserfs/stree.c         |   77 ---------------------
 linux-2.6.25-mm1/include/linux/reiserfs_fs.h |   99 +++++++++++++++++++++++----
 5 files changed, 93 insertions(+), 113 deletions(-)
fs/reiserfs/do_balan.c renamed from fs/reiserfs/do_balan.c.orig +0 -10
@@ -29,16 +29,6 @@
 					   is interrupting do_balance */
 #endif
 
-inline void do_balance_mark_leaf_dirty(struct tree_balance *tb,
-				       struct buffer_head *bh, int flag)
-{
-	journal_mark_dirty(tb->transaction_handle,
-			   tb->transaction_handle->t_super, bh);
-}
-
-#define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty
-#define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty
-
 /* summary: 
  if deleting something ( tb->insert_size[0] < 0 )
    return(balance_leaf_when_delete()); (flag d handled here)
fs/reiserfs/inode.c renamed from fs/reiserfs/inode.c.orig +4 -4
@@ -101,10 +101,10 @@
 //
 // when key is 0, do not set version and short key
 //
-inline void make_le_item_head(struct item_head *ih, const struct cpu_key *key,
-			      int version,
-			      loff_t offset, int type, int length,
-			      int entry_count /*or ih_free_space */ )
+void make_le_item_head(struct item_head *ih, const struct cpu_key *key,
+		       int version,
+		       loff_t offset, int type, int length,
+		       int entry_count /*or ih_free_space */ )
 {
 	if (key) {
 		ih->ih_key.k_dir_id = cpu_to_le32(key->on_disk_key.k_dir_id);
fs/reiserfs/namei.c renamed from fs/reiserfs/namei.c.orig +0 -12
@@ -62,18 +62,6 @@
 }
 
 // de_bh, de_ih, de_deh (points to first element of array), de_item_num is set
-inline void set_de_name_and_namelen(struct reiserfs_dir_entry *de)
-{
-	struct reiserfs_de_head *deh = de->de_deh + de->de_entry_num;
-
-	BUG_ON(de->de_entry_num >= ih_entry_count(de->de_ih));
-
-	de->de_entrylen = entry_length(de->de_bh, de->de_ih, de->de_entry_num);
-	de->de_namelen = de->de_entrylen - (de_with_sd(deh) ? SD_SIZE : 0);
-	de->de_name = B_I_PITEM(de->de_bh, de->de_ih) + deh_location(deh);
-	if (de->de_name[de->de_namelen - 1] == 0)
-		de->de_namelen = strlen(de->de_name);
-}
 
 // what entry points to
 static inline void set_de_object_key(struct reiserfs_dir_entry *de)
fs/reiserfs/stree.c renamed from fs/reiserfs/stree.c.orig +2 -75

114 lines not on this page · raw message

include/linux/reiserfs_fs.h renamed from include/linux/reiserfs_fs.h.orig +87 -12

135 lines not on this page · raw message

--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#13 lore raw

PATCH 1/1 net/ipv4/ip_output.c:ip_send_check() mustn't be inline

In reply to Ingo Molnar

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC net/ipv4/ip_output.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/net/ipv4/ip_output.c: In function ‘__ip_local_out’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/net/ipv4/ip_output.c:89: sorry, unimplemented: inlining failed in call to ‘ip_send_check’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/net/ipv4/ip_output.c:99: sorry, unimplemented: called from here
make[3]: *** [net/ipv4/ip_output.o] Error 1

<-- snip -->

---
936e490777359bfde622148ff5af1e19d8c248b5 diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 0834926..985a719 100644

net/ipv4/ip_output.c +1 -1
@@ -85,7 +85,7 @@
 int sysctl_ip_default_ttl __read_mostly = IPDEFTTL;
 
 /* Generate a checksum for an outgoing IP datagram. */
-__inline__ void ip_send_check(struct iphdr *iph)
+void ip_send_check(struct iphdr *iph)
 {
 	iph->check = 0;
 	iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
#14 lore raw

PATCH 1/1 mm/filemap.c:generic_write_checks() mustn't be inline

In reply to Ingo Molnar
Quoted 6 lines · Ingo Molnar

...
then it fails with:

mm/filemap.c: In function '__generic_file_aio_write_nolock':
mm/filemap.c:1831: sorry, unimplemented: inlining failed in call to 'generic_write_checks': function body not available

Quoted 8 lines

i used:

   make ARCH=um SUBARCH=x86_64 -j64 linux

on x86-64, gcc-4.3.0-0.13. Config is:

http://redhat.com/~mingo/misc/.config.um
...

Patch below.

Quoted 2 lines

Ingo
...

cu
Adrian

<-- snip -->

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC mm/filemap.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/mm/filemap.c: In function ‘__generic_file_aio_write_nolock’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/mm/filemap.c:1831: sorry, unimplemented: inlining failed in call to ‘generic_write_checks’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/mm/filemap.c:2383: sorry, unimplemented: called from here
make[2]: *** [mm/filemap.o] Error 1

<-- snip -->

---
e4a4374513a2b23060bb385d83f1e67427b1b665 diff --git a/mm/filemap.c b/mm/filemap.c index 07e9d92..576b553 100644

mm/filemap.c +2 -1
@@ -1827,7 +1827,8 @@ EXPORT_SYMBOL(iov_iter_single_seg_count);
  * Returns appropriate error code that caller should return or
  * zero in case that write should be allowed.
  */
-inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk)
+int generic_write_checks(struct file *file, loff_t *pos, size_t *count,
+			 int isblk)
 {
 	struct inode *inode = file->f_mapping->host;
 	unsigned long limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
#15 lore raw

PATCH 1/1 fs/buffer.c:init_buffer() mustn't be inline

In reply to Ingo Molnar

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC fs/buffer.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c: In function ‘init_page_buffers’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c:51: sorry, unimplemented: inlining failed in call to ‘init_buffer’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c:1007: sorry, unimplemented: called from here
make[2]: *** [fs/buffer.o] Error 1

<-- snip -->

---
922267dbec9ea632537ab61ef9cb2d0d5f9d8f9e diff --git a/fs/buffer.c b/fs/buffer.c index 39ff144..d74743d 100644

fs/buffer.c +1 -2
@@ -46,8 +46,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list);
 
 #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers)
 
-inline void
-init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private)
+void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private)
 {
 	bh->b_end_io = handler;
 	bh->b_private = private;
#16 lore raw

Re: [2.6 patch] fs/buffer.c:init_buffer() mustn't be inline

On Mon, 28 Apr 2008, Adrian Bunk wrote:
<

Quoted 10 lines

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC fs/buffer.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c: In function ‘init_page_buffers’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c:51: sorry, unimplemented: inlining failed in call to ‘init_buffer’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c:1007: sorry, unimplemented: called from here
make[2]: *** [fs/buffer.o] Error 1

Can somebody tell why this is not a gcc bug?

Linus

#17 lore raw

Re: [2.6 patch] fs/buffer.c:init_buffer() mustn't be inline

Quoted 8 lines · Linus Torvalds

On Mon, 28 Apr 2008, Adrian Bunk wrote:
<

Quoted 4 lines

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

Quoted 8 lines
Quoted 6 lines

...
CC fs/buffer.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c: In function ‘init_page_buffers’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c:51: sorry, unimplemented: inlining failed in call to ‘init_buffer’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/buffer.c:1007: sorry, unimplemented: called from here
make[2]: *** [fs/buffer.o] Error 1

Can somebody tell why this is not a gcc bug?

It is a gcc bug.

But having a global function marked as extern was already questionable, and all assumptions an "inline" would always inline the code are anyway now broken in your tree.

So let's work around a gcc bug by fixing the kernel...

Quoted 1 line

Linus

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#18 lore raw

Re: [2.6 patch] fs/buffer.c:init_buffer() mustn't be inline

Quoted 10 lines · Adrian Bunk
Quoted 2 lines

Can somebody tell why this is not a gcc bug?

It is a gcc bug.

But having a global function marked as extern was already questionable, and all assumptions an "inline" would always inline the code are anyway now broken in your tree.

So let's work around a gcc bug by fixing the kernel...

But when doing this, MARK IT LOUDLY AS A GCC BUG!

The thing is, reading that log message, it was not at all clear why that change was made. Please make it clear why, rather than quoting a totally useless error message that doesn't actually tell what is going on.

I agree that having work-arounds for compiler bugs is worth it (assuming the version is common enough to worry about), but I also don't want to have unexplained commits doing something that on the face of it is just odd

Put another way: looking at the actual diff and looking at the commit message, the only sane reaction from somebody who knows the code is:
"Whaa? WTF?". Saying "This is a gcc bug" would have turned that "WTF?" into a "Oh, ok then".

Linus

#19 lore raw

PATCH 1/1 fs/block_dev.c:I_BDEV() mustn't be inline

In reply to Ingo Molnar

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC fs/block_dev.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/block_dev.c: In function ‘blkdev_get_block’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/block_dev.c:42: sorry, unimplemented: inlining failed in call to ‘I_BDEV’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/block_dev.c:119: sorry, unimplemented: called from here /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/block_dev.c:42: sorry, unimplemented: inlining failed in call to ‘I_BDEV’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/block_dev.c:131: sorry, unimplemented: called from here
make[2]: *** [fs/block_dev.o] Error 1

<-- snip -->

---
cd324c3df8a964c6abe03828861238ea3083ba02 diff --git a/fs/block_dev.c b/fs/block_dev.c index 7d822fa..ce9ea3e 100644

fs/block_dev.c +1 -1
@@ -38,7 +38,7 @@ static inline struct bdev_inode *BDEV_I(struct inode *inode)
 	return container_of(inode, struct bdev_inode, vfs_inode);
 }
 
-inline struct block_device *I_BDEV(struct inode *inode)
+struct block_device *I_BDEV(struct inode *inode)
 {
 	return &BDEV_I(inode)->bdev;
 }
#20 lore raw

Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

Quoted 2 lines · Adrian Bunk

This patch fixes the following build error with UML and gcc 4.3:

I'm not going to apply these before I understand what the breakage is all about.

fs/block_dev.c static inline struct bdev_inode *BDEV_I(struct inode *inode) · line 44

Quoted 5 lines
fs/block_dev.c +1 -1
-inline struct block_device *I_BDEV(struct inode *inode)
+struct block_device *I_BDEV(struct inode *inode)
 {
 	return &BDEV_I(inode)->bdev;
 }

There is NO WAY IN HELL this function shouldn't be inlined, and it doesn't matter a whit if some users outside of this file then also want the non-inlined version.

The whole setup should result in a single offset-of from the inode, ie we're talking something that normally generates no code at all when inlined (because the offset will be subsumed into whatever actually uses the result).

So just removing the inline is simply not acceptable any more, since it just implies total and utter breakage of the compiler. At some point you just have to say: "That is sh*t", and not take it any more.

What is UML doing to trigger this?

Or should be just tell people that gcc-4.3 is unusable crap?

Linus

maintainer
#21 lore raw

Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

Quoted 3 lines · Linus Torvalds

There is NO WAY IN HELL this function shouldn't be inlined, and it doesn't matter a whit if some users outside of this file then also want the non-inlined version.

AFAICS, it's a gcc bug. We have
extern struct block_device *I_BDEV(struct inode *inode); followed by
inline struct block_device *I_BDEV(struct inode *inode) {
...
}

and presence of declaration with extern within the same translation unit means that definition we have here is an external one, per 6.7.4. It's perfectly legitimate and gcc has no business complaining about inline here; moreover, example in 6.7.4(7) is essentially the same thing...

#22 lore raw

Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

Quoted 2 lines · Al Viro

AFAICS, it's a gcc bug.

So did the "always_inline" thing just hide this? Or what is going on?

We can just say that gcc-3 has to always_inline if so.

Linus

#23 lore raw

Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

In reply to Linus Torvalds
Quoted 5 lines · Linus Torvalds

So just removing the inline is simply not acceptable any more, since it just implies total and utter breakage of the compiler. At some point you just have to say: "That is sh*t", and not take it any more.

What is UML doing to trigger this?

Beats the crap out of me. These things are very generic code from UML's point of view.

Jeff

Signature · 1 line
Work email - jdike at linux dot intel dot com
#24 lore raw

Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

Quoted 9 lines · Jeff Dike
Quoted 5 lines · Linus Torvalds

So just removing the inline is simply not acceptable any more, since it just implies total and utter breakage of the compiler. At some point you just have to say: "That is sh*t", and not take it any more.

What is UML doing to trigger this?

Beats the crap out of me. These things are very generic code from UML's point of view.

How does the preprocessed code look like around the definition and the declaration + use of said function?

Try to do an:
make path/to/file.i

To see the preprocessed output.

Just in case we have some subtle things going on..

Sam

#25 lore raw

Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

In reply to Linus Torvalds
Quoted 9 lines · Linus Torvalds

...

fs/block_dev.c static inline struct bdev_inode *BDEV_I(struct inode *inode) · line 44

Quoted 5 lines
fs/block_dev.c +1 -1
-inline struct block_device *I_BDEV(struct inode *inode)
+struct block_device *I_BDEV(struct inode *inode)
 {
 	return &BDEV_I(inode)->bdev;
 }

There is NO WAY IN HELL this function shouldn't be inlined,
...

Then CONFIG_OPTIMIZE_INLINING already broke it in your tree.

Quoted 1 line

Linus

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#26 lore raw

Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

Quoted 11 lines · Adrian Bunk
Quoted 9 lines · Linus Torvalds

...

fs/block_dev.c static inline struct bdev_inode *BDEV_I(struct inode *inode) · line 44

Quoted 5 lines
fs/block_dev.c +1 -1
-inline struct block_device *I_BDEV(struct inode *inode)
+struct block_device *I_BDEV(struct inode *inode)
 {
 	return &BDEV_I(inode)->bdev;
 }

There is NO WAY IN HELL this function shouldn't be inlined,
...

Quoted 1 line

Then CONFIG_OPTIMIZE_INLINING already broke it in your tree.

Can you please help me here.
Previously we said: gcc shall inline
Now we say: hi gcc - it is a good idea to inline this

But even without any inline annotation we would expect gcc to inline it based on normal heuristics simply due to the small size/footprint of the function.

So I cannot see how the CONFIG_OPTIMIZE_INLINING have any effect here.
It all smells like a gcc bug to me.

Sam

#27 lore raw

Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

Quoted 12 lines · Sam Ravnborg
Quoted 11 lines · Adrian Bunk
Quoted 9 lines · Linus Torvalds

...

fs/block_dev.c static inline struct bdev_inode *BDEV_I(struct inode *inode) · line 44

Quoted 5 lines
fs/block_dev.c +1 -1
-inline struct block_device *I_BDEV(struct inode *inode)
+struct block_device *I_BDEV(struct inode *inode)
 {
 	return &BDEV_I(inode)->bdev;
 }

There is NO WAY IN HELL this function shouldn't be inlined,
...

Quoted 5 lines
Quoted 1 line

Then CONFIG_OPTIMIZE_INLINING already broke it in your tree.

Can you please help me here.
Previously we said: gcc shall inline
Now we say: hi gcc - it is a good idea to inline this

Previosly we said:
"inline" means "must inline"

With CONFIG_OPTIMIZE_INLINING=y we say:
"inline" means "try a bit harder to inline"

Quoted 3 lines

But even without any inline annotation we would expect gcc to inline it based on normal heuristics simply due to the small size/footprint of the function.

gcc anyway has to emit one global copy of this function.

And with the common CONFIG_CC_OPTIMIZE_FOR_SIZE=y we tell gcc to focus on getting the smallest possible code.

Quoted 3 lines

So I cannot see how the CONFIG_OPTIMIZE_INLINING have any effect here.
It all smells like a gcc bug to me.

The compile error is a gcc bug.

Quoted 1 line

Sam

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#28 lore raw

PATCH 1/1 block/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline

In reply to Ingo Molnar

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC block/blk-barrier.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c: In function ‘blk_do_ordered’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:57: sorry, unimplemented: inlining failed in call to ‘blk_ordered_cur_seq’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:252: sorry, unimplemented: called from here /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:57: sorry, unimplemented: inlining failed in call to ‘blk_ordered_cur_seq’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:253: sorry, unimplemented: called from here
make[2]: *** [block/blk-barrier.o] Error 1

<-- snip -->

---
e322a237766808e2c198f4521a9c8ba1fae6b77c diff --git a/block/blk-barrier.c b/block/blk-barrier.c index 55c5f1f..2b9f2e9 100644

block/blk-barrier.c +1 -1
@@ -53,7 +53,7 @@ EXPORT_SYMBOL(blk_queue_ordered);
 /*
  * Cache flushing for ordered writes handling
  */
-inline unsigned blk_ordered_cur_seq(struct request_queue *q)
+unsigned blk_ordered_cur_seq(struct request_queue *q)
 {
 	if (!q->ordseq)
 		return 0;
Applied
#29 lore raw

Re: [2.6 patch] block/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline

Quoted 13 lines · Adrian Bunk

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC block/blk-barrier.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c: In function ???blk_do_ordered???:
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:57: sorry, unimplemented: inlining failed in call to ???blk_ordered_cur_seq???: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:252: sorry, unimplemented: called from here /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:57: sorry, unimplemented: inlining failed in call to ???blk_ordered_cur_seq???: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:253: sorry, unimplemented: called from here
make[2]: *** [block/blk-barrier.o] Error 1

Quoted 3 lines

<-- snip -->

Applied

Signature · 1 line
Jens Axboe
#30 lore raw

PATCH 1/1 fs/udf/partition.c:udf_get_pblock() mustn't be inline

In reply to Ingo Molnar

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC fs/udf/partition.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/udf/partition.c: In function ‘udf_get_pblock_virt15’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/udf/partition.c:32: sorry, unimplemented: inlining failed in call to ‘udf_get_pblock’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/udf/partition.c:102: sorry, unimplemented: called from here
make[3]: *** [fs/udf/partition.o] Error 1

<-- snip -->

---
9739b5f94fdf781f71cbb4c7b2f8f6d9e3d58e55 diff --git a/fs/udf/partition.c b/fs/udf/partition.c index 63610f0..96dfd20 100644

fs/udf/partition.c +2 -2
@@ -27,8 +27,8 @@
 #include <linux/slab.h>
 #include <linux/buffer_head.h>
 
-inline uint32_t udf_get_pblock(struct super_block *sb, uint32_t block,
-			       uint16_t partition, uint32_t offset)
+uint32_t udf_get_pblock(struct super_block *sb, uint32_t block,
+			uint16_t partition, uint32_t offset)
 {
 	struct udf_sb_info *sbi = UDF_SB(sb);
 	struct udf_part_map *map;
maintainer
#31 lore raw

Re: [2.6 patch] fs/udf/partition.c:udf_get_pblock() mustn't be inline

Quoted 11 lines · Adrian Bunk

This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC fs/udf/partition.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/udf/partition.c: In function ‘udf_get_pblock_virt15’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/fs/udf/partition.c:32: sorry, unimplemented: inlining failed in call to ‘udf_get_pblock’: function body not available /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/udf/partition.c:102: sorry, unimplemented: called from here
make[3]: *** [fs/udf/partition.o] Error 1

Quoted 3 lines

<-- snip -->

Thanks. Merged into UDF git tree.

Honza

Quoted 17 lines

---
9739b5f94fdf781f71cbb4c7b2f8f6d9e3d58e55 diff --git a/fs/udf/partition.c b/fs/udf/partition.c index 63610f0..96dfd20 100644

fs/udf/partition.c +2 -2
@@ -27,8 +27,8 @@
 #include <linux/slab.h>
 #include <linux/buffer_head.h>
 
-inline uint32_t udf_get_pblock(struct super_block *sb, uint32_t block,
-			       uint16_t partition, uint32_t offset)
+uint32_t udf_get_pblock(struct super_block *sb, uint32_t block,
+			uint16_t partition, uint32_t offset)
 {
 	struct udf_sb_info *sbi = UDF_SB(sb);
 	struct udf_part_map *map;
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
Applied
#32 lore raw

Re: [git pull] generic bitops, take 2

In reply to Ingo Molnar
Quoted 5 lines · Ingo Molnar
Quoted 2 lines

It also makes me wonder why Kconfig.i386 can just include arch/x86/Kconfig.cpu, but x86_64 cannot?

hm, indeed arch/um/Kconfig.i386 is assymetric to Kconfig.x86_64. Jeff Cc:-ed.

In current git, they look pretty symmetric to me, and it boots and runs.

Quoted 4 lines

arch/um/os-Linux/helper.c: In function 'run_helper':
arch/um/os-Linux/helper.c:73: error: 'PATH_MAX' undeclared (first use in this function)

it needs the patch below.

Applied, thanks.

Quoted 5 lines

then it fails with:

mm/filemap.c: In function '__generic_file_aio_write_nolock':
mm/filemap.c:1831: sorry, unimplemented: inlining failed in call to
'generic_write_checks': function body not available

Looks like Adrian just hit that too. As Linus pointed out, __generic_file_aio_write_nolock calls generic_write_checks at line 2383, and that's available at line 1831, which the error message helpfully points out. I don't see how gcc can be claiming that the function body isn't available when it's telling you exactly where it is.

Jeff

Signature · 1 line
Work email - jdike at linux dot intel dot com
#33 lore raw

Re: [git pull] generic bitops, take 2

In reply to Linus Torvalds
Quoted 16 lines · Linus Torvalds
Quoted 2 lines · Ingo Molnar

i've added Alexander's patch that does the cleanup suggested by you

Well.. Not really:

Quoted 8 lines
arch/um/Kconfig.x86_64 +0 -0
index 3fbe69e..7a75043 100644
@@ -27,6 +27,14 @@ config SMP_BROKEN
 	bool
 	default y
 
Quoted 10 lines

arch/um/Kconfig.x86_64 config SMP_BROKEN · line 37

Quoted 8 lines
arch/um/Kconfig.x86_64 +8 -0
+config GENERIC_FIND_FIRST_BIT
+	bool
+	default y
+
+config GENERIC_FIND_NEXT_BIT
+	bool
+	default y
+

It still declares this GENERIC_FIND_*_BIT thing separately for UM.

It would be nice if this could follow the sample outlined in Documentation/kbuild/kconfig-language.txt.

See the section about HAVE_

Basically we should only define the config symbol once in all the Kconfig files and where we then want to use this function we should select the config symbol.

Sam