The patch titled
     slab: fix kmem_cache_free performance regression
has been added to the -mm tree.  Its filename is
     slab-fix-kmem_cache_free-performance-regression.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: slab: fix kmem_cache_free performance regression
From: Matthew Wilcox <[EMAIL PROTECTED]>

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
ddc2e812d592457747c4367fb73edcaa8e1e49ff with the comment that "overhead
should be minimal".  It may have been minimal at the time, but it isn't
now.

Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]>
Cc: Pekka Enberg <[EMAIL PROTECTED]>
Cc: Christoph Lameter <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 mm/slab.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN mm/slab.c~slab-fix-kmem_cache_free-performance-regression mm/slab.c
--- a/mm/slab.c~slab-fix-kmem_cache_free-performance-regression
+++ a/mm/slab.c
@@ -2881,6 +2881,8 @@ static void *cache_free_debugcheck(struc
        unsigned int objnr;
        struct slab *slabp;
 
+       BUG_ON(virt_to_cache(objp) != cachep);
+
        objp -= obj_offset(cachep);
        kfree_debugcheck(objp);
        page = virt_to_head_page(objp);
@@ -3759,8 +3761,6 @@ void kmem_cache_free(struct kmem_cache *
 {
        unsigned long flags;
 
-       BUG_ON(virt_to_cache(objp) != cachep);
-
        local_irq_save(flags);
        debug_check_no_locks_freed(objp, obj_size(cachep));
        __cache_free(cachep, objp);
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

slab-fix-kmem_cache_free-performance-regression.patch
pcmcia-convert-some-internal-only-ioaddr_t-to-unsigned-int.patch
pcmcia-replace-kio_addr_t-with-unsigned-int-everywhere.patch
use-wake_up_locked-in-eventpoll.patch
use-macros-instead-of-task_-flags.patch
use-macros-instead-of-task_-flags-checkpatch-fixes.patch
add-task_wakekill.patch
add-lock_page_killable.patch
hash-add-explicit-u32-and-u64-versions-of-hash.patch
make-sure-nobodys-leaking-resources.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to