diff options
author | jhb <jhb@FreeBSD.org> | 2012-06-20 18:00:26 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-06-20 18:00:26 +0000 |
commit | 12f0fa63b40da9c91d4058d4a031666755896565 (patch) | |
tree | cbfad5dda0c14cc2e19151c27d038b9cdd4e81c8 /sys/vm/vm_map.c | |
parent | 17a6764a6971afd7368676d00b66708be1b6c355 (diff) | |
download | FreeBSD-src-12f0fa63b40da9c91d4058d4a031666755896565.zip FreeBSD-src-12f0fa63b40da9c91d4058d4a031666755896565.tar.gz |
Move the per-thread deferred user map entries list into a private list
in vm_map_process_deferred() which is then iterated to release map entries.
This avoids having a nested vm map unlock operation called from the loop
body attempt to recuse into vm_map_process_deferred(). This can happen if
the vm_map_remove() triggers the OOM killer.
Reviewed by: alc, kib
MFC after: 1 week
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r-- | sys/vm/vm_map.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index f95fd82..5cb1fef 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -475,12 +475,14 @@ static void vm_map_process_deferred(void) { struct thread *td; - vm_map_entry_t entry; + vm_map_entry_t entry, next; vm_object_t object; td = curthread; - while ((entry = td->td_map_def_user) != NULL) { - td->td_map_def_user = entry->next; + entry = td->td_map_def_user; + td->td_map_def_user = NULL; + while (entry != NULL) { + next = entry->next; if ((entry->eflags & MAP_ENTRY_VN_WRITECNT) != 0) { /* * Decrement the object's writemappings and @@ -494,6 +496,7 @@ vm_map_process_deferred(void) entry->end); } vm_map_entry_deallocate(entry, FALSE); + entry = next; } } |