Re: [PATCH v5 bpf-next 1/3] bpf: Add kmem_cache iterator

From: Vlastimil Babka
Date: Mon Oct 14 2024 - 11:28:37 EST


On 10/11/24 01:25, Namhyung Kim wrote:
> The new "kmem_cache" iterator will traverse the list of slab caches
> and call attached BPF programs for each entry. It should check the
> argument (ctx.s) if it's NULL before using it.
>
> Now the iteration grabs the slab_mutex only if it traverse the list and
> releases the mutex when it runs the BPF program. The kmem_cache entry
> is protected by a refcount during the execution.
>
> It includes the internal "mm/slab.h" header to access kmem_cache,
> slab_caches and slab_mutex. Hope it's ok to mm folks.

Yeah this paragraph can be dropped.

> Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Acked-by: Vlastimil Babka <vbabka@xxxxxxx> #slab