Module Name:    src
Committed By:   pooka
Date:           Wed Oct 13 11:01:05 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpkern: vm.c

Log Message:
Don't reorder page on the age queue if the lookup is done by the
pagedaemon.  This mimics normal kernel behaviour where pmap_kentered
mappings are not tracked for references.  Without this change the
vnode pager's clustering could cause one page to be released by
the pagedaemon, and the rest of the pages in the pageout cluster
made unlikely candidates to be released soon.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/rump/librump/rumpkern/vm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.96 src/sys/rump/librump/rumpkern/vm.c:1.97
--- src/sys/rump/librump/rumpkern/vm.c:1.96	Fri Sep 24 22:51:51 2010
+++ src/sys/rump/librump/rumpkern/vm.c	Wed Oct 13 11:01:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.96 2010/09/24 22:51:51 rmind Exp $	*/
+/*	$NetBSD: vm.c,v 1.97 2010/10/13 11:01:04 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.96 2010/09/24 22:51:51 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.97 2010/10/13 11:01:04 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -464,14 +464,23 @@
 	return pg;
 }
 
-/* Called with the vm object locked */
+/*
+ * Called with the vm object locked.
+ *
+ * Put vnode object pages at the end of the access queue to indicate
+ * they have been recently accessed and should not be immediate
+ * candidates for pageout.  Do not do this for lookups done by
+ * the pagedaemon to mimic pmap_kentered mappings which don't track
+ * access information.
+ */
 struct vm_page *
 uvm_pagelookup(struct uvm_object *uobj, voff_t off)
 {
 	struct vm_page *pg;
+	bool ispagedaemon = curlwp == uvm.pagedaemon_lwp;
 
 	pg = rb_tree_find_node(&uobj->rb_tree, &off);
-	if (pg && !UVM_OBJ_IS_AOBJ(pg->uobject)) {
+	if (pg && !UVM_OBJ_IS_AOBJ(pg->uobject) && !ispagedaemon) {
 		mutex_enter(&uvm_pageqlock);
 		TAILQ_REMOVE(&vmpage_lruqueue, pg, pageq.queue);
 		TAILQ_INSERT_TAIL(&vmpage_lruqueue, pg, pageq.queue);

Reply via email to