Correct an off-by-one error in vm_reserv_reclaim_contig() that results in

an infinite loop.

Submitted by:	Svatopluk Kraus
MFC after:	1 week
This commit is contained in:
Alan Cox 2015-04-11 22:57:13 +00:00
parent 849d143dba
commit 6a93e36b5f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281444

View File

@ -983,8 +983,18 @@ vm_reserv_reclaim_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
break;
} else if ((pa & (alignment - 1)) != 0 ||
((pa ^ (pa + size - 1)) & ~(boundary - 1)) != 0) {
/* Continue with this reservation. */
hi = lo;
/*
* The current page doesn't meet the alignment
* and/or boundary requirements. Continue
* searching this reservation until the rest
* of its free pages are either excluded or
* exhausted.
*/
hi = lo + 1;
if (hi >= NBPOPMAP) {
hi = 0;
i++;
}
continue;
}
/* Find the next used page. */