]> git.baikalelectronics.ru Git - kernel.git/commit
{slub, slob}: use unlikely() for kfree(ZERO_OR_NULL_PTR) check
authorSatyam Sharma <satyam@infradead.org>
Tue, 16 Oct 2007 08:24:44 +0000 (01:24 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:42:53 +0000 (09:42 -0700)
commit5b844a8f0044fa175b5cdd8125ebb928ef964e49
tree71940f72dbadf6a6744ffbd062ef4fd8754aa623
parent34126a6966a51639104b5c9065882fb3b30dcaae
{slub, slob}: use unlikely() for kfree(ZERO_OR_NULL_PTR) check

Considering kfree(NULL) would normally occur only in error paths and
kfree(ZERO_SIZE_PTR) is uncommon as well, so let's use unlikely() for the
condition check in SLUB's and SLOB's kfree() to optimize for the common
case.  SLAB has this already.

Signed-off-by: Satyam Sharma <satyam@infradead.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slob.c
mm/slub.c