Re: [PATCH RFC v2 02/10] slab: add sheaf support for batching kfree_rcu() operations

From: Vlastimil Babka
Date: Wed Mar 12 2025 - 12:16:55 EST


On 2/24/25 09:40, Harry Yoo wrote:
>> +static bool kfree_rcu_sheaf(void *obj)
>> +{
>> + struct kmem_cache *s;
>> + struct folio *folio;
>> + struct slab *slab;
>> +
>> + folio = virt_to_folio(obj);
>> + if (unlikely(!folio_test_slab(folio)))
>> + return false;
>
> Does virt_to_folio() work for vmalloc addresses?

Hm, no. Good catch.

> Probably it should check is_vmalloc_addr() first?

Yes, thanks!

> Otherwise look good to me.
>