HomeFreeBSD

Fix an off-by-one error in the VM page array on some systems.

Description

Fix an off-by-one error in the VM page array on some systems.

r31386 changed how the size of the VM page array was calculated to be
less wasteful. For most systems, the amount of memory is divided by
the overhead required by each page (a page of data plus a struct vm_page)
to determine the maximum number of available pages. However, if the
remainder for the first non-available page was at least a page of data
(so that the only memory missing was a struct vm_page), this last page
was left in phys_avail[] but was not allocated an entry in the VM page
array. Handle this case by explicitly excluding the page from
phys_avail[].

Reviewed by: alc
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D11000

Details

Provenance
jhbAuthored on
Reviewer
alc
Differential Revision
D11000: Fix an off-by-one error in the VM page array on some systems.
Parents
rS319701: MFC r313021, r319621:
Branches
Unknown
Tags
Unknown