On Thu, Apr 21, 2022 at 11:33:24AM +0200, Gerd Hoffmann wrote:
When running out of memory get a chunk of memory from ZoneTmpHigh to expand ZoneHigh. Drop simliar logic fro pmm code because it's not needed ay more.
This fixes some scalability problems, for example with lots of vcpus, where seabios runs out of memory due to large smbios/acpi tables.
I'm not sure this is a good idea, because it could cause subtle issues with reproducibility.
SeaBIOS does not have a deterministic ordering to memory allocations because of its implementation of "threads" (coroutines). Should permanent allocations need to spill over to ZoneTmpHigh then it will likely result in a fragmented e820 memory map. In that case, there is a good chance that different bootups will have different e820 maps, which may result in different OS behavior.
The goal of ZoneHigh was to be the maximum amount of space needed. Unused space gets returned to the e820 map before boot, so there is generally not much harm in increasing it. Order of allocations in the ZoneHigh region is less important because we generally don't free allocations in that zone.
IIRC, the pmm ZoneTmpHigh hack was primarily intended for ridiculously large allocations (like framebuffers) where allocating from the e820 map was the only feasible solution.
What's using the ZoneHigh region that is so large that we need to expand it?
-Kevin