Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9de1bc87 authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Pekka Enberg
Browse files

mm, slab_common: add 'unlikely' to size check of kmalloc_slab()



Size is usually below than KMALLOC_MAX_SIZE.
If we add a 'unlikely' macro, compiler can make better code.

Acked-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 68f06650
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
{
	int index;

	if (size > KMALLOC_MAX_SIZE) {
	if (unlikely(size > KMALLOC_MAX_SIZE)) {
		WARN_ON_ONCE(!(flags & __GFP_NOWARN));
		return NULL;
	}