summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_fault.c15
-rw-r--r--sys/vm/vm_map.c7
-rw-r--r--sys/vm/vm_map.h7
-rw-r--r--sys/vm/vm_pager.c33
4 files changed, 37 insertions, 25 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 1119c62..f395d97 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -66,7 +66,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_fault.c,v 1.56 1996/07/30 03:08:07 dyson Exp $
+ * $Id: vm_fault.c,v 1.57 1996/09/08 20:44:37 dyson Exp $
*/
/*
@@ -81,6 +81,7 @@
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/vmmeter.h>
+#include <sys/buf.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -103,10 +104,6 @@ int vm_fault_additional_pages __P((vm_page_t, int, int, vm_page_t *, int *));
#define VM_FAULT_READ_BEHIND 3
#define VM_FAULT_READ (VM_FAULT_READ_AHEAD+VM_FAULT_READ_BEHIND+1)
-int vm_fault_free_1;
-int vm_fault_copy_save_1;
-int vm_fault_copy_save_2;
-
/*
* vm_fault:
*
@@ -200,6 +197,11 @@ RetryFault:;
return (result);
}
+ if (entry->nofault) {
+ panic("vm_fault: fault on nofault entry, addr: %lx",
+ vaddr);
+ }
+
vp = vnode_pager_lock(first_object);
lookup_still_valid = TRUE;
@@ -565,7 +567,6 @@ readrest:
first_m = m;
m->dirty = VM_PAGE_BITS_ALL;
m = NULL;
- ++vm_fault_copy_save_1;
} else {
/*
* Oh, well, lets copy it.
@@ -639,7 +640,6 @@ readrest:
PAGE_WAKEUP(m);
vm_page_free(m);
m = NULL;
- ++vm_fault_free_1;
tm->dirty = VM_PAGE_BITS_ALL;
first_m->dirty = VM_PAGE_BITS_ALL;
}
@@ -651,7 +651,6 @@ readrest:
vm_page_rename(m, other_object, other_pindex);
m->dirty = VM_PAGE_BITS_ALL;
m->valid = VM_PAGE_BITS_ALL;
- ++vm_fault_copy_save_2;
}
}
}
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 5a04287..48071a0 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.c,v 1.56 1996/09/08 23:49:47 dyson Exp $
+ * $Id: vm_map.c,v 1.57 1996/09/14 11:54:55 bde Exp $
*/
/*
@@ -689,6 +689,11 @@ vm_map_insert(map, object, offset, start, end, prot, max, cow)
else
new_entry->copy_on_write = FALSE;
+ if (cow & MAP_NOFAULT)
+ new_entry->nofault = TRUE;
+ else
+ new_entry->nofault = FALSE;
+
if (map->is_main_map) {
new_entry->inheritance = VM_INHERIT_DEFAULT;
new_entry->protection = prot;
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index fd04d87..40569ef 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.h,v 1.14 1996/07/27 03:23:59 dyson Exp $
+ * $Id: vm_map.h,v 1.15 1996/07/30 03:08:11 dyson Exp $
*/
/*
@@ -106,9 +106,9 @@ struct vm_map_entry {
vm_ooffset_t offset; /* offset into object */
boolean_t is_a_map:1, /* Is "object" a map? */
is_sub_map:1, /* Is "object" a submap? */
- /* Only in sharing maps: */
copy_on_write:1, /* is data copy-on-write */
- needs_copy:1; /* does object need to be copied */
+ needs_copy:1, /* does object need to be copied */
+ nofault:1; /* should never fault */
/* Only in task maps: */
vm_prot_t protection; /* protection code */
vm_prot_t max_protection; /* maximum protection */
@@ -208,6 +208,7 @@ typedef struct {
*/
#define MAP_COPY_NEEDED 0x1
#define MAP_COPY_ON_WRITE 0x2
+#define MAP_NOFAULT 0x4
#ifdef KERNEL
extern vm_offset_t kentry_data;
diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c
index b8db9ac..de81090 100644
--- a/sys/vm/vm_pager.c
+++ b/sys/vm/vm_pager.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pager.c,v 1.23 1996/05/18 03:38:05 dyson Exp $
+ * $Id: vm_pager.c,v 1.24 1996/09/08 20:44:49 dyson Exp $
*/
/*
@@ -278,6 +278,22 @@ pager_cache(object, should_cache)
}
/*
+ * initialize a physical buffer
+ */
+
+static void
+initpbuf(struct buf *bp) {
+ bzero(bp, sizeof *bp);
+ bp->b_rcred = NOCRED;
+ bp->b_wcred = NOCRED;
+ bp->b_qindex = QUEUE_NONE;
+ bp->b_data = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva;
+ bp->b_kvabase = bp->b_data;
+ bp->b_kvasize = MAXPHYS;
+ bp->b_vnbufs.le_next = NOLIST;
+}
+
+/*
* allocate a physical buffer
*/
struct buf *
@@ -295,12 +311,7 @@ getpbuf()
TAILQ_REMOVE(&bswlist, bp, b_freelist);
splx(s);
- bzero(bp, sizeof *bp);
- bp->b_rcred = NOCRED;
- bp->b_wcred = NOCRED;
- bp->b_qindex = QUEUE_NONE;
- bp->b_data = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva;
- bp->b_vnbufs.le_next = NOLIST;
+ initpbuf(bp);
return bp;
}
@@ -321,12 +332,8 @@ trypbuf()
TAILQ_REMOVE(&bswlist, bp, b_freelist);
splx(s);
- bzero(bp, sizeof *bp);
- bp->b_rcred = NOCRED;
- bp->b_wcred = NOCRED;
- bp->b_qindex = QUEUE_NONE;
- bp->b_data = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva;
- bp->b_vnbufs.le_next = NOLIST;
+ initpbuf(bp);
+
return bp;
}
OpenPOWER on IntegriCloud