Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Apr 2012 00:32:56 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r234522 - user/attilio/vmcontention/sys/vm
Message-ID:  <201204210032.q3L0Wud6063005@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Sat Apr 21 00:32:56 2012
New Revision: 234522
URL: http://svn.freebsd.org/changeset/base/234522

Log:
  Fix a brain-o.
  vm_page_lookup_cache() is not exported and cannot be used arbitrarely.
  
  Reported by:	pho

Modified:
  user/attilio/vmcontention/sys/vm/vm_mmap.c

Modified: user/attilio/vmcontention/sys/vm/vm_mmap.c
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_mmap.c	Sat Apr 21 00:28:29 2012	(r234521)
+++ user/attilio/vmcontention/sys/vm/vm_mmap.c	Sat Apr 21 00:32:56 2012	(r234522)
@@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_pageout.h>
 #include <vm/vm_extern.h>
 #include <vm/vm_page.h>
+#include <vm/vm_radix.h>
 #include <vm/vnode_pager.h>
 
 #ifdef HWPMC_HOOKS
@@ -887,11 +888,13 @@ RestartScan:
 				    object->type == OBJT_VNODE) {
 					pindex = OFF_TO_IDX(current->offset +
 					    (addr - current->start));
-					m = vm_page_lookup(object, pindex);
+					m = vm_radix_lookup(&object->rtree,
+					    pindex, VM_RADIX_ANY);
+
+					/* Lock just for consistency. */
 					mtx_lock(&vm_page_queue_free_mtx);
-					if (m == NULL &&
-					    vm_page_cache_lookup(object,
-					    pindex) != NULL)
+					if (m != NULL &&
+					    (m->flags & PG_CACHED) != 0)
 						mincoreinfo = MINCORE_INCORE;
 					mtx_unlock(&vm_page_queue_free_mtx);
 					if (m != NULL && m->valid == 0)



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