Re: [PATCH v4 29/35] mm: slub: Move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context

From: Vlastimil Babka
Date: Tue Aug 10 2021 - 10:33:31 EST


On 8/9/21 3:41 PM, Qian Cai wrote:

>> static void flush_all(struct kmem_cache *s)
>> {
>> - on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1);
>> + struct slub_flush_work *sfw;
>> + unsigned int cpu;
>> +
>> + mutex_lock(&flush_lock);
>
> Vlastimil, taking the lock here could trigger a warning during memory offline/online due to the locking order:
>
> slab_mutex -> flush_lock

Here's the full fixup, also incorporating Mike's fix. Thanks.

----8<----