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

(cherry picked from commit 7771f2a0c94fc2f7b9ce1565a49e52dba1e7381d)

Details

Provenance
kevansAuthored on Oct 28 2021, 4:40 AM
Reviewer
kib
Differential Revision
D32701: kern: physmem: improve region coalescing logic
Parents
rG24a7d1392823: cpuset: Adapt sched_affinity compat shims to the stable/13
Branches
Unknown
Tags
Unknown