From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: find the node that a cpu belongs to Date: Tue, 17 Mar 2009 12:59:07 +0100 Message-ID: <20090317115907.GS11935@one.firstfloor.org> References: <20090317010910.GA9590@solar.cslab.ece.ntua.gr> <20090317104522.GN11935@one.firstfloor.org> <20090317113242.GA30922@solar.cslab.ece.ntua.gr> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20090317113242.GA30922@solar.cslab.ece.ntua.gr> Sender: linux-numa-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Kornilios Kourtis Cc: Andi Kleen , linux-numa@vger.kernel.org On Tue, Mar 17, 2009 at 01:32:42PM +0200, Kornilios Kourtis wrote: > On Tue, Mar 17, 2009 at 11:45:22AM +0100, Andi Kleen wrote: > > On Tue, Mar 17, 2009 at 03:09:10AM +0200, Kornilios Kourtis wrote: > > > Hi, > > > > > > I was wondering if you would be interested in adding a libnuma function > > > for determing the node that a cpu belongs to. > > > > Concrete use case please. Why would you want to do that in a program? > > My specific case is quite simple: I have a program that creates a number > of threads that are bound to run in specific cpus. I want to pre-allocate > memory in the node of the cpu that the thread will run before the threads > are created using numa_alloc_onnode(). Normally the number of threads is dependent on the data layout, isn't it? It seems like a backwards way of doing things, but ok. BTW another known topology reporting hole is there is currently no way to report number of CPUs for a given node. Normally it's just max/cpus, but that can change with CPU hotplug. On the other hand CPU/node hotplug is currently not really supported anyways. -Andi -- ak@linux.intel.com -- Speaking for myself only.