summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_kern.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1995-09-03 20:40:43 +0000
committerdyson <dyson@FreeBSD.org>1995-09-03 20:40:43 +0000
commit19cfe6b04c65e8642786c0ed37f1699b1461c945 (patch)
tree5f4ed8f7995c003619ed9cd8360e2533d535e372 /sys/vm/vm_kern.c
parent94c170a64751b11530d3a419d295d6fd6f38c938 (diff)
downloadFreeBSD-src-19cfe6b04c65e8642786c0ed37f1699b1461c945.zip
FreeBSD-src-19cfe6b04c65e8642786c0ed37f1699b1461c945.tar.gz
Machine independent changes to support pre-zeroed free pages. This
significantly improves demand-zero performance.
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r--sys/vm/vm_kern.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 1f21ec5..e4ab774 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_kern.c,v 1.14 1995/07/13 08:48:25 davidg Exp $
+ * $Id: vm_kern.c,v 1.15 1995/07/29 11:44:20 bde Exp $
*/
/*
@@ -178,11 +178,12 @@ kmem_alloc(map, size)
for (i = 0; i < size; i += PAGE_SIZE) {
vm_page_t mem;
- while ((mem = vm_page_alloc(kernel_object, offset + i, VM_ALLOC_NORMAL)) == NULL) {
+ while ((mem = vm_page_alloc(kernel_object, offset + i, (VM_ALLOC_NORMAL|VM_ALLOC_ZERO))) == NULL) {
VM_WAIT;
}
- vm_page_zero_fill(mem);
- mem->flags &= ~PG_BUSY;
+ if ((mem->flags & PG_ZERO) == 0)
+ vm_page_zero_fill(mem);
+ mem->flags &= ~(PG_BUSY|PG_ZERO);
mem->valid = VM_PAGE_BITS_ALL;
}
@@ -346,10 +347,7 @@ kmem_malloc(map, size, waitflag)
vm_map_unlock(map);
return (0);
}
-#if 0
- vm_page_zero_fill(m);
-#endif
- m->flags &= ~PG_BUSY;
+ m->flags &= ~(PG_BUSY|PG_ZERO);
m->valid = VM_PAGE_BITS_ALL;
}
OpenPOWER on IntegriCloud