Skip to content

Clarify our use of fallocate vs just writing bytes #38

@gerion0

Description

@gerion0

Currently, the swap files seem to be allocated by opening a file and writing zeros in it (with fill_swapfile/write_data). This takes a lot of time and normally has no real benefit, since the data is overwritten anyway.

For these cases, Linux and glibc provide the fallocate-call, which instantly can allocate a large block of data (and is supported on all major file systems and usable for swap files).
I think, this syscall would be much better suited for this program, since the time to allocate swap would basically disappear completely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions