summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_kern.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-01-19 04:00:31 +0000
committerdyson <dyson@FreeBSD.org>1996-01-19 04:00:31 +0000
commit8fc8a772af22f6e03233d248fa2dbd9b5c2bdd7d (patch)
tree3c31fd95ea745005a9cd6733db5a16f31bd828a6 /sys/vm/vm_kern.c
parent6755beedbf0ddaa9e66e91c8e74f620ede6bfad5 (diff)
downloadFreeBSD-src-8fc8a772af22f6e03233d248fa2dbd9b5c2bdd7d.zip
FreeBSD-src-8fc8a772af22f6e03233d248fa2dbd9b5c2bdd7d.tar.gz
Eliminated many redundant vm_map_lookup operations for vm_mmap.
Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers.
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r--sys/vm/vm_kern.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 6b3b006..9569a39 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.19 1995/12/10 14:52:09 bde Exp $
+ * $Id: vm_kern.c,v 1.20 1995/12/11 04:58:09 dyson Exp $
*/
/*
@@ -118,7 +118,7 @@ kmem_alloc_pageable(map, size)
size = round_page(size);
addr = vm_map_min(map);
result = vm_map_find(map, NULL, (vm_offset_t) 0,
- &addr, size, TRUE);
+ &addr, size, TRUE, VM_PROT_ALL, VM_PROT_ALL, 0);
if (result != KERN_SUCCESS) {
return (0);
}
@@ -157,7 +157,8 @@ kmem_alloc(map, size)
}
offset = addr - VM_MIN_KERNEL_ADDRESS;
vm_object_reference(kernel_object);
- vm_map_insert(map, kernel_object, offset, addr, addr + size);
+ vm_map_insert(map, kernel_object, offset, addr, addr + size,
+ VM_PROT_ALL, VM_PROT_ALL, 0);
vm_map_unlock(map);
/*
@@ -182,8 +183,7 @@ kmem_alloc(map, size)
vm_page_t mem;
while ((mem = vm_page_alloc(kernel_object,
- OFF_TO_IDX(offset + i),
- (VM_ALLOC_NORMAL|VM_ALLOC_ZERO))) == NULL) {
+ OFF_TO_IDX(offset + i), VM_ALLOC_ZERO)) == NULL) {
VM_WAIT;
}
if ((mem->flags & PG_ZERO) == 0)
@@ -249,7 +249,7 @@ kmem_suballoc(parent, min, max, size, pageable)
*min = (vm_offset_t) vm_map_min(parent);
ret = vm_map_find(parent, NULL, (vm_offset_t) 0,
- min, size, TRUE);
+ min, size, TRUE, VM_PROT_ALL, VM_PROT_ALL, 0);
if (ret != KERN_SUCCESS) {
printf("kmem_suballoc: bad status return of %d.\n", ret);
panic("kmem_suballoc");
@@ -316,7 +316,8 @@ kmem_malloc(map, size, waitflag)
}
offset = addr - vm_map_min(kmem_map);
vm_object_reference(kmem_object);
- vm_map_insert(map, kmem_object, offset, addr, addr + size);
+ 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
@@ -376,6 +377,7 @@ 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));
}
vm_map_unlock(map);
@@ -416,7 +418,7 @@ kmem_alloc_wait(map, size)
vm_map_unlock(map);
tsleep(map, PVM, "kmaw", 0);
}
- vm_map_insert(map, NULL, (vm_offset_t) 0, addr, addr + size);
+ vm_map_insert(map, NULL, (vm_offset_t) 0, addr, addr + size, VM_PROT_ALL, VM_PROT_ALL, 0);
vm_map_unlock(map);
return (addr);
}
@@ -456,7 +458,7 @@ kmem_init(start, end)
/* N.B.: cannot use kgdb to debug, starting with this assignment ... */
kernel_map = m;
(void) vm_map_insert(m, NULL, (vm_offset_t) 0,
- VM_MIN_KERNEL_ADDRESS, start);
+ VM_MIN_KERNEL_ADDRESS, start, VM_PROT_ALL, VM_PROT_ALL, 0);
/* ... and ending with the completion of the above `insert' */
vm_map_unlock(m);
}
OpenPOWER on IntegriCloud