Entities building domains are expected to deal with higher order allocation attempts (for populating a new domain) failing. If we set aside a reservation for DMA, try to avoid taking higher order pages from that reserve pool. Instead favor order-0 ones which often can still be supplied from higher addressed memory, even if we've run out of large/huge pages there.
Signed-off-by: Jan Beulich <[email protected]> --- RFC: More generally for any requests targeting remote domains? --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -192,6 +192,14 @@ static void populate_physmap(struct memo * delayed. */ a->memflags |= MEMF_no_icache_flush; + + /* + * Heuristically assume that during domain construction the caller is + * capable of falling back to order-0 allocations, allowing us to + * conserve on memory otherwise held back for DMA purposes. + */ + if ( a->extent_order ) + a->memflags |= MEMF_no_dma; } for ( i = a->nr_done; i < a->nr_extents; i++ )
