summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-06-11 05:24:22 +0000
committeralc <alc@FreeBSD.org>2002-06-11 05:24:22 +0000
commitd9429c7e6e4d34babd5e11422bdfd4f9c41d7e48 (patch)
tree38fbd4ddf97484023ae3363ce8b68708ddf1035d /sys
parent439384bfd7cd256a0ec412acc08f7a84594d8ce2 (diff)
downloadFreeBSD-src-d9429c7e6e4d34babd5e11422bdfd4f9c41d7e48.zip
FreeBSD-src-d9429c7e6e4d34babd5e11422bdfd4f9c41d7e48.tar.gz
o Teach vm_map_delete() to respect the "in-transition" flag
on a vm_map_entry by sleeping until the flag is cleared. Submitted by: tegge
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_map.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index e4bf993..f762698 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2374,6 +2374,37 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end)
vm_offset_t s, e;
vm_pindex_t offidxstart, offidxend, count;
+ /*
+ * Wait for wiring or unwiring of an entry to complete.
+ */
+ if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) {
+ unsigned int last_timestamp;
+ vm_offset_t saved_start;
+ vm_map_entry_t tmp_entry;
+
+ saved_start = entry->start;
+ entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP;
+ last_timestamp = map->timestamp;
+ (void) vm_map_unlock_and_wait(map, FALSE);
+ vm_map_lock(map);
+ if (last_timestamp + 1 != map->timestamp) {
+ /*
+ * Look again for the entry because the map was
+ * modified while it was unlocked.
+ * Specifically, the entry may have been
+ * clipped, merged, or deleted.
+ */
+ if (!vm_map_lookup_entry(map, saved_start,
+ &tmp_entry))
+ entry = tmp_entry->next;
+ else {
+ entry = tmp_entry;
+ vm_map_clip_start(map, entry,
+ saved_start);
+ }
+ }
+ continue;
+ }
vm_map_clip_end(map, entry, end);
s = entry->start;
OpenPOWER on IntegriCloud