diff options
author | dyson <dyson@FreeBSD.org> | 1996-12-28 22:40:44 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-12-28 22:40:44 +0000 |
commit | 527a08777f4a2f02d65ccc013b7ca9c0b496c57d (patch) | |
tree | 75c6845ccba238501fbe3c2bbde0c4ad7919f839 /sys | |
parent | 4a6f6b4da48614f0b5ee04da957a8cf51bda998e (diff) | |
download | FreeBSD-src-527a08777f4a2f02d65ccc013b7ca9c0b496c57d.zip FreeBSD-src-527a08777f4a2f02d65ccc013b7ca9c0b496c57d.tar.gz |
The code unnecessarily created an object with no handle up-front, which
has the negative effect of disabling some map optimizations. This
patch defers the creation of the object until it needs to be at fault time.
Submitted by: Alan Cox <alc@cs.rice.edu>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_mmap.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index d1730ba..3d89951 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$ * * @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94 - * $Id: vm_mmap.c,v 1.54 1996/12/14 17:54:17 dyson Exp $ + * $Id: vm_mmap.c,v 1.55 1996/12/22 23:17:09 joerg Exp $ */ /* @@ -905,9 +905,14 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff) type = OBJT_VNODE; } } - object = vm_pager_allocate(type, handle, OFF_TO_IDX(objsize), prot, foff); - if (object == NULL) - return (type == OBJT_DEVICE ? EINVAL : ENOMEM); + + if (handle == NULL) { + object = NULL; + } else { + object = vm_pager_allocate(type, handle, OFF_TO_IDX(objsize), prot, foff); + if (object == NULL) + return (type == OBJT_DEVICE ? EINVAL : ENOMEM); + } /* * Force device mappings to be shared. @@ -939,7 +944,7 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff) /* * "Pre-fault" resident pages. */ - if ((type == OBJT_VNODE) && (map->pmap != NULL)) { + if ((type == OBJT_VNODE) && (map->pmap != NULL) && (object != NULL)) { pmap_object_init_pt(map->pmap, *addr, object, (vm_pindex_t) OFF_TO_IDX(foff), size, 1); } |