Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jul 2017 05:54:56 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321377 - head/sys/vm
Message-ID:  <201707230554.v6N5su45032378@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Jul 23 05:54:56 2017
New Revision: 321377
URL: https://svnweb.freebsd.org/changeset/base/321377

Log:
  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

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Sat Jul 22 21:29:44 2017	(r321376)
+++ head/sys/vm/vm_page.c	Sun Jul 23 05:54:56 2017	(r321377)
@@ -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
 	 * 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]))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707230554.v6N5su45032378>