Re: [PATCH V6 8/9] mm/slab: move [__]ksize and slab_ksize() to mm/slub.c

From: Vlastimil Babka

Date: Tue Jan 13 2026 - 08:45:14 EST


On 1/13/26 2:05 PM, Harry Yoo wrote:
> On Tue, Jan 13, 2026 at 01:44:45PM +0100, Vlastimil Babka wrote:
>>>
>>> -/**
>>> - * __ksize -- Report full size of underlying allocation
>>> - * @object: pointer to the object
>>> - *
>>> - * This should only be used internally to query the true size of allocations.
>>> - * It is not meant to be a way to discover the usable size of an allocation
>>> - * after the fact. Instead, use kmalloc_size_roundup(). Using memory beyond
>>> - * the originally requested allocation size may trigger KASAN, UBSAN_BOUNDS,
>>> - * and/or FORTIFY_SOURCE.
>>> - *
>>> - * Return: size of the actual memory used by @object in bytes
>>> - */
>>> -size_t __ksize(const void *object)
>>
>> Think it could be also static and not in slab.h? I'll make that change
>> locally.
>
> Uh, great. Thanks!
>
> By the way `size_t __ksize(const void *objp);` is in both
> include/linux/slab.h and mm/slab.h.

Ack. Also moving the kerneldoc to ksize() as it should have been there
anyway.