Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Apr 2010 18:35:07 +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: r206768 - head/sys/vm
Message-ID:  <201004171835.o3HIZ7i3037483@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sat Apr 17 18:35:07 2010
New Revision: 206768
URL: http://svn.freebsd.org/changeset/base/206768

Log:
  In vm_object_backing_scan(), setting PG_REFERENCED on a page before
  sleeping on that page is nonsensical.  Doing so reduces the likelihood
  that the page daemon will reclaim the page before the thread waiting in
  vm_object_backing_scan() is reawakened.  However, it does not guarantee
  that the page is not reclaimed, so vm_object_backing_scan() restarts
  after reawakening.  More importantly, this muddles the meaning of
  PG_REFERENCED.  There is no reason to believe that the caller of
  vm_object_backing_scan() is going to use (i.e., access) the contents of
  the page.  There is especially no reason to believe that an access is
  more likely because vm_object_backing_scan() had to sleep on the page.
  
  Discussed with:	kib
  MFC after:	3 weeks

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Sat Apr 17 18:18:46 2010	(r206767)
+++ head/sys/vm/vm_object.c	Sat Apr 17 18:35:07 2010	(r206768)
@@ -1553,9 +1553,6 @@ vm_object_backing_scan(vm_object_t objec
 				}
 			} else if (op & OBSC_COLLAPSE_WAIT) {
 				if ((p->oflags & VPO_BUSY) || p->busy) {
-					vm_page_lock_queues();
-					vm_page_flag_set(p, PG_REFERENCED);
-					vm_page_unlock_queues();
 					VM_OBJECT_UNLOCK(object);
 					p->oflags |= VPO_WANTED;
 					msleep(p, VM_OBJECT_MTX(backing_object),



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