Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/yamt-pagecache]: src/sys uvm_loanabj: take an access pattern hint.
details: https://anonhg.NetBSD.org/src/rev/2eff7fa2c546
branches: yamt-pagecache
changeset: 770868:2eff7fa2c546
user: yamt <yamt%NetBSD.org@localhost>
date: Wed Jan 25 00:41:36 2012 +0000
description:
uvm_loanabj: take an access pattern hint.
diffstat:
sys/fs/tmpfs/tmpfs_vnops.c | 9 +++++----
sys/nfs/nfs_bio.c | 9 +++++----
sys/rump/librump/rumpkern/vm.c | 6 +++---
sys/ufs/ufs/ufs_readwrite.c | 6 +++---
sys/uvm/uvm_loan.c | 14 +++++++-------
sys/uvm/uvm_loan.h | 4 ++--
6 files changed, 25 insertions(+), 23 deletions(-)
diffs (223 lines):
diff -r 8f167bf0cb92 -r 2eff7fa2c546 sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c Wed Jan 25 00:40:08 2012 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c Wed Jan 25 00:41:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tmpfs_vnops.c,v 1.92.2.1 2012/01/04 16:43:37 yamt Exp $ */
+/* $NetBSD: tmpfs_vnops.c,v 1.92.2.2 2012/01/25 00:41:37 yamt Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.92.2.1 2012/01/04 16:43:37 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.92.2.2 2012/01/25 00:41:37 yamt Exp $");
#include <sys/param.h>
#include <sys/dirent.h>
@@ -545,6 +545,7 @@
const int ioflag = ap->a_ioflag;
tmpfs_node_t *node;
struct uvm_object *uobj;
+ const int advice = IO_ADV_DECODE(ioflag);
int error;
KASSERT(VOP_ISLOCKED(vp));
@@ -562,7 +563,7 @@
error = 0;
if (uio->uio_offset + uio->uio_resid <= node->tn_size) {
- uvm_loanobj(&vp->v_uobj, uio);
+ uvm_loanobj(&vp->v_uobj, uio, advice);
}
while (error == 0 && uio->uio_resid > 0) {
vsize_t len;
@@ -574,7 +575,7 @@
if (len == 0) {
break;
}
- error = ubc_uiomove(uobj, uio, len, IO_ADV_DECODE(ioflag),
+ error = ubc_uiomove(uobj, uio, len, advice,
UBC_READ | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp));
}
return error;
diff -r 8f167bf0cb92 -r 2eff7fa2c546 sys/nfs/nfs_bio.c
--- a/sys/nfs/nfs_bio.c Wed Jan 25 00:40:08 2012 +0000
+++ b/sys/nfs/nfs_bio.c Wed Jan 25 00:41:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_bio.c,v 1.188.2.2 2012/01/04 16:43:37 yamt Exp $ */
+/* $NetBSD: nfs_bio.c,v 1.188.2.3 2012/01/25 00:41:36 yamt Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.188.2.2 2012/01/04 16:43:37 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.188.2.3 2012/01/25 00:41:36 yamt Exp $");
#ifdef _KERNEL_OPT
#include "opt_nfs.h"
@@ -90,7 +90,6 @@
int enough = 0;
struct dirent *dp, *pdp, *edp, *ep;
off_t curoff = 0;
- int advice;
struct lwp *l = curlwp;
#ifdef DIAGNOSTIC
@@ -135,6 +134,8 @@
}
do {
+ int advice;
+
/*
* Don't cache symlinks.
*/
@@ -148,7 +149,7 @@
advice = IO_ADV_DECODE(ioflag);
if (uio->uio_offset + uio->uio_resid <= np->n_size) {
- uvm_loanobj(&vp->v_uobj, uio);
+ uvm_loanobj(&vp->v_uobj, uio, advice);
}
while (uio->uio_resid > 0) {
vsize_t bytelen;
diff -r 8f167bf0cb92 -r 2eff7fa2c546 sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c Wed Jan 25 00:40:08 2012 +0000
+++ b/sys/rump/librump/rumpkern/vm.c Wed Jan 25 00:41:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm.c,v 1.120.2.3 2012/01/14 04:36:39 yamt Exp $ */
+/* $NetBSD: vm.c,v 1.120.2.4 2012/01/25 00:42:35 yamt Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.120.2.3 2012/01/14 04:36:39 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.120.2.4 2012/01/25 00:42:35 yamt Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -628,7 +628,7 @@
}
int
-uvm_loanobj(struct uvm_object *uobj, struct uio *uio)
+uvm_loanobj(struct uvm_object *uobj, struct uio *uio, int advice)
{
return ENOTSUP;
diff -r 8f167bf0cb92 -r 2eff7fa2c546 sys/ufs/ufs/ufs_readwrite.c
--- a/sys/ufs/ufs/ufs_readwrite.c Wed Jan 25 00:40:08 2012 +0000
+++ b/sys/ufs/ufs/ufs_readwrite.c Wed Jan 25 00:41:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_readwrite.c,v 1.99.2.1 2012/01/04 16:43:37 yamt Exp $ */
+/* $NetBSD: ufs_readwrite.c,v 1.99.2.2 2012/01/25 00:41:36 yamt Exp $ */
/*-
* Copyright (c) 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.99.2.1 2012/01/04 16:43:37 yamt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.99.2.2 2012/01/25 00:41:36 yamt Exp $");
#ifdef LFS_READWRITE
#define FS struct lfs
@@ -124,7 +124,7 @@
const int advice = IO_ADV_DECODE(ap->a_ioflag);
if (uio->uio_offset + uio->uio_resid <= vp->v_size) {
- uvm_loanobj(&vp->v_uobj, uio);
+ uvm_loanobj(&vp->v_uobj, uio, advice);
}
while (uio->uio_resid > 0) {
if (ioflag & IO_DIRECT) {
diff -r 8f167bf0cb92 -r 2eff7fa2c546 sys/uvm/uvm_loan.c
--- a/sys/uvm/uvm_loan.c Wed Jan 25 00:40:08 2012 +0000
+++ b/sys/uvm/uvm_loan.c Wed Jan 25 00:41:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_loan.c,v 1.81.2.12 2012/01/18 02:09:06 yamt Exp $ */
+/* $NetBSD: uvm_loan.c,v 1.81.2.13 2012/01/25 00:41:36 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.12 2012/01/18 02:09:06 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.13 2012/01/25 00:41:36 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -110,7 +110,7 @@
static void uvm_unloanpage(struct vm_page **, int);
static int uvm_loanpage(struct vm_page **, int);
static int uvm_loanobj_read(struct vm_map *, vaddr_t, size_t,
- struct uvm_object *, off_t);
+ struct uvm_object *, off_t, int);
/*
@@ -1296,7 +1296,7 @@
}
int
-uvm_loanobj(struct uvm_object *uobj, struct uio *uio)
+uvm_loanobj(struct uvm_object *uobj, struct uio *uio, int advice)
{
struct iovec *iov;
struct vm_map *map;
@@ -1347,7 +1347,7 @@
va = (vaddr_t)iov->iov_base;
len = MIN(iov->iov_len, MAXPHYS);
error = uvm_loanobj_read(map, va, len, uobj,
- uio->uio_offset);
+ uio->uio_offset, advice);
if (error) {
goto out;
}
@@ -1374,7 +1374,7 @@
static int
uvm_loanobj_read(struct vm_map *map, vaddr_t va, size_t len,
- struct uvm_object *uobj, off_t off)
+ struct uvm_object *uobj, off_t off, int advice)
{
unsigned int npages = len >> PAGE_SHIFT;
struct vm_page *pgs[MAXPAGES];
@@ -1492,7 +1492,7 @@
memset(pgs, 0, sizeof(pgs));
mutex_enter(uobj->vmobjlock);
error = (*uobj->pgops->pgo_get)(uobj, off, pgs, &npages, 0,
- VM_PROT_READ, 0, PGO_SYNCIO);
+ VM_PROT_READ, advice, PGO_SYNCIO);
if (error) {
UVMHIST_LOG(ubchist, "getpages -> %d", error,0,0,0);
return error;
diff -r 8f167bf0cb92 -r 2eff7fa2c546 sys/uvm/uvm_loan.h
--- a/sys/uvm/uvm_loan.h Wed Jan 25 00:40:08 2012 +0000
+++ b/sys/uvm/uvm_loan.h Wed Jan 25 00:41:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_loan.h,v 1.17.4.1 2011/12/26 16:03:11 yamt Exp $ */
+/* $NetBSD: uvm_loan.h,v 1.17.4.2 2012/01/25 00:41:36 yamt Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -50,7 +50,7 @@
struct vm_page **);
struct vm_page *uvm_loanbreak(struct vm_page *);
int uvm_loanbreak_anon(struct vm_anon *);
-int uvm_loanobj(struct uvm_object *, struct uio *);
+int uvm_loanobj(struct uvm_object *, struct uio *, int);
void uvm_loan_resolve_orphan(struct vm_page *, bool);
#endif /* _KERNEL */
Home |
Main Index |
Thread Index |
Old Index