From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46055606A339 for ; Wed, 2 Dec 2026 11:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=UNPteyYj; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HZeQZLFR DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=bXOTpFFusO1Xh2Jk5IEd/YFuWyhGMXSS5ROKTzIpeXA=; b=UNPteyYjb+SqwqyqvWDRU8JE7+ XkCgg+jsvNJlOhWHxADerC549YrWtmDMPEnWx4xa30hpTsogrpBaxp8sWW5KTd4ouYNYwN+/mfMdB 2T+J/ywcc+r6b6X/InAnxRBEES+4ZCrDMd6/oNMHXTtMoWHWoh2ystd2RSymIrfjZAWt2FhZVjL8c P3SMwXk5sJPdlWnwrm7e6pTZ1z/a9qUgJ61MhBYgwbqwg8dsx/IVbihcJEXVhMIlIWFA0q28YuPgy aUlww7y5r0W5CexfmTLIK1efgW2Uf8P7ZF/eLoLizHU0DmVtLRYhpZmf8h53vz8tqb6qYMRSyx9hz UWG/5HPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYiRt-0000000BIUr-3BsH; Wed, 02 Dec 2026 11:24:33 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYiRs-0000000BIUi-2xsy for kexec@lists.infradead.org; Wed, 02 Dec 2026 11:24:32 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 1CE1345220; Wed, 2 Dec 2026 11:24:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C3261F00896; Wed, 2 Dec 2026 11:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796210672; bh=bXOTpFFusO1Xh2Jk5IEd/YFuWyhGMXSS5ROKTzIpeXA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=HZeQZLFRMllbBQQBBZ5DpGat6GqIFDF8ATjC2FhqPHORJWt+lytHSLmWZoOaElSRd oHPLftN7cQPfK/KtTurxsWLKq99tQGBtKpD3owsHs1gkA8aQeNx73YPEaBP7TpS3Am /L4VUDDyL+BVgq+NCi70sKLyiV3INTtLSigh8izp485UzqLjOQ7b4ayf/nFStyVlrJ PF9n9a8+1r+scxNnfpZrm996XQFebO+E+FhdmoghK6jpXtJIE8RKcUWUE2RY6PmgKh cPESiJS4npYNM5O0xiBytkVlcFgZuZsz4d75FrqEfQ8jSA19w/lU9KXpyn8fG4XMzB uzLjmSV/VRjOw== Date: Wed, 2 Dec 2026 13:24:25 +0200 From: Mike Rapoport To: Chris Down 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 Message-ID: References: X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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.