mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Zhu Yanjun <yanjun.zhu@linux.dev>
Cc: Samiullah Khawaja <skhawaja@google.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Tarun Sahu <tarunsahu@google.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Mike Rapoport <rppt@kernel.org>, Alexander Graf <graf@amazon.com>,
	"Andersen, Tycho" <Tycho.Andersen@amd.com>,
	Anthony Yznaga <anthony.yznaga@oracle.com>,
	Baolu Lu <baolu.lu@linux.intel.com>,
	David Hildenbrand <david@kernel.org>,
	David Matlack <dmatlack@google.com>,
	"Heyne, Maximillian" <mheyne@amazon.de>,
	James Gowans <jgowans@amazon.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Pankaj Gupta <pankaj.gupta.linux@gmail.com>,
	Praveen Kumar <kpraveen.lkml@gmail.com>,
	Sagi Shahar <sagis@google.com>, Vipin Sharma <vipinsh@google.com>,
	Vishal Annapurve <vannapurve@google.com>,
	"Woodhouse, David" <dwmw@amazon.co.uk>,
	Luca Boccassi <luca.boccassi@gmail.com>,
	Jork Loeser <jloeser@linux.microsoft.com>,
	Chenghao Duan <duanchenghao@kylinos.cn>,
	Sourabh Jain <sourabhjain@linux.ibm.com>,
	linux-mm@kvack.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: KHO bootmem without pre-reservation
Date: Sat, 05 Dec 2026 18:50:43 -0800	[thread overview]
Message-ID: <axTNg2I4HQ0QUmOm@chrisdown.name> (raw)
In-Reply-To: <8015da3a-3f7e-4945-a26b-240df4a960e4@linux.dev>

Hi Yanjun,

Zhu Yanjun writes:
>Is the main concern that a large KHO bootmem reservation reduces the
>amount of memory available for unmovable allocations, potentially
>causing allocation failures or memory pressure during normal host operation?
>
>Or are there other concerns, such as memory fragmentation, NUMA
>constraints, or the overall memory footprint?

It's the former. And the hosts are relatively uninteresting, they have one
NUMA node and no real fragmentation to speak of.

In July we rolled out a 7.1-based kernel with KHO on by default. On 64GiB
hosts booted with hugetlb_cma=6G, reserved memory went from about 1.4GiB to
about 30.7GiB, so close to half of the host could only take movable
allocations. Page allocation failure warnings went up several times over,
so as you can imagine we turned it off again quite swiftly.

I looked at a few and found a mix of symptoms. Some have memory stranded in
CMA. Some others are plain exhaustion on hosts deep in swap, which doesn't
prove that KHO alone caused it, but it's significantly elevated on
KHO-enabled hosts. So I can't yet say how much was memory stuck free in CMA
and how much was lost capacity, but it's certainly KHO-adjacent.

>I'm trying to understand whether the issue is primarily the amount of
>physically reserved memory, or rather the restrictions on how that
>memory can be used by the running kernel.

Both really, since the restriction hurts in proportion to the size.
__rmqueue() only prefers CMA for movable allocations when more than half of
the zone's free memory is CMA, and nothing moves them into CMA later, so
unmovable allocations can fail with CMA still free. That's what Tarun's RFC
[0] is about.

As for the size, we previously counted reservations more than once, which
Mike's fixes (thanks!) address. CMA areas are counted too, though, so even
with Mike's fixes hugetlb_cma=1G ends up taking bootmem from 516MiB to
2564MiB on an 8GiB host. I'll post an RFC soon to leave hugetlb_cma out of
the sizing. In my tests that semes to significantly improve things.

Thanks,

Chris

[0]: https://lore.kernel.org/r/9huzfqwent4i.fsf@tarunix.c.googlers.com

      reply	other threads:[~2026-12-06  2:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 20:58 [Hypervisor Live Update] Notes from November 16, 2026 Pasha Tatashin
2026-12-02 20:26 ` KHO bootmem without pre-reservation (was: Re: [Hypervisor Live Update] Notes from November 16, 2026) Chris Down
2026-12-03 12:59   ` KHO bootmem without pre-reservation Pratyush Yadav
2026-12-03 18:04   ` KHO bootmem without pre-reservation (was: Re: [Hypervisor Live Update] Notes from November 16, 2026) tarunsahu
2026-12-05 20:17   ` KHO bootmem without pre-reservation Zhu Yanjun
2026-12-06  2:50     ` Chris Down [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=axTNg2I4HQ0QUmOm@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=Tycho.Andersen@amd.com \
    --cc=anthony.yznaga@oracle.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=david@kernel.org \
    --cc=dmatlack@google.com \
    --cc=duanchenghao@kylinos.cn \
    --cc=dwmw@amazon.co.uk \
    --cc=graf@amazon.com \
    --cc=jgg@nvidia.com \
    --cc=jgowans@amazon.com \
    --cc=jloeser@linux.microsoft.com \
    --cc=kexec@lists.infradead.org \
    --cc=kpraveen.lkml@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luca.boccassi@gmail.com \
    --cc=mheyne@amazon.de \
    --cc=pankaj.gupta.linux@gmail.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    --cc=sagis@google.com \
    --cc=skhawaja@google.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=tarunsahu@google.com \
    --cc=vannapurve@google.com \
    --cc=vipinsh@google.com \
    --cc=yanjun.zhu@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®