From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzpq9-0001Wz-QQ for qemu-devel@nongnu.org; Wed, 25 Jun 2014 12:14:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzpq0-0000UP-89 for qemu-devel@nongnu.org; Wed, 25 Jun 2014 12:14:29 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:40695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzppz-0000UA-WF for qemu-devel@nongnu.org; Wed, 25 Jun 2014 12:14:20 -0400 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Jun 2014 10:14:18 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 26BC619D8046 for ; Wed, 25 Jun 2014 10:14:05 -0600 (MDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp07028.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s5PGCowj9568542 for ; Wed, 25 Jun 2014 18:12:50 +0200 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s5PGEBbm021114 for ; Wed, 25 Jun 2014 10:14:13 -0600 Date: Wed, 25 Jun 2014 09:13:59 -0700 From: Nishanth Aravamudan Message-ID: <20140625161359.GA8698@linux.vnet.ibm.com> References: <20140623193310.GD4323@linux.vnet.ibm.com> <20140624004825.GE4323@linux.vnet.ibm.com> <20140624174038.GK4323@linux.vnet.ibm.com> <20140625132134.24b70a65@nial.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140625132134.24b70a65@nial.usersys.redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH v3] numa: enable sparse node numbering List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Eduardo Habkost , "Michael S. Tsirkin" , Alexey Kardashevskiy , Hu Tao , qemu-devel@nongnu.org, Anton Blanchard , David Rientjes On 25.06.2014 [13:21:34 +0200], Igor Mammedov wrote: > On Tue, 24 Jun 2014 10:40:38 -0700 > Nishanth Aravamudan wrote: > > diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h > > index 277230d..b90bf66 100644 > > --- a/include/sysemu/sysemu.h > > +++ b/include/sysemu/sysemu.h > > @@ -145,11 +145,13 @@ extern int mem_prealloc; > > */ > > #define MAX_CPUMASK_BITS 255 > > > > -extern int nb_numa_nodes; > > +extern int nb_numa_nodes; /* Number of NUMA nodes */ > > +extern int max_numa_node; /* Highest specified NUMA node ID */ > > typedef struct node_info { > > uint64_t node_mem; > > DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS); > > struct HostMemoryBackend *node_memdev; > > + bool present; > How about dropping 'present' and replacing array with a list > of only present nodes? If that would be preferred, I can move to that. I assume a simple linked-list is fine. Does qemu provide any infrastructure for defining lists? I'll look through the source but any pointers would be helpful. Generally speaking, sparse NUMA nodes aren't that common and when they exist, the gaps aren't large. But it does seem to make sense if we have sparse IDs at all, we might as well move to a list. In any case, moving to the list means we'd have a nodeid as part of the structure instead. > That way it will be one more step closer to converting numa > infrastructure to a set of QOM objects. Sounds like a good idea to me. I'll respin the patch soon. Thanks, Nish