On Fri, Sep 27, 2024 at 11:41 AM Namhyung Kim <namhyung@xxxxxxxxxx> wrote: > +static void *kmem_cache_iter_seq_start(struct seq_file *seq, loff_t *pos) > +{ > + loff_t cnt = 0; > + struct kmem_cache *s = NULL; > + > + mutex_lock(&slab_mutex); It would be better to find a way to iterate slabs without holding the mutex for the duration of the loop. Maybe use refcnt to hold the kmem_cache while bpf prog is looking at it?