Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys Make XIP genfs_getpages_xip() return pages in I/O...
details: https://anonhg.NetBSD.org/src/rev/2aad6c1cebc5
branches: uebayasi-xip
changeset: 751865:2aad6c1cebc5
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Fri Nov 19 01:44:47 2010 +0000
description:
Make XIP genfs_getpages_xip() return pages in I/O path, preparing
merge into the generic genfs_getpages().
diffstat:
sys/miscfs/genfs/genfs_io.c | 41 ++++++++++++++++++++++++++++++++++++-----
sys/uvm/uvm_fault.c | 12 +++++++-----
2 files changed, 43 insertions(+), 10 deletions(-)
diffs (116 lines):
diff -r 36e7ccd175a7 -r 2aad6c1cebc5 sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c Thu Nov 18 16:16:36 2010 +0000
+++ b/sys/miscfs/genfs/genfs_io.c Fri Nov 19 01:44:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_io.c,v 1.36.2.34 2010/11/18 16:16:36 uebayasi Exp $ */
+/* $NetBSD: genfs_io.c,v 1.36.2.35 2010/11/19 01:44:47 uebayasi Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.34 2010/11/18 16:16:36 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.35 2010/11/19 01:44:47 uebayasi Exp $");
#include "opt_xip.h"
@@ -64,6 +64,8 @@
static int genfs_do_getpages_xip(void *);
static int genfs_do_getpages_xip1(struct vnode *, voff_t, struct vm_page **,
int *, int, vm_prot_t, int, int);
+static int genfs_do_getpages_xip_io(struct vnode *, voff_t, struct vm_page **,
+ int *, int, vm_prot_t, int, int);
static int genfs_do_putpages_xip(struct vnode *, off_t, off_t, int,
struct vm_page **);
#endif
@@ -797,6 +799,8 @@
int a_flags;
} */ * const ap = v;
+ UVMHIST_FUNC("genfs_do_getpages_xip"); UVMHIST_CALLED(ubchist);
+
return genfs_do_getpages_xip1(
ap->a_vp,
ap->a_offset,
@@ -819,6 +823,35 @@
int advice,
int flags)
{
+
+ KASSERT((vp->v_vflag & VV_XIP) != 0);
+
+ if ((flags & PGO_LOCKED) != 0) {
+ *npagesp = 0;
+ return 0;
+ } else
+ return genfs_do_getpages_xip_io(
+ vp,
+ offset,
+ pps,
+ npagesp,
+ centeridx,
+ access_type,
+ advice,
+ flags);
+}
+
+static int
+genfs_do_getpages_xip_io(
+ struct vnode *vp,
+ voff_t offset,
+ struct vm_page **pps,
+ int *npagesp,
+ int centeridx,
+ vm_prot_t access_type,
+ int advice,
+ int flags)
+{
struct uvm_object * const uobj = &vp->v_uobj;
int error;
@@ -828,9 +861,7 @@
int i;
struct vm_page *zero_page;
- UVMHIST_FUNC("genfs_do_getpages_xip"); UVMHIST_CALLED(ubchist);
-
- KASSERT((vp->v_vflag & VV_XIP) != 0);
+ UVMHIST_FUNC("genfs_do_getpages_xip_io"); UVMHIST_CALLED(ubchist);
GOP_SIZE(vp, vp->v_size, &eof, GOP_SIZE_MEM);
npages = MIN(*npagesp, round_page(eof - offset) >> PAGE_SHIFT);
diff -r 36e7ccd175a7 -r 2aad6c1cebc5 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c Thu Nov 18 16:16:36 2010 +0000
+++ b/sys/uvm/uvm_fault.c Fri Nov 19 01:44:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.166.2.23 2010/11/04 08:47:38 uebayasi Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.166.2.24 2010/11/19 01:44:47 uebayasi Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.23 2010/11/04 08:47:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.24 2010/11/19 01:44:47 uebayasi Exp $");
#include "opt_uvmhist.h"
#include "opt_xip.h"
@@ -1867,9 +1867,11 @@
KASSERT((pg->flags & PG_BUSY) != 0);
- mutex_enter(&uvm_pageqlock);
- uvm_pageactivate(pg);
- mutex_exit(&uvm_pageqlock);
+ if ((pg->flags & PG_DEVICE) == 0) {
+ mutex_enter(&uvm_pageqlock);
+ uvm_pageactivate(pg);
+ mutex_exit(&uvm_pageqlock);
+ }
/*
* re-verify the state of the world by first trying to relock
Home |
Main Index |
Thread Index |
Old Index