]> git.baikalelectronics.ru Git - kernel.git/commit
Fix kmem_cache_free performance regression in slab
authorMatthew Wilcox <matthew@wil.cx>
Thu, 29 Nov 2007 19:05:13 +0000 (12:05 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 30 Nov 2007 16:08:05 +0000 (08:08 -0800)
commitc54ed07f85a10edc91aafcd06197a226010b5acb
tree5856978e32c675393bc2cb97e3647fc91e27f3bb
parentbe2618604d62ec29f844959a6a72efeeaf06196d
Fix kmem_cache_free performance regression in slab

The database performance group have found that half the cycles spent
in kmem_cache_free are spent in this one call to BUG_ON.  Moving it
into the CONFIG_SLAB_DEBUG-only function cache_free_debugcheck() is a
performance win of almost 0.5% on their particular benchmark.

The call was added as part of commit e29fd91aa881b60aca29ca67af84a41d85b3ed3c
with the comment that "overhead should be minimal".  It may have been
minimal at the time, but it isn't now.

[ Quoth Pekka Enberg: "I don't think the BUG_ON per se caused the
  performance regression but rather the virt_to_head_page() changes to
  virt_to_cache() that were added later." ]

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Pekka J Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slab.c