vhost memory hotplug deadlock
Checks
Context |
Check |
Description |
ci/Intel-compilation |
fail
|
apply issues
|
Commit Message
The Vhost memory handling will self deadlock.
The sequence is:
rte_zmalloc
malloc_heap_alloc
heap_alloc_on_socket
alloc_more_mem_on_socket
try_expand_heap_primary
Acquires memory_hotplug_lock for write
eal_memalloc_mem_event_notify
vhost_user_mem_event_cb
vhost_kernel_ioctl
rte_memseg_contig_walk
Deadlocks acquiring memory_hotplug_lock for read
The following may fix it.
@@ -115,7 +115,8 @@ prepare_vhost_memory_kernel(void)
wa.region_nr = 0;
wa.vm = vm;
- if (rte_memseg_contig_walk(add_memory_region, &wa) < 0) {
+ /* memory_hotplug_lock already held */
+ if (rte_memseg_contig_walk_thread_unsafe(add_memory_region, &wa) < 0) {
free(vm);
return NULL;
}