skiboot icon indicating copy to clipboard operation
skiboot copied to clipboard

Smarter memory allocation in fdt creation

Open npiggin opened this issue 2 years ago • 0 comments

Currently fdt creation just loops on ENOSPC, doubling the malloc size and trying again.

4 node Denali (d5) the device tree has just exceeded the 512k initial malloc size. This causes a scary looking error message and throws out all the fdt work to start again.

Might be better to instead allow size failures to realloc the fdt (except in the opal call case) and continue. This may cost a memcpy but it should be much cheaper than rebuilding the whole tree each time. Initial allocation and increment sizes could be more conservative to save memory too.

npiggin avatar May 27 '22 09:05 npiggin