mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
pci: vfio: Release memory slots upon unmap
This prevents starvation of the limited set of memory slots in the kernel. Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
parent
81f8a27ef6
commit
0d6cef4521
@ -1699,6 +1699,9 @@ impl VfioPciDevice {
|
||||
error!("Could not remove the userspace memory region: {}", e);
|
||||
}
|
||||
|
||||
self.memory_slot_allocator
|
||||
.free_memory_slot(user_memory_region.slot);
|
||||
|
||||
// SAFETY: FFI call with correct arguments
|
||||
let ret = unsafe {
|
||||
libc::munmap(
|
||||
|
@ -222,6 +222,9 @@ impl VfioUserPciDevice {
|
||||
error!("Could not remove the userspace memory region: {}", e);
|
||||
}
|
||||
|
||||
self.memory_slot_allocator
|
||||
.free_memory_slot(user_memory_region.slot);
|
||||
|
||||
// Remove mmaps
|
||||
// SAFETY: FFI call with correct arguments
|
||||
let ret = unsafe {
|
||||
|
Loading…
Reference in New Issue
Block a user