From nobody Mon May 25 02:42:36 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95A2233BBAD for ; Tue, 19 May 2026 15:53:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779206015; cv=none; b=F2LNUq9vGhASViq620MstJB4IHMiFjgbirhgHFd8hnEfBiPvOt5wKBNcD8P/65Qer6MdlSzkc5275OpWDIjLSUrzk6bAG6gUwH3W6JHLHnPWesDxw763S7DLjYHgGt5gp4bWz0/tPQUBs8bW4FL++pi7mwUMh4g+VstHtQavoPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779206015; c=relaxed/simple; bh=XUKkEq/zBwZCDneFV3d4XY7FRw4qnYbdahDIQGyl9WY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mq3ISTC9zolqkO+1Ik3UIN7/GavxISJ7BxrDqNwab/8cYMtUNiFe3G9iIdKO0axacCHW12Ex1qJQ/LGecd347tB9xLu20b9TNlJg7RHT6UQ01BgyDTOS60Mpu14Yzt/MnOKPMVeNLXA8xVIGpRs4R3JHHbdNx14dTLoraMrFSr8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aEaiq6JV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aEaiq6JV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FEAEC2BCB3; Tue, 19 May 2026 15:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779206014; bh=XUKkEq/zBwZCDneFV3d4XY7FRw4qnYbdahDIQGyl9WY=; h=From:To:Cc:Subject:Date:From; b=aEaiq6JVQa2BIXrRE/R4JjRcdFUTvMo3hoMC1wkCTJ41hnIhmZ0x44zeeaSpsFgbM +sIKrzMbZeZjRP43gButUTH9u0GCcbN7EMJ4GQxYC/iFsodqryxAh6MOWvvNwW4i3Z j9+pOCDGYEvjBGhKwJTe3ut9pbefd4k80TcxjwMG6+XrxfwG0h9cjKmsUsa0yzLQmw hgDGVFaFmM+nORb1gJmby5qI8NnkqDQ5GefonURZKmfkjPmdBa2H5wLkctmrQlU7Wp AfI8o3HCrLLmIWoMaZpyEJx1pU0DKcDnpwdNEsCk4Ph7SLJtzXDuVJ5aWzPUsvWrvr IRQ8+vtYoMiBw== From: Pratyush Yadav To: Mike Rapoport , Pasha Tatashin , Pratyush Yadav , Alexander Graf Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] kho: always print scratch sizes Date: Tue, 19 May 2026 17:53:21 +0200 Message-ID: <20260519155324.2692594-1-pratyush@kernel.org> X-Mailer: git-send-email 2.54.0.563.g4f69b47b94-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Pratyush Yadav (Google)" Currently, KHO only prints scratch sizes when the size is specified by the command line. It prints nothing when the size is calculated at runtime by counting RSRV_KERN. These prints are completely useless. When the user specified the size on the command line, they already know how large the scratch areas are. And that information is readily available by looking at the command line. It is a lot more useful to know the sizes that are calculated at runtime since they can vary by kernel version. Plus, if KHO fails to allocate the scratch areas, the calculated scratch sizes are not available via debugfs. Print the scratch sizes in kho_reserve_scratch(). Do it before making the allocations. The size can provide hints for the failure reason. Signed-off-by: Pratyush Yadav (Google) --- kernel/liveupdate/kexec_handover.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index 33fcf848ef95..b030f53f2235 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -621,11 +621,6 @@ static int __init kho_parse_scratch_size(char *p) scratch_size_pernode =3D sizes[2]; scratch_scale =3D 0; =20 - pr_notice("scratch areas: lowmem: %lluMiB global: %lluMiB pernode: %lldMi= B\n", - (u64)(scratch_size_lowmem >> 20), - (u64)(scratch_size_global >> 20), - (u64)(scratch_size_pernode >> 20)); - return 0; } early_param("kho_scratch", kho_parse_scratch_size); @@ -691,6 +686,10 @@ static void __init kho_reserve_scratch(void) goto err_disable_kho; } =20 + pr_notice("scratch areas: lowmem: %lluMiB global: %lluMiB\n", + (u64)(scratch_size_lowmem >> 20), + (u64)(scratch_size_global >> 20)); + /* * reserve scratch area in low memory for lowmem allocations in the * next kernel @@ -725,6 +724,9 @@ static void __init kho_reserve_scratch(void) */ for_each_node_state(nid, N_MEMORY) { size =3D scratch_size_node(nid); + + pr_notice("scratch_areas: nid %d: %lluMiB\n", nid, size >> 20); + addr =3D memblock_alloc_range_nid(size, CMA_MIN_ALIGNMENT_BYTES, 0, MEMBLOCK_ALLOC_ACCESSIBLE, nid, true); base-commit: 34e8f02817e31826e76bb2ded48bf28fe921f20b --=20 2.54.0.563.g4f69b47b94-goog