slub: add 'likely' macro to inc_slabs_node()
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>
Mon, 21 Jan 2013 08:01:27 +0000 (17:01 +0900)
committerPekka Enberg <penberg@kernel.org>
Tue, 2 Apr 2013 06:42:17 +0000 (09:42 +0300)
After boot phase, 'n' always exist.
So add 'likely' macro for helping compiler.

Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slub.c

index 8f73593d4f21015ab38fef48f85744691e8b4492..21b3f004f614f3886529d548f2aa06a3dc12ab72 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1005,7 +1005,7 @@ static inline void inc_slabs_node(struct kmem_cache *s, int node, int objects)
         * dilemma by deferring the increment of the count during
         * bootstrap (see early_kmem_cache_node_alloc).
         */
-       if (n) {
+       if (likely(n)) {
                atomic_long_inc(&n->nr_slabs);
                atomic_long_add(objects, &n->total_objects);
        }