[2.6 PATCH] SLAB : removes local_irq_save()/local_irq_restore() pair in ksize()

Eric Dumazet
2005-08-20T08:01:23Z

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

This patch removes unnecessary critical section in ksize() function, as cli/sti are rather expensive on modern CPUS.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

[-- Attachment #2: patch_ksize --]
[-- Type: text/plain, Size: 433 bytes --]

diff -Nru linux-2.6.13-rc6-ed/mm/slab.c linux-2.6.13-rc6/mm/slab.c
--- linux-2.6.13-rc6-ed/mm/slab.c 2005-08-20 09:22:29.000000000 +0200
+++ linux-2.6.13-rc6/mm/slab.c 2005-08-20 09:39:42.000000000 +0200
@@ -3080,10 +3080,8 @@
unsigned int size = 0;

if (likely(objp != NULL)) {
- local_irq_save(flags);
c = GET_PAGE_CACHE(virt_to_page(objp));
size = kmem_cache_size(c);
- local_irq_restore(flags);
}

return size;