From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 CFAA73DA7C9 for ; Mon, 9 Mar 2026 15:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773072000; cv=none; b=WVNRVPv7CHySTRxXz1GSTJlXY7LJYPpjJhntE6YYjliCDfDJf1iQ+pBNo8zN49yGqKlW0QF8yVwrl/LgQSckPc0bMT6XDjMrZs9Xs8CdLMLt9GghGumnjOmGbB5UtuW7IfpCawzGUYnOlP7DZTXN7TJF8CvwH29ju2BaAwccCTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773072000; c=relaxed/simple; bh=2i4nIdXI/fCHVxabwOzsm/0yzgGmaG0ZUtLTCBXXIs4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wya5AY2xYznjyaBd0LrOOrBDKVblhiPrmPLbu5kDYtmxMgxLGZix9GkkVwUa2h980mtgPRoXh4hkECeI1+HJUQ2xR7yId0OorhM1I8lM3afe1h/LjGfgR1sxQa6A6sTQQqEzASDaZ/StEQmtT4g9khWQsOxda6BOAtBn0+121A4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bbZXkirJ; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bbZXkirJ" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2ae49120e97so157125ad.0 for ; Mon, 09 Mar 2026 08:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773071998; x=1773676798; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TdgCe2J3lvudY3Ri4RUwnY+/LSuwRgctaurAZvpEmI4=; b=bbZXkirJGw4+Sp6X+WjBv0a1utC8XsXwYCEumANtoalacYSRb8IP+HNyVbIjqsLpN2 AGANnhIAel1Crj/xlkixGBGxSKVOBR9a7d+PlHQDDJMD+B26XifSR/frpFLjTVC0MNRx gACtjXY2PzQAYYCkuHCrYFV28O1lTtlujsqjOmnOjVgExQW1joowqZmT0FxOgIHFshCV RB1fKujNd2FmGAyYwmKenpMUF5Zzi++60Z7EVfM0xYgzLsLcqTzUBrwz7mzMQMSm4Jvm mmLEZw0r3FO92kiElUwsjut7aMqZnXuu3KBC9jqPWClaaEAa2Nl5BGpm2+WnaTMqRrZ3 OjUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773071998; x=1773676798; h=in-reply-to: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=TdgCe2J3lvudY3Ri4RUwnY+/LSuwRgctaurAZvpEmI4=; b=rSHHXqMTYNWNes7lEthOpcrR6jMju3Z6td5wEzBlZYggS6n3NjsNFAxzay5yhbUFad t4MPatkE5VgmdFiyhjwEJLJ3h7rjC93yq0FyRbhN62ZG2Dm0Wgeqzm76yWrntQdV61jR X4/rHQ3GQgkrjPMTHIwAjXQ7hbo/eMmV9YgrK+9vO984OYQpiG4MoiJmItZ+pdVozeZZ 2/BZfdAYtszjXSRqvgslDzGo7g+NsYwhbKqn7RWT5/h6IABpakr4cgyXRLY4Uqm97rah 48v3VqhJNsm7IdcUDljbKfh5XKTXKR+RtIsnXB9dn2k57KB0dxONYwy9vZGq8zQZcHG7 1Hrw== X-Forwarded-Encrypted: i=1; AJvYcCX+tAyz2c9EA5z914/L6jvh10U2EfaBgZxCW0ZboW8Cqn74Xg62KoSDqaTbEXFz0Mj3vdbFkOiVlrlIuRo=@vger.kernel.org X-Gm-Message-State: AOJu0YyO5IawXmZuiwCgEWyUpARxzPkF9B6P4Y3PCb4Rdr4hkjgt5T2K +bByu5Jc0FpkF2ZPVEHnE+yw33leFAhs9TMibge38VqGpXVYK5z6hukZn8L+CEDZLw== X-Gm-Gg: ATEYQzywIxCFRfhyH+VKMa665XSBZYifd9Olg7/SUPIm47r5GtezsR8aBMEah2Jyxrk 9+YYotQzIjzriWmZKfp6zKV+n44kIUla9v1ZA5qj28OejW558hf/aJEQEjoazSrR1gCF2ShzfSC EjWa3T7zTqxXp6xKDzm/n/0YMOOvYv9WcKGQXSDBgYNUkAeOuxvYAbPnE9MwhZG3YWcCbJvYd+4 Om8415vu5XqeGIJlc2fjBQhpvSQkOw4xZRrmERQkZjvAi+Bvx1dJYLMVx5ir4k7IteLawPjMfJ4 DrIH+cYorhVzBJVr5EnM6yMRfupnWVWV4mg1+GTv6GknZ22QzYWwGsCfICXmF9Uqsz8L+AHc83H /LNGwljymxJJdFRPI1kms9q8rFrmNqF3Icw6JthUxQEAB1psKxgS0FQHvc9kBi8Yr4c6RmBHdff ah7GpR5OEd/HcSJNanCAS5u8KLlkQ3EQ45gGcvjGPY2ixwKKXe/jileEVOuAo/fg== X-Received: by 2002:a17:903:98c:b0:2ae:6432:8f77 with SMTP id d9443c01a7336-2ae8ba59672mr3148705ad.17.1773071997647; Mon, 09 Mar 2026 08:59:57 -0700 (PDT) Received: from google.com (168.136.83.34.bc.googleusercontent.com. [34.83.136.168]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ae840ad894sm162231525ad.80.2026.03.09.08.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 08:59:56 -0700 (PDT) Date: Mon, 9 Mar 2026 15:59:52 +0000 From: Samiullah Khawaja To: Pratyush Yadav Cc: Alexander Graf , Mike Rapoport , 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; format=flowed 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) >--- > >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