Page MenuHomeFreeBSD

kboot: Allocate a really big first segment
ClosedPublic

Authored by imp on Feb 1 2023, 6:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 16, 1:33 PM
Unknown Object (File)
Tue, Jul 16, 1:32 PM
Unknown Object (File)
Jun 24 2024, 1:25 AM
Unknown Object (File)
Jun 13 2024, 1:17 AM
Unknown Object (File)
May 26 2024, 12:39 AM
Unknown Object (File)
May 26 2024, 12:39 AM
Unknown Object (File)
May 26 2024, 12:39 AM
Unknown Object (File)
May 26 2024, 12:39 AM
Subscribers

Details

Summary

Allocate a huge segment for the first kexec_load segments. We limit the
lessor of:
allocation to the size of the remaining memory segment
45% of available memory
95% of the memory we can allocate

This allows us to have really large RAM disks. We likely need to limit
this to the amount we actually used, though, since this can be a lot of
memory.

We have to do this complicated calculation for a few reasons: First, we
need 2 copies of the loaded kernel in the memory: The kernel can copy
everything to a temporary buffer. Next, malloc (via mmap) is limited to
a certain amount due to over commit, so we have to not allocate all we
can (only most of what we can).

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49384
Build 46274: arc lint + arc unit