Re: [PATCH] slab: Fix using this_cpu_ptr() in preemptible context

From: Alexei Starovoitov

Date: Fri Oct 03 2025 - 11:01:32 EST


On Fri, Oct 3, 2025 at 12:50 AM Vlastimil Babka <vbabka@xxxxxxx> wrote:
>
>
> Disable preemption in defer_free() and also defer_deactivate_slab() to
> make it safe.
>
> [vbabka@xxxxxxx: disable preemption instead of using raw_cpu_ptr() per
> the discussion ]
> Fixes: af92793e52c3 ("slab: Introduce kmalloc_nolock() and kfree_nolock().")
> Signed-off-by: Ran Xiaokai <ran.xiaokai@xxxxxxxxxx>
> Link: https://lore.kernel.org/r/20250930083402.782927-1-ranxiaokai627@xxxxxxx
> Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>

Acked-by: Alexei Starovoitov <ast@xxxxxxxxxx>