From owner-svn-src-all@FreeBSD.ORG Thu Jul 21 15:53:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A3B31065674; Thu, 21 Jul 2011 15:53:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 374448FC1F; Thu, 21 Jul 2011 15:53:41 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6069046B2D; Thu, 21 Jul 2011 11:53:40 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E55718A03C; Thu, 21 Jul 2011 11:53:39 -0400 (EDT) From: John Baldwin To: Sergey Kandaurov Date: Thu, 21 Jul 2011 09:20:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <201107191300.p6JD0UU7073447@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107210920.09604.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 21 Jul 2011 11:53:40 -0400 (EDT) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Attilio Rao , Pan Tsu , svn-src-head@freebsd.org, Sean Bruno Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 15:53:41 -0000 On Thursday, July 21, 2011 8:37:26 am Sergey Kandaurov wrote: > On 21 July 2011 14:14, Attilio Rao wrote: > > 2011/7/20 Pan Tsu : > >> Attilio Rao writes: > >> > >>> Author: attilio > >>> Date: Tue Jul 19 13:00:30 2011 > >>> New Revision: 224217 > >>> URL: http://svn.freebsd.org/changeset/base/224217 > >>> > >>> Log: > >>> Bump MAXCPU for amd64, ia64 and XLP mips appropriately. > >>> From now on, default values for FreeBSD will be 64 maxiumum supported > >>> CPUs on amd64 and ia64 and 128 for XLP. All the other architectures > >>> seem already capped appropriately (with the exception of sparc64 which > >>> needs further support on jalapeno flavour). > >>> > >>> Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced > >>> during the infrastructure cleanup for supporting MAXCPU > 32. This > >>> covers cpumask_t retiral too. > >>> > >>> The switch is considered completed at the present time, so for whatever > >>> bug you may experience that is reconducible to that area, please report > >>> immediately. > >>> > >>> Requested by: marcel, jchandra > >>> Tested by: pluknet, sbruno > >>> Approved by: re (kib) > >>> > >>> Modified: > >>> head/sys/amd64/include/param.h > >>> head/sys/ia64/include/param.h > >>> head/sys/mips/conf/XLP > >>> head/sys/mips/conf/XLP64 > >>> head/sys/mips/conf/XLPN32 > >>> head/sys/sys/param.h > >>> > >>> Modified: head/sys/amd64/include/param.h > >>> ============================================================================== > >>> --- head/sys/amd64/include/param.h Tue Jul 19 12:41:57 2011 (r224216) > >>> +++ head/sys/amd64/include/param.h Tue Jul 19 13:00:30 2011 (r224217) > >>> @@ -65,7 +65,7 @@ > >>> > >>> #if defined(SMP) || defined(KLD_MODULE) > >>> #ifndef MAXCPU > >>> -#define MAXCPU 32 > >>> +#define MAXCPU 64 > >>> #endif > >>> #else > >>> #define MAXCPU 1 > >> > >> Do you plan to bump MEMSTAT_MAXCPU, too? > >> > >> $ vmstat -z > >> vmstat: memstat_sysctl_uma: Too many CPUs > >> $ vmstat -m > >> vmstat: memstat_sysctl_malloc: Too many CPUs > >> > >> $ sysctl kern. | grep smp.\*cpus > >> kern.smp.maxcpus: 64 > >> kern.smp.cpus: 2 > >> > > > > Jeeeez, we seriously need to fix this getting rid of the static values. > > > > Anyway, can you try the following patch?: > > http://www.freebsd.org/~attilio/memstat_maxcpu.diff > > > > It is going to add some memory overhead for i386 case. > > > > Something like this should work (vmstat -z, vmstat -m both work). > It gets rid of MEMSTAT_MAXCPU at the expense of malloc() at runtime. > http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.diff > > Probably it should work with maxid, instead of maxcpu to save some memory. > Though, using maxcpu is more safe. Actually, I would prefer that it use mp_maxid as that is the general variable things should use. mp_maxcpus is a concession for the few places that may need to know the MAXCPUS value (e.g. if using libkvm to access a structure in a crashdump or live kernel that has a member array with MAXCPU elements). Code that just wants to allocate memory to hold per-CPU data should use mp_maxid whenever possible. -- John Baldwin