[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 3/3] numa: Print warning if no node is assigned t
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH v2 3/3] numa: Print warning if no node is assigned to a CPU |
Date: |
Mon, 9 Feb 2015 17:53:16 -0200 |
Instead of silently assigning CPU to node 0 when it is omitted from the
command-line, check if all CPUs up to max_cpus are present in the NUMA
configuration.
I am making this a warning and not a fatal error, to allow management
software to be updated if necessary.
Signed-off-by: Eduardo Habkost <address@hidden>
---
numa.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/numa.c b/numa.c
index f004a74..722a7fe 100644
--- a/numa.c
+++ b/numa.c
@@ -190,6 +190,17 @@ static void validate_numa_cpus(void)
bitmap_or(present_cpus, present_cpus,
numa_info[i].node_cpu, MAX_CPUMASK_BITS);
}
+
+ cpu = find_first_zero_bit(present_cpus, MAX_CPUMASK_BITS);
+ if (cpu < max_cpus) {
+ fprintf(stderr, "warning: CPU(s) not present in any NUMA nodes:");
+ for (;
+ cpu < max_cpus;
+ cpu = find_next_zero_bit(present_cpus, MAX_CPUMASK_BITS, cpu + 1))
{
+ fprintf(stderr, " %d", cpu);
+ }
+ fprintf(stderr, "\n");
+ }
}
void parse_numa_opts(void)
--
2.1.0