kmem: don't add __GFP_RECLAIMABLE for KM_VMEM allocations

vmalloc()'d memory is not movable/reclaimable, so __GFP_RECLAIMABLE is
not a valid flag, and since 6.19 the kernel warns if you use it.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #18107
This commit is contained in:
Rob Norris 2026-01-06 08:35:13 +11:00 committed by GitHub
parent dbb3f247ed
commit a1319bf654
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -142,8 +142,6 @@ kv_alloc(spl_kmem_cache_t *skc, int size, int flags)
gfp_t lflags = kmem_flags_convert(flags | KM_VMEM);
void *ptr;
if (skc->skc_flags & KMC_RECLAIMABLE)
lflags |= __GFP_RECLAIMABLE;
ptr = spl_vmalloc(size, lflags);
/* Resulting allocated memory will be page aligned */
@ -424,7 +422,7 @@ spl_emergency_alloc(spl_kmem_cache_t *skc, int flags, void **obj)
if (!empty)
return (-EEXIST);
if (skc->skc_flags & KMC_RECLAIMABLE)
if (skc->skc_flags & KMC_RECLAIMABLE && !(flags & KM_VMEM))
lflags |= __GFP_RECLAIMABLE;
ske = kmalloc(sizeof (*ske), lflags);
if (ske == NULL)