Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys/uvm Rename PG_DIRECT to PG_XIP. PG_XIP is marked...
details: https://anonhg.NetBSD.org/src/rev/22b8aecba269
branches: uebayasi-xip
changeset: 751744:22b8aecba269
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Thu Jul 15 08:33:46 2010 +0000
description:
Rename PG_DIRECT to PG_XIP. PG_XIP is marked to XIP vnode pages.
diffstat:
sys/uvm/uvm_bio.c | 18 +++++++-----------
sys/uvm/uvm_fault.c | 19 ++++++++-----------
sys/uvm/uvm_page.c | 14 +++-----------
sys/uvm/uvm_page.h | 5 ++---
4 files changed, 20 insertions(+), 36 deletions(-)
diffs (160 lines):
diff -r dce6895b3e47 -r 22b8aecba269 sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Wed Jul 14 06:33:31 2010 +0000
+++ b/sys/uvm/uvm_bio.c Thu Jul 15 08:33:46 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_bio.c,v 1.68.2.8 2010/07/13 01:47:23 uebayasi Exp $ */
+/* $NetBSD: uvm_bio.c,v 1.68.2.9 2010/07/15 08:33:46 uebayasi Exp $ */
/*
* Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.8 2010/07/13 01:47:23 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.68.2.9 2010/07/15 08:33:46 uebayasi Exp $");
#include "opt_uvmhist.h"
#include "opt_ubc.h"
@@ -387,15 +387,11 @@
mask = rdonly ? ~VM_PROT_WRITE : VM_PROT_ALL;
error = pmap_enter(ufi->orig_map->pmap, va, VM_PAGE_TO_PHYS(pg),
prot & mask, PMAP_CANFAIL | (access_type & mask));
-
- if (uvm_pageisdirect_p(pg))
- goto ubc_fault_done;
-
- mutex_enter(&uvm_pageqlock);
- uvm_pageactivate(pg);
- mutex_exit(&uvm_pageqlock);
-
-ubc_fault_done:
+ if (__predict_true((pg->flags & PG_XIP) == 0)) {
+ mutex_enter(&uvm_pageqlock);
+ uvm_pageactivate(pg);
+ mutex_exit(&uvm_pageqlock);
+ }
pg->flags &= ~(PG_BUSY|PG_WANTED);
UVM_PAGE_OWN(pg, NULL);
mutex_exit(&uobj->vmobjlock);
diff -r dce6895b3e47 -r 22b8aecba269 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c Wed Jul 14 06:33:31 2010 +0000
+++ b/sys/uvm/uvm_fault.c Thu Jul 15 08:33:46 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.166.2.18 2010/07/14 06:33:31 uebayasi Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.166.2.19 2010/07/15 08:33:46 uebayasi Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.18 2010/07/14 06:33:31 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.19 2010/07/15 08:33:46 uebayasi Exp $");
#include "opt_uvmhist.h"
#include "opt_xip.h"
@@ -1754,20 +1754,17 @@
/* locked: maps(read), amap(if there), uobj */
- if (uvm_pageisdirect_p(pg))
- goto uvm_fault_lower_neighbor_enter;
-
/*
* calling pgo_get with PGO_LOCKED returns us pages which
* are neither busy nor released, so we don't need to check
* for this. we can just directly enter the pages.
*/
- mutex_enter(&uvm_pageqlock);
- uvm_pageenqueue(pg);
- mutex_exit(&uvm_pageqlock);
-
-uvm_fault_lower_neighbor_enter:
+ if (__predict_true((pg->flags & PG_XIP) == 0)) {
+ mutex_enter(&uvm_pageqlock);
+ uvm_pageenqueue(pg);
+ mutex_exit(&uvm_pageqlock);
+ }
UVMHIST_LOG(maphist,
" MAPPING: n obj: pm=0x%x, va=0x%x, pg=0x%x",
ufi->orig_map->pmap, currva, pg, 0);
@@ -2195,7 +2192,7 @@
return ERESTART;
}
- if (!uvm_pageisdirect_p(pg))
+ if (__predict_true((pg->flags & PG_XIP) == 0))
uvm_fault_lower_done(ufi, flt, uobj, anon, pg);
pg->flags &= ~(PG_BUSY|PG_FAKE|PG_WANTED);
diff -r dce6895b3e47 -r 22b8aecba269 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c Wed Jul 14 06:33:31 2010 +0000
+++ b/sys/uvm/uvm_page.c Thu Jul 15 08:33:46 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.c,v 1.153.2.44 2010/07/12 06:25:14 uebayasi Exp $ */
+/* $NetBSD: uvm_page.c,v 1.153.2.45 2010/07/15 08:33:46 uebayasi Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.44 2010/07/12 06:25:14 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.45 2010/07/15 08:33:46 uebayasi Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -870,7 +870,7 @@
paddr_t paddr = (start + i) << PAGE_SHIFT;
pg->phys_addr = paddr;
- pg->flags |= PG_FAKE | PG_RDONLY | PG_DIRECT | PG_CLEAN;
+ pg->flags |= PG_FAKE | PG_RDONLY | PG_XIP | PG_CLEAN;
#ifdef __HAVE_VM_PAGE_MD
VM_MDPAGE_INIT(&pg->mdpage, paddr);
#endif
@@ -1173,14 +1173,6 @@
}
}
-bool
-uvm_pageisdirect_p(const struct vm_page *pg)
-{
-
- KASSERT(pg != NULL);
- return (pg->flags & PG_DIRECT) != 0;
-}
-
/*
* PHYS_TO_VM_PAGE: find vm_page for a PA. used by MI code to get vm_pages
diff -r dce6895b3e47 -r 22b8aecba269 sys/uvm/uvm_page.h
--- a/sys/uvm/uvm_page.h Wed Jul 14 06:33:31 2010 +0000
+++ b/sys/uvm/uvm_page.h Thu Jul 15 08:33:46 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.h,v 1.59.2.25 2010/07/08 07:47:37 uebayasi Exp $ */
+/* $NetBSD: uvm_page.h,v 1.59.2.26 2010/07/15 08:33:46 uebayasi Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -180,7 +180,7 @@
#define PG_FAKE 0x0040 /* page is not yet initialized */
#define PG_RDONLY 0x0080 /* page must be mapped read-only */
#define PG_ZERO 0x0100 /* page is pre-zero'd */
-#define PG_DIRECT 0x0200 /* page is direct vnode data */
+#define PG_XIP 0x0200 /* page is XIP vnode data */
#define PG_PAGER1 0x1000 /* pager-specific flag */
@@ -304,7 +304,6 @@
void uvm_pagewire(struct vm_page *);
void uvm_pagezero(struct vm_page *);
bool uvm_pageismanaged(paddr_t);
-bool uvm_pageisdirect_p(const struct vm_page *);
int uvm_page_lookup_freelist(struct vm_page *);
Home |
Main Index |
Thread Index |
Old Index