Re: [PATCH 15/20] mm/slab: move kfree() from slab_common.c to slub.c

From: Kees Cook
Date: Mon Nov 13 2023 - 23:45:56 EST


On Mon, Nov 13, 2023 at 08:13:56PM +0100, Vlastimil Babka wrote:
> 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.
>
> Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

--
Kees Cook