def get_host_numa_topology(self, numa_topo_obj): # Replace this call with a more generic call when we obtain other # NUMA related data like memory etc. cpu_info = self.get_cpu_numa_info() floating_cpus = utils.get_floating_cpu_set() numa_node_obj = [] for node, cpuset in cpu_info.items(): numa_node = objects.NUMANode() if floating_cpus: allowed_cpus = set(cpuset) - (floating_cpus & set(cpuset)) else: allowed_cpus = set(cpuset) numa_node.id = node # allowed_cpus are the ones allowed to pin on. # Rest of the cpus are assumed to be floating # in nature. numa_node.cpuset = allowed_cpus numa_node.pinned_cpus = set([]) numa_node_obj.append(numa_node) numa_topo_obj.nodes = numa_node_obj
def get_host_numa_topology(self, numa_topo_obj): # Replace this call with a more generic call when we obtain other # NUMA related data like memory etc. cpu_info = self.get_cpu_numa_info() mem_info = self.get_mem_numa_info() floating_cpus = utils.get_floating_cpu_set() numa_node_obj = [] for cpu, mem_total in zip(cpu_info.items(), mem_info): node, cpuset = cpu numa_node = objects.NUMANode() if floating_cpus: allowed_cpus = set(cpuset) - (floating_cpus & set(cpuset)) else: allowed_cpus = set(cpuset) numa_node.id = node # allowed_cpus are the ones allowed to pin on. # Rest of the cpus are assumed to be floating # in nature. numa_node.cpuset = allowed_cpus numa_node.pinned_cpus = set([]) numa_node.mem_total = mem_total numa_node.mem_available = mem_total numa_node_obj.append(numa_node) numa_topo_obj.nodes = numa_node_obj