From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywn7u-0003b9-Uu for qemu-devel@nongnu.org; Mon, 25 May 2015 03:48:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ywn7m-0002iK-LQ for qemu-devel@nongnu.org; Mon, 25 May 2015 03:48:46 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:38342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywn7m-0002hr-05 for qemu-devel@nongnu.org; Mon, 25 May 2015 03:48:38 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 25 May 2015 13:18:33 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 8B339E0045 for ; Mon, 25 May 2015 13:21:38 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay04.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4P7mTCN60686560 for ; Mon, 25 May 2015 13:18:29 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4P74p9w024734 for ; Mon, 25 May 2015 12:34:51 +0530 Date: Mon, 25 May 2015 13:17:57 +0530 From: Bharata B Rao Message-ID: <20150525074757.GE32383@in.ibm.com> References: <1430982264-25497-1-git-send-email-bharata@linux.vnet.ibm.com> <20150513180607.GK25766@thinpad.lan.raisama.net> <55546D3A.8010509@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55546D3A.8010509@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH v0] numa: API to lookup NUMA node by address Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: imammedo@redhat.com, david@gibson.dropbear.id.au, Eduardo Habkost , qemu-devel@nongnu.org On Thu, May 14, 2015 at 11:39:06AM +0200, Paolo Bonzini wrote: > > > On 13/05/2015 20:06, Eduardo Habkost wrote: > > Also, this introduces a circular dependency between pc-dimm.c and > > numa.c. Instead of that, pc-dimm could simply notify us when a new > > device is realized (with just (addr, end, node) as arguments), so we can > > save the list of memory ranges inside struct node_info. > > > > I wonder if the memory API already provides something that would help > > us. Paolo, do you see a way we could simply use a MemoryRegion as input > > to lookup the NUMA node? > > No, but I guess you could add a numa_get/set_memory_region_node_id API > that uses a hash table. That's a variant of the "pc-dimm could simply > notify" numa.c that you propose above. While you say we can't use MemoryRegion as input to lookup the NUMA node, you suggest that we add numa_get/set_memory_region_node_id. Does this API get/set NUMA node id for the given MemoryRegion ? Regards, Bharata.