HomeFreeBSD

vm_page_startup(): Clarify memory lowest, highest and size computation

Description

vm_page_startup(): Clarify memory lowest, highest and size computation

Change the comment before this block of code, and separate the latter
from the preceding one by an empty line.

Move the loop on phys_avail[] to compute the minimum and maximum memory
physical addresses closer to the initialization of 'low_avail' and
'high_avail', so that it's immediately clear why the loop starts at
2 (and remove the related comment).

While here, fuse the additional loop in the VM_PHYSSEG_DENSE case that
is used to compute the exact physical memory size.

This change suppresses one occurence of detecting whether at least one
of VM_PHYSSEG_DENSE or VM_PHYSSEG_SPARSE is defined at compile time, but
there is still another one in PHYS_TO_VM_PAGE().

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48632

Details

Provenance
olceAuthored on Oct 29 2024, 10:41 AM
Reviewer
markj
Differential Revision
D48632: vm_page_startup(): Clarify memory lowest, highest and size computation
Parents
rG32e77bcdec5c: vm_phys_early_startup(): Panic if phys_avail[] is empty
Branches
Unknown
Tags
Unknown