mm/slab: move kfree() from slab_common.c to slub.c
authorVlastimil Babka <vbabka@suse.cz>
Tue, 3 Oct 2023 13:27:11 +0000 (15:27 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Wed, 6 Dec 2023 10:57:21 +0000 (11:57 +0100)
commitb774d3e326d30fc8ef841101c399e44bdac2aa48
tree4b8af66490308105e4609eba7f242029017a63b5
parentb52ef56e9b324b172053b03d8c775ef4708fbc23
mm/slab: move kfree() from slab_common.c to slub.c

This should result in better code. Currently kfree() makes a function
call between compilation units to __kmem_cache_free() which does its own
virt_to_slab(), throwing away the struct slab pointer we already had in
kfree(). Now it can be reused. Additionally kfree() can now inline the
whole SLUB freeing fastpath.

Also move over free_large_kmalloc() as the only callsites are now in
slub.c, and make it static.

Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: David Rientjes <rientjes@google.com>
Tested-by: David Rientjes <rientjes@google.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slab.h
mm/slab_common.c
mm/slub.c