From: Andi Kleen Subject: Re: numa_num_configured_cpus off by 2 on 2.6.33 ? Date: Thu, 11 Mar 2010 23:48:54 +0100 Message-ID: <20100311224854.GJ20695@one.firstfloor.org> References: <4B97D293.5010400@itwm.fraunhofer.de> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <4B97D293.5010400@itwm.fraunhofer.de> Sender: linux-numa-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Martin Vogt Cc: linux-numa@vger.kernel.org On Wed, Mar 10, 2010 at 06:10:43PM +0100, Martin Vogt wrote: > > Hello list, > > currently my numa library reports two cpus more than I actuall have: The code is broken anyways, it should be looking for the highest CPU number, otherwise it would not handle CPU hotplug. Something like int max = 0; ... int n; if (sscanf(dirent->d_name, "cpu%d", &n) == 1 && n > max) max = n; ... use max -Andi