HomeFreeBSD

kern: physmem: improve region coalescing logic

Description

kern: physmem: improve region coalescing logic

The existing logic didn't take into account newly inserted mappings
wholly contained by an existing region (or vice versa), nor did it
account for weird overlap scenarios. The latter is probably unlikely
to happen, but the former may happen in UEFI: BootServicesData allocated
within a large chunk of ConventionalMemory. This situation blows up vm
initialization.

While we're here, remove the "exact match" logic as it's likely wrong;
if an exact match exists with conflicting flags, for instance, then we
should probably be doing something else. The new logic takes into
account exact matches as part of the overlapping efforts.

Reviewed by: kib, mhorne (both earlier version)
Differential Revision: https://reviews.freebsd.org/D32701

Details

Provenance
kevansAuthored on Oct 28 2021, 4:40 AM
Reviewer
kib
Differential Revision
D32701: kern: physmem: improve region coalescing logic
Parents
rG331883a2f2e9: nfscl: Check for a forced dismount in nfscl_getref()
Branches
Unknown
Tags
Unknown