|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] device-tree: Improve hwdom memory allocation for DMA
On 20/04/2026 16:54, Luca Fancellu wrote: > Hi Michal, > >> On 17 Apr 2026, at 10:11, Michal Orzel <michal.orzel@xxxxxxx> wrote: >> >> When LLC coloring is enabled, the hardware domain gets memory from >> host free regions rather than the fixed guest RAM banks. The previous >> code sorted these regions by descending size, which usually causes >> high-address memory to be allocated first. >> >> All allocated memory could reside above 4 GB leaving DMA non-functional >> for devices with limited addressing capabilities. >> >> Improve the handling as follows: >> - Sort free regions by ascending address instead of descending size, >> so low-memory banks are allocated first, >> - Skip banks smaller than 128 MB (or the total remaining allocation, >> whichever is less) until the first bank is placed, ensuring >> place_modules() has enough contiguous space, >> - Extract the hardware domain allocation path into its own function >> (allocate_hwdom_memory) for clarity. >> >> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx> >> --- >> xen/common/device-tree/domain-build.c | 152 ++++++++++++++++---------- >> 1 file changed, 96 insertions(+), 56 deletions(-) > > It looks ok to me, the only thing is that if we have many smaller banks < 128 > Mb before reaching > one that is at least 128 Mb, we won’t allocate them and loose them forever. > > It feels only a corner case so for me it’s ok Yes, that's something documented in the commit msg, so if we ever face upon the issue due to that we could revisit the implementation. For now, we haven't observed any issues. > > Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx > <mailto:luca.fancellu@xxxxxxx>> Thanks. ~Michal > > Cheers, > Luca > >
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |