Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Monday, November 12, 2007 - 4:28 pm

On Mon, 12 Nov 2007 14:32:53 -0800 David Brownell <david-b@pacbell.net> wrote:


Well whatever.  We shouldn't have to resort to caller-side party tricks
like this to get acceptable performance.


There's something missing here.  It went from 6.4 usec/bit up to 11.2
usec/bit.  You seem to be saying that enabling preemption accounts for 1
usec.  What caused the rest of the slowdown?


I don't understand all this about raw spinlocks and hardirq context. 
We use plain old spin_lock()/spin_unlock() in hardirq context all the time?

I'm still trying to understand what you've observed here.  Is it the case
that a single gpio operation went from 6.4 up to 11.2 usecs?  And that this
operation does a single spin_lock/spin_unlock?  If so, something would have
had to have gone seriously wrong for a spin_lock/unlock time to increase by
4.8 microseconds.

I assume these timings are from a reasonably fast machine?


It would of course be better to not use raw spinlocks at all.  It's an
internal implementation detail and drivers shouldn't go poking at it:

box:/usr/src/linux-2.6.24-rc2> grep -rl raw_spinlock_t .
./arch/x86/kernel/traps_32.c
./arch/x86/kernel/traps_64.c
./arch/x86/kernel/tsc_sync.c
./arch/mips/kernel/gdb-stub.c
./arch/parisc/lib/bitops.c
./arch/powerpc/lib/locks.c
./arch/s390/lib/spinlock.c
./include/asm-alpha/spinlock.h
./include/asm-alpha/spinlock_types.h
./include/asm-arm/spinlock.h
./include/asm-arm/spinlock_types.h
./include/asm-generic/bitops/atomic.h
./include/asm-x86/spinlock_32.h
./include/asm-x86/spinlock_64.h
./include/asm-x86/spinlock_types.h
./include/asm-ia64/spinlock.h
./include/asm-ia64/spinlock_types.h
./include/asm-m32r/spinlock.h
./include/asm-m32r/spinlock_types.h
./include/asm-mips/spinlock.h
./include/asm-mips/spinlock_types.h
./include/asm-parisc/atomic.h
./include/asm-parisc/spinlock.h
./include/asm-parisc/spinlock_types.h
./include/asm-powerpc/spinlock.h
./include/asm-powerpc/spinlock_types.h
./include/asm-ppc/spinlock.h
./include/asm-s390/spinlock.h
./include/asm-s390/spinlock_types.h
./include/asm-sh/spinlock.h
./include/asm-sh/spinlock_types.h
./include/asm-sparc/spinlock.h
./include/asm-sparc/spinlock_types.h
./include/asm-sparc64/spinlock.h
./include/asm-sparc64/spinlock_types.h
./include/linux/spinlock.h
./include/linux/spinlock_types.h
./include/linux/spinlock_types_up.h
./include/linux/spinlock_up.h
./kernel/lockdep.c
./lib/spinlock_debug.c


So can we please drill down and work out what went wrong and see if we can
fix it all up properly?

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Fri Nov 9, 12:36 pm)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, Andrew Morton, (Mon Nov 12, 4:28 pm)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Tue Nov 13, 12:22 pm)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Tue Nov 13, 11:52 pm)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, Haavard Skinnemoen, (Wed Nov 14, 2:54 am)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, Thomas Gleixner, (Wed Nov 14, 5:14 am)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Wed Nov 14, 11:23 pm)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Wed Nov 14, 11:28 pm)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Wed Nov 14, 11:50 pm)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Thu Nov 15, 12:02 am)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Thu Nov 15, 12:17 am)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, Thomas Gleixner, (Thu Nov 15, 12:32 am)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, Thomas Gleixner, (Thu Nov 15, 12:35 am)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, Haavard Skinnemoen, (Thu Nov 15, 1:43 am)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, Haavard Skinnemoen, (Thu Nov 15, 1:51 am)
Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support, David Brownell, (Thu Nov 15, 11:55 am)