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 C2E4B30FC23 for ; Tue, 10 Mar 2026 10:32:15 +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=1773138735; cv=none; b=HkDxckTBed7HaJTlWutgDBJeBpNa1eR8Zlac60Qy6h1hUWhIHkw+6wCEEDv4cHdelJDrrmG6lf/y1IniEtmkil3THMWNS6fGxmcpqfukzP7ajB/KRdjGkEs0ZmC2kaep3GSVJnFizYk4/hUAWnqVoBJBUbTVSOi25QG4JS8xIMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773138735; c=relaxed/simple; bh=ZAajPCZBWnuyiHXT/HC/E7AWtxibfHeRxEoqFvx/SPk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AFIDQJzTq3Z2S1xvxj8/0YpfApoI0JjGjGMQd7pN1r/LOokt/wpl6ScGRMVzDT1etxUjXXzT6usNe7Vw4uvgaTbLUXFokyG0sxpsXpMyzd54hyzhKo1pqESCM4lOxUNSqWmazyB+y6/IAbIVuAxvUrHSxybg0goTMdc3oji/As4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WLBubtiy; 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="WLBubtiy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E01C4C19423; Tue, 10 Mar 2026 10:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773138735; bh=ZAajPCZBWnuyiHXT/HC/E7AWtxibfHeRxEoqFvx/SPk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WLBubtiyvjjuzUzuIpOM/fjq+FTbtXBIm8ZoTRqrnLL49dgS29NGyxzfLRF9Rgt4H fc2qPAsrsr9xDCUf2rMUjN4NeZJnOzz5ifzx7SKfHviwG033YS/VwBY21GWr2zpoy0 nNIrTb069ljo1jW6gaFoGlwakT0BR+PCuNAbh4YsvXIKV+ItLIdKNKL9dZ1awtRQle L/eqipk8Mq0yUMMee0XueXnXiM1Efio6OHyzySi875QgfTeq1mvntAI7hA7m1jTxbr EgjjC6OS6t0EpjGgn1DbWBJa4HW196mKxBPFsjPeMtN+Fa5mGlFqhQxtqfM/FqaF/F 7sl4bVYdv1TYQ== Date: Tue, 10 Mar 2026 12:32:09 +0200 From: Mike Rapoport To: Pratyush Yadav Cc: Alexander Graf , Pasha Tatashin , Andrew Morton , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] kho: make sure preservations do not span multiple NUMA nodes Message-ID: 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260309123410.382308-1-pratyush@kernel.org> On Mon, Mar 09, 2026 at 12:34:06PM +0000, Pratyush Yadav wrote: > From: "Pratyush Yadav (Google)" > > The KHO restoration machinery is not capable of dealing with > preservations that span multiple NUMA nodes. kho_preserve_folio() > guarantees the preservation will only span one NUMA node since folios > can't span multiple nodes. > > This leaves kho_preserve_pages(). While semantically > kho_preserve_pages() only deals with 0-order pages, so all preservations > should be single page only, in practice it combines preservations to > higher orders for efficiency. This can result in a preservation spanning > multiple nodes. Break up the preservations into a smaller order if that > happens. > > Suggested-by: Pasha Tatashin > Signed-off-by: Pratyush Yadav (Google) Reviewed-by: Mike Rapoport (Microsoft) > --- > > Notes: > Ref: https://lore.kernel.org/linux-mm/CA+CK2bDvaGmfkCPCMWM6gPcd4FfUyD6e5yWE+kNcma1vT3Jw3g@mail.gmail.com/ > > kernel/liveupdate/kexec_handover.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c > index cc68a3692905..bc9bd18294ee 100644 > --- a/kernel/liveupdate/kexec_handover.c > +++ b/kernel/liveupdate/kexec_handover.c > @@ -869,9 +869,17 @@ int kho_preserve_pages(struct page *page, unsigned long nr_pages) > } > > while (pfn < end_pfn) { > - const unsigned int order = > + unsigned int order = > min(count_trailing_zeros(pfn), ilog2(end_pfn - pfn)); > > + /* > + * Make sure all the pages in a single preservation are in the > + * same NUMA node. The restore machinery can not cope with a > + * preservation spanning multiple NUMA nodes. > + */ > + while (pfn_to_nid(pfn) != pfn_to_nid(pfn + (1UL << order) - 1)) > + order--; > + > err = __kho_preserve_order(track, pfn, order); > if (err) { > failed_pfn = pfn; > -- > 2.53.0.473.g4a7958ca14-goog > -- Sincerely yours, Mike.