]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC 313186, 319702: Account for overhead of page structures when sizing page array.
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 21 Jun 2017 14:39:31 +0000 (14:39 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 21 Jun 2017 14:39:31 +0000 (14:39 +0000)
commitb44958a5655695e538db7e616951913dc632ec27
tree7cb7439255b443cf91ebdfbf58b84397ab42d813
parent193a4e5b57b02ac9d09b22438b4c72ec9dcc2f72
MFC 313186, 319702: Account for overhead of page structures when sizing page array.

313186:

Over the years, the code and comments in vm_page_startup() have diverged in
one respect.  When determining how many page structures to allocate,
contrary to what the comments say, the code does not account for the
overhead of a page structure per page of physical memory.  This revision
changes the code to match the comments.

319702:

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

r313186 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[].

Requested by: alc

git-svn-id: svn://svn.freebsd.org/base/stable/10@320190 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/vm/vm_page.c