Module Name: src Committed By: yamt Date: Wed Jan 11 00:08:41 UTC 2012
Modified Files: src/sys/uvm [yamt-pagecache]: uvm_extern.h uvm_loan.c uvm_meter.c Log Message: create a sysctl knob to turn on/off loaned read. To generate a diff of this commit: cvs rdiff -u -r1.176.2.6 -r1.176.2.7 src/sys/uvm/uvm_extern.h cvs rdiff -u -r1.81.2.9 -r1.81.2.10 src/sys/uvm/uvm_loan.c cvs rdiff -u -r1.56.4.6 -r1.56.4.7 src/sys/uvm/uvm_meter.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/uvm/uvm_extern.h diff -u src/sys/uvm/uvm_extern.h:1.176.2.6 src/sys/uvm/uvm_extern.h:1.176.2.7 --- src/sys/uvm/uvm_extern.h:1.176.2.6 Mon Dec 26 16:03:10 2011 +++ src/sys/uvm/uvm_extern.h Wed Jan 11 00:08:40 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_extern.h,v 1.176.2.6 2011/12/26 16:03:10 yamt Exp $ */ +/* $NetBSD: uvm_extern.h,v 1.176.2.7 2012/01/11 00:08:40 yamt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -504,6 +504,8 @@ struct uvmexp_sysctl { extern struct uvmexp uvmexp; /* MD code needs this without including <uvm/uvm.h> */ extern bool vm_page_zero_enable; + +extern bool vm_loan_read; #endif /* Index: src/sys/uvm/uvm_loan.c diff -u src/sys/uvm/uvm_loan.c:1.81.2.9 src/sys/uvm/uvm_loan.c:1.81.2.10 --- src/sys/uvm/uvm_loan.c:1.81.2.9 Wed Jan 4 16:31:17 2012 +++ src/sys/uvm/uvm_loan.c Wed Jan 11 00:08:41 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_loan.c,v 1.81.2.9 2012/01/04 16:31:17 yamt Exp $ */ +/* $NetBSD: uvm_loan.c,v 1.81.2.10 2012/01/11 00:08:41 yamt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.9 2012/01/04 16:31:17 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.10 2012/01/11 00:08:41 yamt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -42,7 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v #include <uvm/uvm.h> -bool doloanobj = true; +bool vm_loan_read = true; /* * "loaned" pages are pages which are (read-only, copy-on-write) loaned @@ -1304,7 +1304,7 @@ uvm_loanobj(struct uvm_object *uobj, str size_t len; int i, error = 0; - if (!doloanobj) { + if (!vm_loan_read) { return ENOSYS; } Index: src/sys/uvm/uvm_meter.c diff -u src/sys/uvm/uvm_meter.c:1.56.4.6 src/sys/uvm/uvm_meter.c:1.56.4.7 --- src/sys/uvm/uvm_meter.c:1.56.4.6 Mon Dec 26 16:03:11 2011 +++ src/sys/uvm/uvm_meter.c Wed Jan 11 00:08:41 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_meter.c,v 1.56.4.6 2011/12/26 16:03:11 yamt Exp $ */ +/* $NetBSD: uvm_meter.c,v 1.56.4.7 2012/01/11 00:08:41 yamt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.56.4.6 2011/12/26 16:03:11 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.56.4.7 2012/01/11 00:08:41 yamt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -322,6 +322,12 @@ SYSCTL_SETUP(sysctl_vm_setup, "sysctl vm SYSCTL_DESCR("Whether try to zero pages in idle loop"), NULL, 0, &vm_page_zero_enable, 0, CTL_VM, CTL_CREATE, CTL_EOL); + sysctl_createv(clog, 0, NULL, NULL, + CTLFLAG_PERMANENT|CTLFLAG_READWRITE, + CTLTYPE_BOOL, "loanread", + SYSCTL_DESCR("Use page loaning for read"), + NULL, 0, &vm_loan_read, 0, + CTL_VM, CTL_CREATE, CTL_EOL); uvmpdpol_sysctlsetup(); }