linux/arch
Christoph Lameter 1f84260c8c SLUB: Alternate fast paths using cmpxchg_local
Provide an alternate implementation of the SLUB fast paths for alloc
and free using cmpxchg_local. The cmpxchg_local fast path is selected
for arches that have CONFIG_FAST_CMPXCHG_LOCAL set. An arch should only
set CONFIG_FAST_CMPXCHG_LOCAL if the cmpxchg_local is faster than an
interrupt enable/disable sequence. This is known to be true for both
x86 platforms so set FAST_CMPXCHG_LOCAL for both arches.

Currently another requirement for the fastpath is that the kernel is
compiled without preemption. The restriction will go away with the
introduction of a new per cpu allocator and new per cpu operations.

The advantages of a cmpxchg_local based fast path are:

1. Potentially lower cycle count (30%-60% faster)

2. There is no need to disable and enable interrupts on the fast path.
   Currently interrupts have to be disabled and enabled on every
   slab operation. This is likely avoiding a significant percentage
   of interrupt off / on sequences in the kernel.

3. The disposal of freed slabs can occur with interrupts enabled.

The alternate path is realized using #ifdef's. Several attempts to do the
same with macros and inline functions resulted in a mess (in particular due
to the strange way that local_interrupt_save() handles its argument and due
to the need to define macros/functions that sometimes disable interrupts
and sometimes do something else).

[clameter: Stripped preempt bits and disabled fastpath if preempt is enabled]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2008-02-07 17:47:41 -08:00
..
alpha Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
arm Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds 2008-02-07 09:45:14 -08:00
avr32 Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
blackfin Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
cris Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
frv Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
h8300 Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2008-02-07 09:45:58 -08:00
m32r m32r: build fix of arch/m32r/kernel/smpboot.c 2008-02-07 08:42:32 -08:00
m68k Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
m68knommu Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
mips Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
parisc Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
powerpc Merge branch 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-02-07 09:02:26 -08:00
ppc scheduled OSS driver removal 2008-02-06 10:41:02 -08:00
s390 Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
sh Use BOOTMEM_EXCLUSIVE for kdump 2008-02-07 08:42:25 -08:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-02-07 10:21:26 -08:00
sparc64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-02-07 10:21:26 -08:00
um uml: make mconsole_stack namespace-aware 2008-02-05 09:44:32 -08:00
v850 Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
x86 SLUB: Alternate fast paths using cmpxchg_local 2008-02-07 17:47:41 -08:00
xtensa calibrate_delay() must be __cpuinit 2008-02-06 10:41:08 -08:00
.gitignore arch: Ignore arch/i386 and arch/x86_64 2008-01-19 21:29:39 -08:00
Kconfig Move Kconfig.instrumentation to arch/Kconfig and init/Kconfig 2008-02-03 08:58:08 +01:00