diff options
author | dyson <dyson@FreeBSD.org> | 1998-05-02 06:36:16 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1998-05-02 06:36:16 +0000 |
commit | d1eb14c5f66e207535661f4c20a89ed6e8fbc648 (patch) | |
tree | ae915590fbe33ded8698a2175a94d8929e963beb /sys/vm/vm_map.c | |
parent | 0bb53ecc6b183cdb39f2bc473181380fa1708970 (diff) | |
download | FreeBSD-src-d1eb14c5f66e207535661f4c20a89ed6e8fbc648.zip FreeBSD-src-d1eb14c5f66e207535661f4c20a89ed6e8fbc648.tar.gz |
Another minor cleanup of the split code. Make sure that pages are
busied during the entire time, so that the waits for pages being
unbusy don't make the objects inconsistant.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r-- | sys/vm/vm_map.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index f908e15..8eef298 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.121 1998/04/29 06:59:08 dyson Exp $ + * $Id: vm_map.c,v 1.122 1998/05/01 02:25:29 dyson Exp $ */ /* @@ -1924,10 +1924,16 @@ vm_map_check_protection(vm_map_t map, vm_offset_t start, vm_offset_t end, return (TRUE); } +/* + * Split the pages in a map entry into a new object. This affords + * easier removal of unused pages, and keeps object inheritance from + * being a negative impact on memory usage. + */ static void vm_map_split(entry) vm_map_entry_t entry; { + vm_page_t m; vm_object_t orig_object, new_object; vm_offset_t s, e; vm_pindex_t offidxstart, offidxend, idx; @@ -1970,7 +1976,7 @@ vm_map_split(entry) vm_page_protect(m, VM_PROT_NONE); vm_page_rename(m, new_object, idx); m->dirty = VM_PAGE_BITS_ALL; - PAGE_WAKEUP(m); + m->flags |= PG_BUSY; } if (orig_object->type == OBJT_SWAP) { @@ -1986,6 +1992,13 @@ vm_map_split(entry) vm_object_pip_wakeup(orig_object); } + for (idx = 0; idx < size; idx++) { + m = vm_page_lookup(new_object, idx); + if (m) { + PAGE_WAKEUP(m); + } + } + entry->object.vm_object = new_object; entry->offset = 0LL; vm_object_deallocate(orig_object); |