Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kho: make sure preservations do not span multiple NUMA nodes

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.

Link: https://lkml.kernel.org/r/20260309123410.382308-1-pratyush@kernel.org
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Suggested-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Pratyush Yadav (Google) and committed by
Andrew Morton
91e74fa8 396042fb

+9 -1
+9 -1
kernel/liveupdate/kexec_handover.c
··· 870 870 } 871 871 872 872 while (pfn < end_pfn) { 873 - const unsigned int order = 873 + unsigned int order = 874 874 min(count_trailing_zeros(pfn), ilog2(end_pfn - pfn)); 875 + 876 + /* 877 + * Make sure all the pages in a single preservation are in the 878 + * same NUMA node. The restore machinery can not cope with a 879 + * preservation spanning multiple NUMA nodes. 880 + */ 881 + while (pfn_to_nid(pfn) != pfn_to_nid(pfn + (1UL << order) - 1)) 882 + order--; 875 883 876 884 err = kho_radix_add_page(tree, pfn, order); 877 885 if (err) {