Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Sep 2015 22:28:39 +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: r287944 - head/sys/vm
Message-ID:  <201509172228.t8HMSdGQ033199@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Thu Sep 17 22:28:38 2015
New Revision: 287944
URL: https://svnweb.freebsd.org/changeset/base/287944

Log:
  Eliminate (many) unnecessary calls to pmap_remove_all().  Pages from objects
  with a reference count of zero can't possibly be mapped, so there is never a
  need for vm_page_set_invalid() to call pmap_remove_all() on them.
  
  Reviewed by:	kib
  MFC after:	1 week
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Thu Sep 17 22:07:40 2015	(r287943)
+++ head/sys/vm/vm_page.c	Thu Sep 17 22:28:38 2015	(r287944)
@@ -3096,7 +3096,8 @@ vm_page_set_invalid(vm_page_t m, int bas
 		bits = VM_PAGE_BITS_ALL;
 	else
 		bits = vm_page_bits(base, size);
-	if (m->valid == VM_PAGE_BITS_ALL && bits != 0)
+	if (object->ref_count != 0 && m->valid == VM_PAGE_BITS_ALL &&
+	    bits != 0)
 		pmap_remove_all(m);
 	KASSERT((bits == 0 && m->valid == VM_PAGE_BITS_ALL) ||
 	    !pmap_page_is_mapped(m),



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