1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #4089: Add NUMA policies (#4589)

This commit is contained in:
Christian González 2020-04-24 10:20:00 +02:00 committed by GitHub
parent f97f9037df
commit b3795a470f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View File

@ -58,3 +58,12 @@
#
# Timeout to wait a cgroup to be empty after shutdown/cancel a microVM
:cgroup_delete_timeout: 60
################################################################################
# NUMA placement Options
################################################################################
#
# Policy to schedule microVMs accross NUMA nodes. Available options:
# - "rr": schedule the microVMs in a RR way across NUMA nodes based on the VM id.
# - "random": schedule the microVMs randomly across NUMA nodes.
:numa_policy: 'random'

View File

@ -32,7 +32,8 @@ class FirecrackerConfiguration < Hash
:gid => 9869,
:shutdown_timeout => 10,
:cgroup_location => '/sys/fs/cgroup',
:cgroup_delete_timeout => 10
:cgroup_delete_timeout => 10,
:numa_policy => 'random'
}
FIRECRACKERRC = '../../etc/vmm/firecracker/firecrackerrc'
@ -258,9 +259,23 @@ class OpenNebulaVM
nodes = nodes.split("\n")
case @fcrc[:numa_policy].downcase
when 'rr'
rr_policy(nodes)
when 'random'
random_policy(nodes)
else
random_policy(nodes)
end
end
def rr_policy(nodes)
Integer(nodes[@vm_id % nodes.size].gsub('node', ''))
end
def random_policy(nodes)
Integer(nodes.sample.gsub('node', ''))
end
#---------------------------------------------------------------------------
# Container Mapping: Extra Configuration & Profiles
#---------------------------------------------------------------------------