From owner-freebsd-current@FreeBSD.ORG Mon Sep 27 16:22:26 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B9D106566B for ; Mon, 27 Sep 2010 16:22:26 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout2.yahoo.com (mrout2.yahoo.com [216.145.54.172]) by mx1.freebsd.org (Postfix) with ESMTP id 59AAA8FC2C for ; Mon, 27 Sep 2010 16:22:26 +0000 (UTC) Received: from [127.0.0.1] (proxy8.corp.yahoo.com [216.145.48.13]) by mrout2.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id o8RGLurE015768; Mon, 27 Sep 2010 09:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=yahoo-inc.com; s=cobra; t=1285604516; bh=p82NdZY5QhZNy2i3WV0HpndXVf32E8M5JGPYxD3Bnl0=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=Qzcrdt3WE0JJ7GfiTuytxZJ9fDLK8jM+i7nMIKFSn5pNXPLzgipPonvZk+arOML5v l1w6r5DNYUonG2FD729AjXxQ+GqpkEnDyLba3i22HHfPMR2TB3EGijiCuH/IpFnskX UrepZ5Dit4rc4kajCGxgrU3b5ycOFk8/1oH9o+X4= From: Sean Bruno To: Julian Elischer In-Reply-To: <4CA0BE08.50408@freebsd.org> References: <1285601161.7245.7.camel@home-yahoo> <4CA0BE08.50408@freebsd.org> Content-Type: text/plain; charset="UTF-8" Date: Mon, 27 Sep 2010 09:21:56 -0700 Message-ID: <1285604516.7245.16.camel@home-yahoo> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 27 Sep 2010 17:36:29 +0000 Cc: "sbruno@freebsd.org" , "current@freebsd.org" Subject: Re: MAXCPU preparations X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2010 16:22:26 -0000 On Mon, 2010-09-27 at 08:53 -0700, Julian Elischer wrote: > On 9/27/10 8:26 AM, Sean Bruno wrote: > > Does this look like an appropriate modification to libmemstat? > > > > Sean > > > > > > ==== //depot/yahoo/ybsd_7/src/lib/libmemstat/memstat.h#4 > > - /home/seanbru/ybsd_7/src/lib/libmemstat/memstat.h ==== > > @@ -28,12 +28,13 @@ > > > > #ifndef _MEMSTAT_H_ > > #define _MEMSTAT_H_ > > +#include > > > > /* > > * Number of CPU slots in library-internal data structures. This > > should be > > * at least the value of MAXCPU from param.h. > > */ > > -#define MEMSTAT_MAXCPU 64 > > +#define MEMSTAT_MAXCPU MAXCPU /* defined in > > sys/${ARCH}/include/param.h */ > > > > > wouldn't it be better to do a sysctlbyname() and use the real value > for the system? > That was my initial thought (as prodded by scottl and peter). If it is made dynamic, could this be opening a race condition where the call to sysctlbyname() returns a count of CPUS that is in turn changed by the offlining of a CPU? Or am I thinking to much about this? Sean