From a8a9e61c3dc91770e376b891267f88e365cb1e7a Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Thu, 27 Aug 2020 15:57:58 +0200 Subject: [PATCH] vmm: memory_manager: Allow host NUMA for RAM backed files Let's narrow down the limitation related to mbind() by allowing shared mappings backed by a file backed by RAM. This leaves the restriction on only for mappings backed by a regular file. With this patch, host NUMA node can be specified even if using vhost-user devices. Signed-off-by: Sebastien Boeuf --- vmm/src/memory_manager.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vmm/src/memory_manager.rs b/vmm/src/memory_manager.rs index a536f05da..001aa16cd 100644 --- a/vmm/src/memory_manager.rs +++ b/vmm/src/memory_manager.rs @@ -402,10 +402,10 @@ impl MemoryManager { for zone in zones.iter() { total_ram_size += zone.size; - if zone.shared && zone.host_numa_node.is_some() { + if zone.shared && zone.file.is_some() && zone.host_numa_node.is_some() { error!( "Invalid to set host NUMA policy for a memory zone \ - mapped as 'shared'" + backed by a regular file and mapped as 'shared'" ); return Err(Error::InvalidSharedMemoryZoneWithHostNuma); }