]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/slub: introduce __kmem_cache_free_bulk() without free hooks
authorVlastimil Babka <vbabka@suse.cz>
Thu, 2 Nov 2023 15:34:39 +0000 (16:34 +0100)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 21 Nov 2023 18:03:21 +0000 (13:03 -0500)
commit286c4b05218fd81a75e693fe738cc7df77d946dd
treeecf76e423815b08e90c175bf7389807f1426a8b6
parent4633259685410683311c5c03a46199495b03bae8
mm/slub: introduce __kmem_cache_free_bulk() without free hooks

Currently, when __kmem_cache_alloc_bulk() fails, it frees back the
objects that were allocated before the failure, using
kmem_cache_free_bulk(). Because kmem_cache_free_bulk() calls the free
hooks (kasan etc.) and those expect objects processed by the post alloc
hooks, slab_post_alloc_hook() is called before kmem_cache_free_bulk().

This is wasteful, although not a big concern in practice for the very
rare error path. But in order to efficiently handle percpu array batch
refill and free in the following patch, we will also need a variant of
kmem_cache_free_bulk() that avoids the free hooks. So introduce it first
and use it in the error path too.

As a consequence, __kmem_cache_alloc_bulk() no longer needs the objcg
parameter, remove it.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c