In vm_page_ps_test(), always check that the base pages within the specified

superpage all belong to the same object.  To date, that check has not been
needed, but upcoming changes require it.  (See the Differential Revision.)

Reviewed by:	kib, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11556
This commit is contained in:
Alan Cox 2017-07-23 05:54:56 +00:00
parent 4e64c62564
commit 1d3b9818e7

View File

@ -3478,9 +3478,11 @@ vm_page_is_valid(vm_page_t m, int base, int size)
bool
vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip_m)
{
vm_object_t object;
int i, npages;
VM_OBJECT_ASSERT_LOCKED(m->object);
object = m->object;
VM_OBJECT_ASSERT_LOCKED(object);
npages = atop(pagesizes[m->psind]);
/*
@ -3489,6 +3491,9 @@ vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip_m)
* occupy adjacent entries in vm_page_array[].
*/
for (i = 0; i < npages; i++) {
/* Always test object consistency, including "skip_m". */
if (m[i].object != object)
return (false);
if (&m[i] == skip_m)
continue;
if ((flags & PS_NONE_BUSY) != 0 && vm_page_busied(&m[i]))