From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kornilios Kourtis Subject: Re: find the node that a cpu belongs to Date: Tue, 17 Mar 2009 13:32:42 +0200 Message-ID: <20090317113242.GA30922@solar.cslab.ece.ntua.gr> References: <20090317010910.GA9590@solar.cslab.ece.ntua.gr> <20090317104522.GN11935@one.firstfloor.org> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20090317104522.GN11935@one.firstfloor.org> Sender: linux-numa-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andi Kleen Cc: linux-numa@vger.kernel.org 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(). Obviously, there isn't a hard requirement to include such a function in libnuma, since it could be implemented using existing functions, or make the allocations after the threads are spawned using numa_alloc_local(). On the other hand I'm guessing that it could be useful to other cases as well. cheers, -- Kornilios Kourtis