Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Dec 2003 11:12:02 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Alfred Perlstein <alfred@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern subr_smp.c
Message-ID:  <XFMail.20031224111202.jhb@FreeBSD.org>
In-Reply-To: <20031224001758.GT60229@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 24-Dec-2003 Alfred Perlstein wrote:
> * John Baldwin <jhb@FreeBSD.org> [031223 09:04] wrote:
>> 
>> On 23-Dec-2003 Alfred Perlstein wrote:
>> > alfred      2003/12/23 05:54:16 PST
>> > 
>> >   FreeBSD src repository
>> > 
>> >   Modified files:
>> >     sys/kern             subr_smp.c 
>> >   Log:
>> >   Introduce mp_maxcpus which can be used by libkvm utils to find out
>> >   how many CPUs the system was compiled for.
>> >   Export the variable via a sysctl node 'kern.smp.maxcpus' as well.
>> 
>> Why does libkvm care about more than mp_maxid?
> 
> See mbuf.c from netstat(1).  basically some arrays in the kernel
> are based on MAXCPU so it has to know how much to copy.

It only needs to copy up to mp_maxid though.  All the rest after
that are just garbage anyways and you merely waste time by copying
that.  I guess if you have a structure containing multiple arrays
then that would need maxcpu.  If the arrays are standalone you don't
need it though.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20031224111202.jhb>