From owner-freebsd-current@FreeBSD.ORG Mon Sep 27 23:56:11 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 A207B106564A; Mon, 27 Sep 2010 23:56:11 +0000 (UTC) (envelope-from jdneal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1F68FC08; Mon, 27 Sep 2010 23:56:10 +0000 (UTC) Received: by iwn34 with SMTP id 34so6581632iwn.13 for ; Mon, 27 Sep 2010 16:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=mokEJ7QIdrokolAymhMWsFXz+8eBW5A46t5OqobPrSQ=; b=Ai8sxEpLRH5T+LO3dCKGAOPp8b+T+vZAExYwtOONYH/ZxKQK/byW3t84yoQibPiCsi wtQrNE4YWs48ynx99E4TMUoHkcYiktp8+WHj9o0nXtTfG31Qd4dUc21UX8iYY6ysdTXH ohRAaNOoHtLfuoYmBb8JKkKkxpXzUVlSANylk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=C4n/axR3y5Ki6DECUhJYjT4LCbnJmeLeHhq+TQRQWEPQOyKMXaMVC5eXT4qoXnBf5B yheG214ROmK4fjBmvrEGChHZ+0DiSh6PQI4p19eresJgFhY1pn48jVEDdjK2Bp8RFGU/ WodXkQzZEGi3L/tJ7BrWF5JEaIhPublGjykOo= MIME-Version: 1.0 Received: by 10.231.16.75 with SMTP id n11mr8101495iba.49.1285630354653; Mon, 27 Sep 2010 16:32:34 -0700 (PDT) Received: by 10.231.166.21 with HTTP; Mon, 27 Sep 2010 16:32:34 -0700 (PDT) In-Reply-To: References: <1285601161.7245.7.camel@home-yahoo> <1285604516.7245.16.camel@home-yahoo> <201009271738.19497.jhb@freebsd.org> Date: Mon, 27 Sep 2010 16:32:34 -0700 Message-ID: From: Joshua Neal To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "sbruno@freebsd.org" , freebsd-current@freebsd.org, Sean Bruno , "current@freebsd.org" 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: Mon, 27 Sep 2010 23:56:11 -0000 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 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= " >