Received: from eggs.gnu.org ([2001:4830:134:3::10]:59830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM2p4-0007Zp-OW for qemu-devel@nongnu.org; Thu, 12 Feb 2015 18:05:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YM2oy-0000vv-VZ for qemu-devel@nongnu.org; Thu, 12 Feb 2015 18:05:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM2oy-0000vh-MI for qemu-devel@nongnu.org; Thu, 12 Feb 2015 18:05:20 -0500 Date: Thu, 12 Feb 2015 21:05:14 -0200 From: Eduardo Habkost Message-ID: <20150212230514.GZ30651@thinpad.lan.raisama.net> References: <1423763435-3696-1-git-send-email-ehabkost@redhat.com> <1423763435-3696-5-git-send-email-ehabkost@redhat.com> <54DCEF6D.6080903@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54DCEF6D.6080903@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 4/4] numa: Print warning if no node is assigned to a CPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Hu Tao , Igor Mammedov , qemu-devel@nongnu.org, "Michael S. Tsirkin" 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