Correct an error in vm_reserv_reclaim_contig(). In the highly unusual

case that the reservation contained "low", the starting position in the
popmap for the free page search was incorrectly calculated.  The most
likely (and visible) symptom of this error was the assertion failure,
"vm_reserv_reclaim_contig: pa is too low".
This commit is contained in:
Alan Cox 2015-11-26 19:12:18 +00:00
parent e096498a0c
commit 67b7e4345e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291370

View File

@ -971,7 +971,7 @@ vm_reserv_reclaim_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
{
vm_paddr_t pa, size;
vm_reserv_t rv;
int hi, i, lo, next_free;
int hi, i, lo, low_index, next_free;
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
if (npages > VM_LEVEL_0_NPAGES - 1)
@ -990,8 +990,9 @@ vm_reserv_reclaim_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
}
if (pa < low) {
/* Start the search for free pages at "low". */
i = (low - pa) / NBPOPMAP;
hi = (low - pa) % NBPOPMAP;
low_index = (low + PAGE_MASK - pa) >> PAGE_SHIFT;
i = low_index / NBPOPMAP;
hi = low_index % NBPOPMAP;
} else
i = hi = 0;
do {