Re: [PATCH 2/3] mm/slab: document that sheaf refill does not require blocking

From: Harry Yoo

Date: Thu Nov 26 2026 - 09:50:58 EST


On Wed, Nov 25, 2026 at 08:35:13PM +0100, Andreas Hindborg wrote:
> The documentation of the sheaf_capacity member of struct kmem_cache_args
> states that when no full sheaf is available, a sheaf is only allocated and
> filled if the gfp flags allow blocking, and that the allocation otherwise
> falls back to allocating a single object from a slab.
>
> This has not been the case since commit fb1091febd66 ("mm/slab: allow sheaf
> refill if blocking is not allowed"). __pcs_replace_empty_main() now refills
> a sheaf whenever spinning is allowed. Only kmalloc_nolock() disallows
> spinning, and it allocates from the kmalloc caches, so for caches created
> with kmem_cache_create() the refill is attempted regardless of the gfp
> flags.
>
> Drop the condition from the documentation, and describe the fallback as
> what happens when the sheaf cannot be allocated or filled.
>
> Fixes: fb1091febd66 ("mm/slab: allow sheaf refill if blocking is not allowed")
> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
> ---

Looks good to me,
Reviewed-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>

--
Cheers,
Harry / Hyeonggon