Re: cvs commit: src/sys/kern subr_smp.c

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 24 Dec 2003 11:12:02 -0500 (EST)
On 24-Dec-2003 Alfred Perlstein wrote:
> * John Baldwin <jhb_at_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_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
Received on Wed Dec 24 2003 - 08:12:16 UTC