From owner-freebsd-current@FreeBSD.ORG Tue Sep 28 16:55:55 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387901065670; Tue, 28 Sep 2010 16:55:55 +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 1830E8FC12; Tue, 28 Sep 2010 16:55:54 +0000 (UTC) Received: from [127.0.0.1] (cheese.corp.yahoo.com [216.145.50.99]) by mrout2.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id o8SGjBxZ065956; Tue, 28 Sep 2010 09:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=yahoo-inc.com; s=cobra; t=1285692311; bh=cAg42VJu+1XzzToKF0HGsaT7pBxxLBzUhu0LnsMXpg8=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=mPIFSVVhUYyfV3CitXmct1HwmiUSOne9P8r1W9ghToRTJGhRbg1NbvhgGqJ9ULjeo g2IDQYisKmI2C8YkvBzKtNPiNbUQ0ADdI5OjIz9YMBpN4juz2NSFOWLa7uG5slSi1W jAB0Of3nGRNnK1mLvI9TREFwKi0gQzKeU/F0+Z2U= From: Sean Bruno To: Robert Watson In-Reply-To: References: <1285601161.7245.7.camel@home-yahoo> <1285604516.7245.16.camel@home-yahoo> <201009271738.19497.jhb@freebsd.org> Content-Type: text/plain; charset="UTF-8" Date: Tue, 28 Sep 2010 09:45:11 -0700 Message-ID: <1285692311.2454.11.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: Tue, 28 Sep 2010 17:12:29 +0000 Cc: "sbruno@freebsd.org" , "freebsd-current@FreeBSD.org" , Joshua Neal , John Baldwin 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: Tue, 28 Sep 2010 16:55:55 -0000 On Tue, 2010-09-28 at 02:48 -0500, Robert Watson wrote: > On Mon, 27 Sep 2010, Joshua Neal wrote: > > > I hit this bug at one point, and had to bump MEMSTAT_MAXCPU. It's already > > asking the kernel for the max number and throwing an error if it doesn't > > agree: > > Yes, it looks like MAXCPU was bumped in the kernel without bumping the limit > in libmemstat. The bug could be in not having a comment by the definition of > MAXCPU saying that MEMSTAT_MAXCPU needs to be modified as well. > > > I was thinking a more future-proof fix would be to get rid of the static > > allocations and allocate the library's internal structures based on the > > value of kern.smp.maxcpus. > > Agreed. I'm fairly preoccupied currently, but would be happy to accept > patches :-). > > Robert Working on a dynamic version today. I'll spam it over to you for review later. I'm moving the percpu struct definitions outside of struct memory_type, allocating quantity kern.smp.maxcpus, removing the boundary checks based on MEMSTAT_MAXCPU and then removing MEMSTAT_MAXCPU all together. Sean