Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/yamt-pagecache]: src/sys/uvm turn vm.loanread sysctl to a threshold.
details: https://anonhg.NetBSD.org/src/rev/a2d98e34a3d6
branches: yamt-pagecache
changeset: 770869:a2d98e34a3d6
user: yamt <yamt%NetBSD.org@localhost>
date: Sun Feb 05 04:58:29 2012 +0000
description:
turn vm.loanread sysctl to a threshold.
diffstat:
sys/uvm/uvm_extern.h | 4 ++--
sys/uvm/uvm_loan.c | 8 ++++----
sys/uvm/uvm_meter.c | 11 ++++++-----
3 files changed, 12 insertions(+), 11 deletions(-)
diffs (86 lines):
diff -r 2eff7fa2c546 -r a2d98e34a3d6 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h Wed Jan 25 00:41:36 2012 +0000
+++ b/sys/uvm/uvm_extern.h Sun Feb 05 04:58:29 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_extern.h,v 1.176.2.7 2012/01/11 00:08:40 yamt Exp $ */
+/* $NetBSD: uvm_extern.h,v 1.176.2.8 2012/02/05 04:58:29 yamt Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -505,7 +505,7 @@
/* MD code needs this without including <uvm/uvm.h> */
extern bool vm_page_zero_enable;
-extern bool vm_loan_read;
+extern int vm_loan_read_thresh;
#endif
/*
diff -r 2eff7fa2c546 -r a2d98e34a3d6 sys/uvm/uvm_loan.c
--- a/sys/uvm/uvm_loan.c Wed Jan 25 00:41:36 2012 +0000
+++ b/sys/uvm/uvm_loan.c Sun Feb 05 04:58:29 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_loan.c,v 1.81.2.13 2012/01/25 00:41:36 yamt Exp $ */
+/* $NetBSD: uvm_loan.c,v 1.81.2.14 2012/02/05 04:58:29 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.13 2012/01/25 00:41:36 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.14 2012/02/05 04:58:29 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -42,7 +42,7 @@
#include <uvm/uvm.h>
-bool vm_loan_read = true;
+int vm_loan_read_thresh = MAXPHYS;
/*
* "loaned" pages are pages which are (read-only, copy-on-write) loaned
@@ -1304,7 +1304,7 @@
size_t len;
int i, error = 0;
- if (!vm_loan_read) {
+ if (vm_loan_read_thresh > 0 && uio->uio_resid < vm_loan_read_thresh) {
return ENOSYS;
}
diff -r 2eff7fa2c546 -r a2d98e34a3d6 sys/uvm/uvm_meter.c
--- a/sys/uvm/uvm_meter.c Wed Jan 25 00:41:36 2012 +0000
+++ b/sys/uvm/uvm_meter.c Sun Feb 05 04:58:29 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_meter.c,v 1.56.4.7 2012/01/11 00:08:41 yamt Exp $ */
+/* $NetBSD: uvm_meter.c,v 1.56.4.8 2012/02/05 04:58:29 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.7 2012/01/11 00:08:41 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.56.4.8 2012/02/05 04:58:29 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -324,9 +324,10 @@
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,
+ CTLTYPE_INT, "loan_read_thresh",
+ SYSCTL_DESCR(
+ "Threshold in bytes to use page loaning for read"),
+ NULL, 0, &vm_loan_read_thresh, 0,
CTL_VM, CTL_CREATE, CTL_EOL);
uvmpdpol_sysctlsetup();
Home |
Main Index |
Thread Index |
Old Index