mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Pasha Tatashin <pasha.tatashin@soleen.com>,
	Mike Rapoport <rppt@kernel.org>,
	Pratyush Yadav <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>,
	Baoquan He <baoquan.he@linux.dev>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	kexec@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kselftest@vger.kernel.org, kernel-team@meta.com,
	Breno Leitao <leitao@debian.org>,
	sashiko-bot@kernel.org
Subject: [PATCH v2 1/7] kho: Reclaim the metadata page left reserved after kexec
Date: Sat, 28 Nov 2026 10:27:32 -0800	[thread overview]
Message-ID: <4015fa169046f1ac59bf3d8b0218a2c2e6c7ed22.1795857773.git.chris@chrisdown.name> (raw)
In-Reply-To: <cover.1795857773.git.chris@chrisdown.name>

After a KHO kexec, the new kernel keeps the page holding the previous
kernel's kexec metadata reserved for as long as it runs. It only needs
the page once, since kho_in_kexec_metadata() copies the previous release
and the kexec count out of it at boot, and nothing reads it again.

Free it with kho_restore_free() once copying is complete.

Tested-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Chris Down <chris@chrisdown.name>
---
 kernel/liveupdate/kexec_handover.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
index 38e65d210cb9..233c126f6352 100644
--- a/kernel/liveupdate/kexec_handover.c
+++ b/kernel/liveupdate/kexec_handover.c
@@ -1814,6 +1814,8 @@ static void __init kho_in_kexec_metadata(void)
 
 	pr_info("exec from: %s (count %u)\n",
 		kho_in.previous_release, kho_in.kexec_count);
+
+	kho_restore_free(metadata);
 }
 
 /*
-- 
2.56.1


  reply	other threads:[~2026-11-28 18:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 18:27 [PATCH v2 0/7] kho, liveupdate: KHO/LUO observability Chris Down
2026-11-28 18:27 ` Chris Down [this message]
2026-11-28 18:27 ` [PATCH v2 2/7] liveupdate: Make failed retrieves distinguishable from dropped files Chris Down
2026-11-28 18:27 ` [PATCH v2 3/7] selftests/liveupdate: Catch incorrect file accounting across kexec Chris Down
2026-11-28 18:27 ` [PATCH v2 4/7] kho: Expose rejected handovers that look like cold boots Chris Down
2026-11-28 18:27 ` [PATCH v2 5/7] kho: Report how much handover memory is preserved and restored Chris Down
2026-11-28 18:27 ` [PATCH v2 6/7] liveupdate: Expose the sequence number for consecutive live updates Chris Down
2026-11-28 18:27 ` [PATCH v2 7/7] selftests/liveupdate: Check handover revival, sequence and memory stats Chris Down

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=4015fa169046f1ac59bf3d8b0218a2c2e6c7ed22.1795857773.git.chris@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=baoquan.he@linux.dev \
    --cc=corbet@lwn.net \
    --cc=graf@amazon.com \
    --cc=kernel-team@meta.com \
    --cc=kexec@lists.infradead.org \
    --cc=leitao@debian.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=skhan@linuxfoundation.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

all inboxes | Powered by JetHome®