Re: [linus:master] [mm] c6307674ed: BUG:sleeping_function_called_from_invalid_context_at_mm/vmalloc.c
From: Vlastimil Babka
Date: Mon Apr 27 2026 - 04:55:48 EST
On 4/23/26 05:34, Herbert Xu wrote:
> On Wed, Apr 22, 2026 at 10:32:16AM +0200, Uladzislau Rezki wrote:
>>
>> We have added non-sleeping flags for vmalloc() to extend kvmalloc()
>> functionality as folk need those.
>>
>> Another option, would be: always use vfree_atomic() from the kvfree()
>> path.
>>
>> Any thoughts?
>
> Perhaps add a kvfree_atomic that just calls vfree_atomic?
kvfree()'s comment says
" * Context: Either preemptible task context or not-NMI interrupt."
so this is neither. It might be ok then to create kvfree_atomic(). Always
using vfree_atomic() from kvfree() might be wasteful.
> For rhashtable it really makes no difference either way. But it
> would eliminate the unsightly call to is_vmalloc_addr in rhashtable.
>
> Thanks,