From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A061A3672A2 for ; Thu, 21 May 2026 19:07:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779390471; cv=none; b=p76D2yIv+M/gG8J+23qABVWBbSJrlNLFVI1+P7hOVcgYzSg6BJvTouTaANgRPiVu0oKgQPWVDwd8tACyzqtxsqVm7f6A+v8RGJxN8nrLqNeIdIh7H/95RAxfUTgDtclG1O3/YbM222969UIY6J3sfo+M93HEWgtk6eXfowjA8yI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779390471; c=relaxed/simple; bh=/LpdtHixrnokJ/dr90B114iLmR5cn5pV58piCFcQ4yI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lLyw2CBkHEYKtUaL/GDhT4/3e3x4aX30NXbtND4SmHGusFynDJ0lsdmPkQqQBt7uZMztJvRBsSBi8IT2G2QDy9aYe/2m/WtfGaxOY/A4aBwGq5F9FdyUdm2G2987mKKvp1Hob5xiUCqVmENQatG7rcR0LrMOIdmcdfACOYrf/iw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=huTHfC0c; arc=none smtp.client-ip=209.85.219.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="huTHfC0c" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-8acb09ddbf6so116262996d6.2 for ; Thu, 21 May 2026 12:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779390468; x=1779995268; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=6X8QxT97XWDwxSQTOa9c7B5Uvcoz36bOQLLyn390AOA=; b=huTHfC0cNrfxg/lozpxgJaCI0ld0SREgNL85afTGqAXOfnWRtQWxV6O5nAIIfr19Cs +U+CI/bbPabQx2ojzkcgso8jZMmnnK5kSCJGUk+XLvFoTm5LTzk1j1pHxMprd9muNXGQ 8k94dijXY0pfOErPKKDg4uIz3kWuMgg4zp3ShGGIh9puKxkWdA6mvxA7hd91aH4lYQ1y vDqHLiJUcpveymZTmHt0a44XkGlMQ4Jv2BLziFTn9I3KnCpAMlWfLO6+HoekVPJq2GTt mzOR0gPPuA8+ldwI0B+lKiSOJi7Fcu4Kgihk6PzhF5nnWDFbeZCWPiZ3qZ9LxukYmQwr oSww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779390468; x=1779995268; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6X8QxT97XWDwxSQTOa9c7B5Uvcoz36bOQLLyn390AOA=; b=kOb+6Kaq7wwmOwAok+ja85p4UGvg26VFNqfGJFmC0AyUBE68l2UIEaxeCHYXVQohI7 IaMNM4qY1e/M5aCSdk13CjP8vfzyiL1ECCA9kS2UHcOtLg8sQA0D6JcT6laSmLA+P0Jd OcAP85Idq5J+DROZTlBncHybNoT0sGSJmkni1/ZKaK+XkWuCR5xZJTHfFEYEPkdmxX1r h+VbLMP1ajQtLX4nojiwombFMFIJ2vWPxW31KWAb4daGJ50xU/v6Xmeglk27h3OcMWSF zDqiwtw9XPsuXjvSUYgNnbVZe0CMtwx+Nz+kROnn7g4hGo8mUKe/r1iF5wr8Y4iC/oDZ AbFw== X-Forwarded-Encrypted: i=1; AFNElJ+KtS+dqCdL7QOkPyk7KVGRIuX3O146hQ5Ul343oknVAR41vgGTYJZv0rUGEHeD3bWUJndZ0Or18loGfek=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/yV5+9ZVWU4vfvf9dqxQZb0aNrMnS1KDZdAwIQNFnDZ5gUAKR UaZyUQNXEyVchxPyd4PjaNzl1Cwgo6ZwYaNsuXW3PWbgJrr1+NO2ehzf4L8bPKw9IAEoZSe/E+o OaJ/Q X-Gm-Gg: Acq92OFe81IX5pBYMpy6438msfuJ3FmIv5gcWyZWOjdEp+XHOaey4In3MvEZqLnUeq7 AEcYnd6zyt5p/lxoo8qfxF9SgOnqFkgAJf571tSmw/T2FbbHrYidg5OC1wdPPV3fBjuqy7AYQeI fFC+Ym7VsbU2VCauMfKeysyqXIKii+eLc7ow+deFfON/Y175ItAKwqA6R2esoPsTq4qgSkn8ZSr h39h9sc5+g0N2tGIvhw94c31GLV8hRX5yhbWNhfFOuZfV1Bh36LLw5yetFIvskZkVVfCIjgmgWZ IrYBOoDT2+MMommEvJhrC1m+oqAEwRB84G6pLHEZQXyxGyhVY0jeYRHcPR1UrAZUZgs7s6TiTRL HEFn++W0J7AGHkSYQCuwZNBw64iM3eWNz5jeYlTSxQjN/Yr9XamYfXvm+Ok29Zw7M3G/QYK9w2r S2K2ELF6ubfba6XJ0H5qOWX9e2wtWZ+dPouFHvylHG+5WgHKURjeHvkDv7Ll6xjg== X-Received: by 2002:a05:6214:3c89:b0:8cc:611f:197f with SMTP id 6a1803df08f44-8cc7b69fb91mr10772426d6.44.1779390468578; Thu, 21 May 2026 12:07:48 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8cc7680906bsm12968866d6.0.2026.05.21.12.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 12:07:48 -0700 (PDT) Date: Thu, 21 May 2026 19:07:47 +0000 From: Pasha Tatashin To: Pratyush Yadav Cc: Mike Rapoport , Pasha Tatashin , Alexander Graf , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kho: always print scratch sizes Message-ID: References: <20260519155324.2692594-1-pratyush@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260519155324.2692594-1-pratyush@kernel.org> On 05-19 17:53, Pratyush Yadav wrote: > 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_handover.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 = sizes[2]; > scratch_scale = 0; > > - pr_notice("scratch areas: lowmem: %lluMiB global: %lluMiB pernode: %lldMiB\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; > } > > + 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 = scratch_size_node(nid); > + > + pr_notice("scratch_areas: nid %d: %lluMiB\n", nid, size >> 20); Please use a space instead of an underscore to match the other string: "scratch areas". Keeping the prefix identical makes log parsing and filtering much cleaner. Unrelated to this patch—this is something I brought up to Pratyush off-list, but I really dislike the 'KHO scratch' terminology. First, it isn't actually 'scratch' space, as the kernel relies on it to allocate crucial early boot memory, which it then uses permanently. Second, we cannot preserve anything within this specific region. Down the line, I'd like to rename this to something more descriptive that clearly conveys both its importance to early boot and its non-preservable nature. For now, the print adjustments themselves look good. I do not know it should be, but something like kho_bootstrap area sounds better than kho_sratch area. > + > addr = memblock_alloc_range_nid(size, CMA_MIN_ALIGNMENT_BYTES, > 0, MEMBLOCK_ALLOC_ACCESSIBLE, > nid, true); > > base-commit: 34e8f02817e31826e76bb2ded48bf28fe921f20b > -- > 2.54.0.563.g4f69b47b94-goog >