All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samiullah Khawaja <skhawaja@google.com>
To: Pratyush Yadav <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>, Mike Rapoport <rppt@kernel.org>,
	 Pasha Tatashin <pasha.tatashin@soleen.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 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
Date: Mon, 9 Mar 2026 15:59:52 +0000	[thread overview]
Message-ID: <aa7uXzkRCHuY2jA6@google.com> (raw)
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)" <pratyush@kernel.org>
>
>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 <pasha.tatashin@soleen.com>
>Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
>---
>
>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
>
>

Reviewed-by: Samiullah Khawaja <skhawaja@google.com>


  parent reply	other threads:[~2026-03-09 16:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 12:34 [PATCH 1/2] kho: make sure preservations do not span multiple NUMA nodes Pratyush Yadav
2026-03-09 12:34 ` [PATCH 2/2] kho: drop restriction on maximum page order Pratyush Yadav
2026-03-10 10:33   ` Mike Rapoport
2026-03-17  9:12     ` Pratyush Yadav
2026-03-17 11:04       ` Mike Rapoport
2026-03-20 10:24         ` Pratyush Yadav
2026-03-09 15:59 ` Samiullah Khawaja [this message]
2026-03-10 10:32 ` [PATCH 1/2] kho: make sure preservations do not span multiple NUMA nodes Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa7uXzkRCHuY2jA6@google.com \
    --to=skhawaja@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=graf@amazon.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.