Skip to content

Commit a5d9f23

Browse files
robntonyhutter
authored andcommitted
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
1 parent 6ab8f46 commit a5d9f23

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

module/os/linux/spl/spl-kmem-cache.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ kv_alloc(spl_kmem_cache_t *skc, int size, int flags)
142142
gfp_t lflags = kmem_flags_convert(flags | KM_VMEM);
143143
void *ptr;
144144

145-
if (skc->skc_flags & KMC_RECLAIMABLE)
146-
lflags |= __GFP_RECLAIMABLE;
147145
ptr = spl_vmalloc(size, lflags);
148146

149147
/* Resulting allocated memory will be page aligned */
@@ -424,7 +422,7 @@ spl_emergency_alloc(spl_kmem_cache_t *skc, int flags, void **obj)
424422
if (!empty)
425423
return (-EEXIST);
426424

427-
if (skc->skc_flags & KMC_RECLAIMABLE)
425+
if (skc->skc_flags & KMC_RECLAIMABLE && !(flags & KM_VMEM))
428426
lflags |= __GFP_RECLAIMABLE;
429427
ske = kmalloc(sizeof (*ske), lflags);
430428
if (ske == NULL)

0 commit comments

Comments
 (0)