qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 4/4] numa: Print warning if no node is assign


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v3 4/4] numa: Print warning if no node is assigned to a CPU
Date: Thu, 12 Feb 2015 21:05:14 -0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Feb 12, 2015 at 07:22:37PM +0100, Paolo Bonzini wrote:
> On 12/02/2015 18:50, Eduardo Habkost wrote:
> > +
> > +    if (!bitmap_full(seen_cpus, max_cpus)) {
> > +        char *msg;
> > +        bitmap_complement(seen_cpus, seen_cpus, max_cpus);
> > +        msg = enumerate_cpus(seen_cpus, max_cpus);
> > +        error_report("warning: CPU(s) not present in any NUMA nodes: %s", 
> > msg);
> > +        g_free(msg);
> > +    }
> 
> What happens if you have a single node (useful to give it a memdev via
> -numa node,memdev=...)?  It would be nice in this case to avoid the
> warning and assign all CPUs to node 0.

The existing code at set_numa_nodes()/parse_numa_opts() should already do what
you suggest when we have only one node:

    for (i = 0; i < nb_numa_nodes; i++) {
        if (!bitmap_empty(numa_info[i].node_cpu, MAX_CPUMASK_BITS)) {
            break;
        }
    }
    /* assigning the VCPUs round-robin is easier to implement, guest OSes
     * must cope with this anyway, because there are BIOSes out there in
     * real machines which also use this scheme.
     */
    if (i == nb_numa_nodes) {
        for (i = 0; i < max_cpus; i++) {
            set_bit(i, numa_info[i % nb_numa_nodes].node_cpu);
        }
    }

I don't like how it ignores socket topology, but it is good enough for the
one-node case, at least.

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]