summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_kern.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-05-18 03:38:05 +0000
committerdyson <dyson@FreeBSD.org>1996-05-18 03:38:05 +0000
commit242e10df110e682d1d2f90d9734a4fd3436f24c1 (patch)
treefd8af1ab66bdbd2395179d258c5c00c4a695208d /sys/vm/vm_kern.c
parent3c6405efe575ceb7213f2bf914099da9523800cd (diff)
downloadFreeBSD-src-242e10df110e682d1d2f90d9734a4fd3436f24c1.zip
FreeBSD-src-242e10df110e682d1d2f90d9734a4fd3436f24c1.tar.gz
This set of commits to the VM system does the following, and contain
contributions or ideas from Stephen McKay <syssgm@devetir.qld.gov.au>, Alan Cox <alc@cs.rice.edu>, David Greenman <davidg@freebsd.org> and me: More usage of the TAILQ macros. Additional minor fix to queue.h. Performance enhancements to the pageout daemon. Addition of a wait in the case that the pageout daemon has to run immediately. Slightly modify the pageout algorithm. Significant revamp of the pmap/fork code: 1) PTE's and UPAGES's are NO LONGER in the process's map. 2) PTE's and UPAGES's reside in their own objects. 3) TOTAL elimination of recursive page table pagefaults. 4) The page directory now resides in the PTE object. 5) Implemented pmap_copy, thereby speeding up fork time. 6) Changed the pv entries so that the head is a pointer and not an entire entry. 7) Significant cleanup of pmap_protect, and pmap_remove. 8) Removed significant amounts of machine dependent fork code from vm_glue. Pushed much of that code into the machine dependent pmap module. 9) Support more completely the reuse of already zeroed pages (Page table pages and page directories) as being already zeroed. Performance and code cleanups in vm_map: 1) Improved and simplified allocation of map entries. 2) Improved vm_map_copy code. 3) Corrected some minor problems in the simplify code. Implemented splvm (combo of splbio and splimp.) The VM code now seldom uses splhigh. Improved the speed of and simplified kmem_malloc. Minor mod to vm_fault to avoid using pre-zeroed pages in the case of objects with backing objects along with the already existant condition of having a vnode. (If there is a backing object, there will likely be a COW... With a COW, it isn't necessary to start with a pre-zeroed page.) Minor reorg of source to perhaps improve locality of ref.
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r--sys/vm/vm_kern.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index a820f9d..fbad3f1 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.23 1996/04/24 04:16:44 dyson Exp $
+ * $Id: vm_kern.c,v 1.24 1996/05/10 19:28:54 wollman Exp $
*/
/*
@@ -100,6 +100,7 @@ vm_map_t io_map;
vm_map_t clean_map;
vm_map_t phys_map;
vm_map_t exec_map;
+vm_map_t exech_map;
vm_map_t u_map;
/*
@@ -327,22 +328,8 @@ kmem_malloc(map, size, waitflag)
vm_map_insert(map, kmem_object, offset, addr, addr + size,
VM_PROT_ALL, VM_PROT_ALL, 0);
- /*
- * If we can wait, just mark the range as wired (will fault pages as
- * necessary).
- */
- if (waitflag == M_WAITOK) {
- vm_map_unlock(map);
- (void) vm_map_pageable(map, (vm_offset_t) addr, addr + size,
- FALSE);
- vm_map_simplify(map, addr);
- return (addr);
- }
- /*
- * If we cannot wait then we must allocate all memory up front,
- * pulling it off the active queue to prevent pageout.
- */
for (i = 0; i < size; i += PAGE_SIZE) {
+retry:
m = vm_page_alloc(kmem_object, OFF_TO_IDX(offset + i),
(waitflag == M_NOWAIT) ? VM_ALLOC_INTERRUPT : VM_ALLOC_SYSTEM);
@@ -352,6 +339,10 @@ kmem_malloc(map, size, waitflag)
* aren't on any queues.
*/
if (m == NULL) {
+ if (waitflag == M_WAITOK) {
+ VM_WAIT;
+ goto retry;
+ }
while (i != 0) {
i -= PAGE_SIZE;
m = vm_page_lookup(kmem_object,
@@ -362,7 +353,7 @@ kmem_malloc(map, size, waitflag)
vm_map_unlock(map);
return (0);
}
- m->flags &= ~(PG_BUSY|PG_ZERO);
+ m->flags &= ~PG_ZERO;
m->valid = VM_PAGE_BITS_ALL;
}
@@ -386,7 +377,9 @@ kmem_malloc(map, size, waitflag)
for (i = 0; i < size; i += PAGE_SIZE) {
m = vm_page_lookup(kmem_object, OFF_TO_IDX(offset + i));
vm_page_wire(m);
- pmap_kenter(addr + i, VM_PAGE_TO_PHYS(m));
+ PAGE_WAKEUP(m);
+ pmap_enter(kernel_pmap, addr + i, VM_PAGE_TO_PHYS(m),
+ VM_PROT_ALL, 1);
}
vm_map_unlock(map);
OpenPOWER on IntegriCloud