Date: Mon, 27 Sep 2010 16:32:34 -0700 From: Joshua Neal <jdneal@gmail.com> To: Robert Watson <rwatson@freebsd.org> Cc: "sbruno@freebsd.org" <sbruno@freebsd.org>, freebsd-current@freebsd.org, Sean Bruno <seanbru@yahoo-inc.com>, "current@freebsd.org" <current@freebsd.org> Subject: Re: MAXCPU preparations Message-ID: <AANLkTik0Eq2w565cgszvXK4kgDo08%2B28iPkk3CsU-LqC@mail.gmail.com> In-Reply-To: <alpine.BSF.2.00.1009272240340.69239@fledge.watson.org> References: <1285601161.7245.7.camel@home-yahoo> <1285604516.7245.16.camel@home-yahoo> <alpine.BSF.2.00.1009272210040.69239@fledge.watson.org> <201009271738.19497.jhb@freebsd.org> <alpine.BSF.2.00.1009272240340.69239@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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: if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &size, NULL, 0) < 0) = { [...] if (maxcpus > MEMSTAT_MAXCPU) { list->mtl_error =3D MEMSTAT_ERROR_TOOMANYCPUS; return (-1); } 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. - Joshua On Mon, Sep 27, 2010 at 2:42 PM, Robert Watson <rwatson@freebsd.org> wrote: > > On Mon, 27 Sep 2010, John Baldwin wrote: > >> Also, I think we should either fix MAXCPU to export the SMP value to >> userland, or hide it from userland completely. =A0Exporting the UP value= is >> Just Wrong (tm). > > Well, it's useful in the sense that it tells you what the maximum number = of > CPUs a kernel can support is, which is helpful, especially if you're futz= ing > with MAXCPU as a kernel option :-). > > But, more generally, many things that use MAXCPU should probably use eith= er > mp_maxid or DPCPU. =A0Not everything, but most things. > > Robert > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org= " >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik0Eq2w565cgszvXK4kgDo08%2B28iPkk3CsU-LqC>