kmem: don't add __GFP_COMP for KM_VMEM allocations

It hasn't been necessary since Linux 3.13
(torvalds/linux@a57a49887e), and since 6.19 the kernel warns if you
use it.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #18053
This commit is contained in:
Rob Norris 2025-12-17 22:12:05 +11:00 committed by Tony Hutter
parent 2422c1f3b9
commit cb1833023f
2 changed files with 5 additions and 2 deletions

View File

@ -66,7 +66,10 @@ void *spl_kvmalloc(size_t size, gfp_t flags);
static inline gfp_t
kmem_flags_convert(int flags)
{
gfp_t lflags = __GFP_NOWARN | __GFP_COMP;
gfp_t lflags = __GFP_NOWARN;
if (!(flags & KM_VMEM))
lflags |= __GFP_COMP;
if (flags & KM_NOSLEEP) {
lflags |= GFP_ATOMIC | __GFP_NORETRY;

View File

@ -139,7 +139,7 @@ static void spl_cache_shrink(spl_kmem_cache_t *skc, void *obj);
static void *
kv_alloc(spl_kmem_cache_t *skc, int size, int flags)
{
gfp_t lflags = kmem_flags_convert(flags);
gfp_t lflags = kmem_flags_convert(flags | KM_VMEM);
void *ptr;
if (skc->skc_flags & KMC_RECLAIMABLE)