[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-5OBJrdjDBj_nrr@tiehlicka>
Date: Thu, 3 Apr 2025 10:59:48 +0200
From: Michal Hocko <mhocko@...e.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Shakeel Butt <shakeel.butt@...ux.dev>,
Dave Chinner <david@...morbit.com>,
Yafang Shao <laoar.shao@...il.com>,
Harry Yoo <harry.yoo@...cle.com>, Kees Cook <kees@...nel.org>,
joel.granados@...nel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, Josef Bacik <josef@...icpanda.com>,
linux-mm@...ck.org
Subject: Re: [PATCH] mm: kvmalloc: make kmalloc fast path real fast path
On Thu 03-04-25 10:24:56, Vlastimil Babka wrote:
[...]
> - to replace xlog_kvmalloc(), we need to deal with kvmalloc() passing
> VM_ALLOW_HUGE_VMAP, so we don't end up with GFP_KERNEL huge allocation
> anyway (in practice maybe it wouldn't happen because "size >= PMD_SIZE"
> required for the huge vmalloc is never true for current xlog_kvmalloc()
> users but dunno if we can rely on that).
I would just make that its own patch. Ideally with some numbers showing
there are code paths benefiting from the change.
> Maybe it's a bad idea to use VM_ALLOW_HUGE_VMAP in kvmalloc() anyway? Since
> we're in a vmalloc fallback which means the huge allocations failed anyway
> for the kmalloc() part. Maybe there's some grey area where it makes sense,
> with size much larger than PMD_SIZE, e.g. exceeding MAX_PAGE_ORDER where we
> can't kmalloc() anyway so at least try to assemble the allocation from huge
> vmalloc. Maybe tie it to such a size check, or require __GFP_RETRY_MAYFAIL
> to activate VM_ALLOW_HUGE_VMAP?
We didn't have that initially. 9becb6889130 ("kvmalloc: use vmalloc_huge
for vmalloc allocations") has added it. I thought large allocations are
very optimistic (ie. NOWAIT like) but that doesn't seem to be the case.
As said above, I would just change that after we have any numbers to
support the removal.
> - we're still not addressing the original issue of high kcompactd activity,
> but maybe the answer is that it needs to be investigated more (why deferred
> compaction doesn't limit it) instead of trying to suppress it from kvmalloc()
yes this seems like something that should be investigated on the
compaction side.
Thanks!
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists