Skip to content

Smarter memory allocation in fdt creation #272

Open
@npiggin

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions