mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
- Avoid a lock-order reversal between Giant and a system map mutex that
occurs when kmem_malloc() fails to allocate a sufficient number of vm pages. Specifically, we avoid the lock-order reversal by not grabbing Giant around pmap_remove() if the map is the kmem_map. Approved by: re (jhb) Reported by: Eugene <eugene3@web.de>
This commit is contained in:
parent
b8aeddf146
commit
1cd5fbd854
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=122902
@ -2173,11 +2173,13 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end)
|
||||
vm_map_entry_unwire(map, entry);
|
||||
}
|
||||
|
||||
mtx_lock(&Giant);
|
||||
if (map != kmem_map)
|
||||
mtx_lock(&Giant);
|
||||
vm_page_lock_queues();
|
||||
pmap_remove(map->pmap, entry->start, entry->end);
|
||||
vm_page_unlock_queues();
|
||||
mtx_unlock(&Giant);
|
||||
if (map != kmem_map)
|
||||
mtx_unlock(&Giant);
|
||||
|
||||
/*
|
||||
* Delete the entry (which may delete the object) only after
|
||||
|
Loading…
Reference in New Issue
Block a user