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 <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-08-27 15:57:58 +02:00 committed by Bo Chen
parent 1b4591aecc
commit a8a9e61c3d

View File

@ -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);
}