]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix an off-by-one error in the VM page array on some systems.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 8 Jun 2017 16:18:41 +0000 (16:18 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 8 Jun 2017 16:18:41 +0000 (16:18 +0000)
commit4bd7e351f1bebaa86b851f0cbc43f8d46be50a86
tree77b27f6a85d48c1cd30f7a17f3cb96e6c4d05925
parent86dd278f036d78d54e407fa6b41d61571fc5fdb8
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
sys/vm/vm_page.c