mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Update NUMA node distances internally
Based on the NumaConfig which now provides distance information, we can internally update the list of NUMA nodes with the exact distances they should be located from other nodes. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -67,6 +67,7 @@ struct HotPlugState {
|
||||
pub struct NumaNode {
|
||||
memory_regions: Vec<Arc<GuestRegionMmap>>,
|
||||
cpus: Vec<u8>,
|
||||
distances: BTreeMap<u32, u8>,
|
||||
}
|
||||
|
||||
impl NumaNode {
|
||||
@@ -81,6 +82,14 @@ impl NumaNode {
|
||||
pub fn cpus_mut(&mut self) -> &mut Vec<u8> {
|
||||
&mut self.cpus
|
||||
}
|
||||
|
||||
pub fn distances(&self) -> &BTreeMap<u32, u8> {
|
||||
&self.distances
|
||||
}
|
||||
|
||||
pub fn distances_mut(&mut self) -> &mut BTreeMap<u32, u8> {
|
||||
&mut self.distances
|
||||
}
|
||||
}
|
||||
|
||||
pub type NumaNodes = BTreeMap<u32, NumaNode>;
|
||||
@@ -366,6 +375,7 @@ impl MemoryManager {
|
||||
NumaNode {
|
||||
memory_regions: vec![region.clone()],
|
||||
cpus: Vec::new(),
|
||||
distances: BTreeMap::new(),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user