Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Chris Down <chris@chrisdown.name>
Cc: pasha.tatashin@soleen.com, pratyush@kernel.org, graf@amazon.com,
	kexec@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH v2 0/2] kho: handle failures to reserve preserved memory
Date: Wed, 2 Dec 2026 13:24:25 +0200	[thread overview]
Message-ID: <aw__6WRiKa_bS8j2@kernel.org> (raw)
In-Reply-To: <cover.1796126791.git.chris@chrisdown.name>

On Tue, Dec 01, 2026 at 10:32:07PM -0800, Chris Down wrote:
> When a kernel boots with a handover, kho_preserved_memory_reserve()
> reserves each range of preserved memory in memblock, but it ignores
> failures. If one happens, memory that a KHO user still expects to
> restore can be released to the page allocator. This needs memblock to
> fail to grow its reserved array, so it's unlikely. But if it does
> happen, the result is bad enough to be worth handling.

If memblock_reserve() fails we are in a very unhappy place.
Do you think we really should worry about KHO state when we won't pass
through mm_core_init() anyway?
 
> Patch 2 makes the walk stop on such a failure, so that
> kho_mem_retrieve() drops the handover and the boot carries on without
> it. For that to be safe, reserve_mem_kho_revive() now reserves its own
> region, and patch 1 stops kho_init() from releasing inherited bootmem
> areas after a failed retrieval.
> 
> From a quick check I did with one of the reservations forced to fail,
> the kernel logs the failure and boots without the handover. The
> reserve_mem region stays reserved, and a later KHO kexec out of that
> kernel works.
> 
> v2:
> 
> - Drop the handover and carry on instead of panicking, with
>   reserve_mem_kho_revive() reserving its own region (Mike)
> - Stop kho_init() from releasing inherited bootmem areas after a failed
>   retrieval, as a separate patch (Mike)
> 
> v1: https://lore.kernel.org/r/avQUquBK6cO6tUUI@chrisdown.name
> 
> Chris Down (2):
>   kho: skip bootmem setup in kho_init() if bootmem was inherited
>   kho: drop the handover if preserved memory can't be reserved
> 
>  kernel/liveupdate/kho_core.c | 28 +++++++++++++++++++++++-----
>  mm/memblock.c                |  8 ++++++++
>  2 files changed, 31 insertions(+), 5 deletions(-)
> 
> 
> base-commit: ec459d99ed222228b3d601818fd1e24822a450d6
> -- 
> 2.56.1
> 

-- 
Sincerely yours,
Mike.


      parent reply	other threads:[~2026-12-02 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  6:32 [PATCH v2 0/2] kho: handle failures to reserve preserved memory Chris Down
2026-12-02  6:32 ` [PATCH v2 1/2] kho: skip bootmem setup in kho_init() if bootmem was inherited Chris Down
2026-12-02 10:59   ` Pratyush Yadav
2026-12-02  6:32 ` [PATCH v2 2/2] kho: drop the handover if preserved memory can't be reserved Chris Down
2026-12-02 11:14   ` Pratyush Yadav
2026-12-02 11:24 ` Mike Rapoport [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=aw__6WRiKa_bS8j2@kernel.org \
    --to=rppt@kernel.org \
    --cc=chris@chrisdown.name \
    --cc=graf@amazon.com \
    --cc=kernel-team@meta.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    /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