From mboxrd@z Thu Jan 1 00:00:00 1970 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 5E1473B3C12 for ; Mon, 9 Mar 2026 12:34:57 +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=1773059697; cv=none; b=NPGddQcvPHunPUA0sFwt9PyxNckScxFbddmiUojwX6xDhDiYTv+Ag3Mko9ZU01ma8aFMSMC6erR2h06ZPHVhost4TdTW3ovD2ZgDSBUT5hSwtJnxCcZxx6FgS03gQiNHDb/LB7QtD518nrEe6AMMODQSrNCjIQoPFvKp5s8R0+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773059697; c=relaxed/simple; bh=+0wA474v7nGumxjsD4uBjOHoecHS+At9sWy47yvU5l0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HshWXT2PWNbzEpsup/vBiwVbviE8jW2KyhOo6fQy83pj7gatfAqiCWoMUiHqLvY2bo8Fu2MOtBv5OG8q9LzuB10cRjSX7w8xNxVaz4FajGws+5A3USK62g5Wljtbm/XXJ+Dj8ffguWcrfEjG8xPt1hve/ll5cOpl5e2fjU/RggU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VgRs7yMh; 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="VgRs7yMh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62E5AC2BC86; Mon, 9 Mar 2026 12:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773059697; bh=+0wA474v7nGumxjsD4uBjOHoecHS+At9sWy47yvU5l0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VgRs7yMhnJmvtZQe6EkaO6+UoTSVjE9edgYr80SRJ2nUwqQ+tMX3FpQy0xEUzElMa GfKLr1bFcQ3BBJFwmFS36Jm3ULHgZZUQfkZ6TbtdS2lBvAWOj6MYOAeS5qZ1JhUge4 U4OnGbdoMqOLhOAfFvzeVtcpwlfPzR/152dQvJAQMno18ikG+2u/7CpP9oirOn1KqR kgCqOnhQ5AzednCk+s2cw5aTdEYLFBNp1qE15umTtU2PPaTmAPlo8RGXErq8c/PWTE cYT0FseEtymrV41BwP5IDGMSJ1KEy2sszqbVIrS76ThxLAhwyq11rCJJ2HEl9+D03W JOQShaugTHwrw== From: Pratyush Yadav To: Alexander Graf , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , Andrew Morton Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] kho: drop restriction on maximum page order Date: Mon, 9 Mar 2026 12:34:07 +0000 Message-ID: <20260309123410.382308-2-pratyush@kernel.org> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog In-Reply-To: <20260309123410.382308-1-pratyush@kernel.org> References: <20260309123410.382308-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-Transfer-Encoding: 8bit KHO currently restricts the maximum order of a restored page to the maximum order supported by the buddy allocator. While this works fine for much of the data passed across kexec, it is possible to have pages larger than MAX_PAGE_ORDER. For one, it is possible to get a larger order when using kho_preserve_pages() if the number of pages is large enough, since it tries to combine multiple aligned 0-order preservations into one higher order preservation. For another, upcoming support for hugepages can have gigantic hugepages being preserved over KHO. There is no real reason for this limit. The KHO preservation machinery can handle any page order. Remove this artificial restriction on max page order. Signed-off-by: Pratyush Yadav Signed-off-by: Pratyush Yadav (Google) --- Notes: This patch was first sent with this RFC series [0]. I am sending it separately since it is an independent patch that is useful even without hugepage preservation. No changes since the RFC. [0] https://lore.kernel.org/linux-mm/20251206230222.853493-1-pratyush@kernel.org/T/#u kernel/liveupdate/kexec_handover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c index bc9bd18294ee..1038e41ff9f9 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -253,7 +253,7 @@ static struct page *kho_restore_page(phys_addr_t phys, bool is_folio) * check also implicitly makes sure phys is order-aligned since for * non-order-aligned phys addresses, magic will never be set. */ - if (WARN_ON_ONCE(info.magic != KHO_PAGE_MAGIC || info.order > MAX_PAGE_ORDER)) + if (WARN_ON_ONCE(info.magic != KHO_PAGE_MAGIC)) return NULL; nr_pages = (1 << info.order); -- 2.53.0.473.g4a7958ca14-goog