page-alloc: fix initialization of cross-node regions
authorJan Beulich <jbeulich@suse.com>
Tue, 26 Jul 2022 06:33:10 +0000 (08:33 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 26 Jul 2022 06:33:10 +0000 (08:33 +0200)
Quite obviously to determine the split condition successive pages'
attributes need to be evaluated, not always those of the initial page.

Fixes: 72b02bc75b47 ("xen/heap: pass order to free_heap_pages() in heap init")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/common/page_alloc.c

index c5c5047e7c6adeb6ec8c1d0dc55dd423221b104c..8bdaffeb3d8e19d711f581ce276eb781b5811fde 100644 (file)
@@ -1885,11 +1885,11 @@ static void init_heap_pages(
              * range to cross zones.
              */
 #ifdef CONFIG_SEPARATE_XENHEAP
-            if ( zone != page_to_zone(pg) )
+            if ( zone != page_to_zone(pg + contig_pages) )
                 break;
 #endif
 
-            if ( nid != (phys_to_nid(page_to_maddr(pg))) )
+            if ( nid != (phys_to_nid(page_to_maddr(pg + contig_pages))) )
                 break;
         }