From owner-freebsd-current@FreeBSD.ORG Wed Sep 29 13:54:24 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 1CF0E1065674; Wed, 29 Sep 2010 13:54:24 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E99588FC12; Wed, 29 Sep 2010 13:54:23 +0000 (UTC) Received: from [192.168.2.105] (host86-161-142-69.range86-161.btcentralplus.com [86.161.142.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 862F346B90; Wed, 29 Sep 2010 09:54:21 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <201009290749.22669.jhb@freebsd.org> Date: Wed, 29 Sep 2010 14:54:17 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <07839A8A-5CC5-47C5-B098-89FE81CA2F3E@freebsd.org> References: <1285601161.7245.7.camel@home-yahoo> <1285699244.2454.63.camel@home-yahoo> <201009290749.22669.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1081) Cc: sbruno@freebsd.org, "freebsd-current@FreeBSD.org" , Joshua Neal 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: Wed, 29 Sep 2010 13:54:24 -0000 On 29 Sep 2010, at 12:49, John Baldwin wrote: > On Tuesday, September 28, 2010 6:24:32 pm Robert N. M. Watson wrote: >>=20 >> On 28 Sep 2010, at 19:40, Sean Bruno wrote: >>=20 >>>> If you go fully dynamic you should use mp_maxid + 1 rather than = maxcpus. >>>=20 >>> I assume that mp_maxid is the new kern.smp.maxcpus? Can you inject = some >>> history here so I can understand why one is "better" than the other? >>=20 >> So, unlike maxcpus, mp_maxid is in theory susceptible to races in a = brave new world in which we support hotplug CPUs -- a brave new world = we're=20 > not yet ready for, however. If you do use mp_maxid, be aware you need = to add one to get the size of the array -- maxcpus is the number of CPUs = that=20 > can be used, whereas mp_maxid is the highest CPU ID (counting from 0) = that is used. >=20 > Hmm, I'm not sure that is true. My feeling on mp_maxid is that it is = the > largest supported CPUID. Platforms that support hotplug would need to = set > mp_maxid such that it has room for hotpluggable CPUs. You don't want = to > go reallocate the UMA datastructures for every zone when a CPU is = hotplugged > for example. Yes, we'll have to break one (or even both) of two current assumptions = with the move to hotplug: contiguous in-use CPU IDs and mp_maxid = representing the greatest possible CPU ID as a constant value. The = former is guaranteed, but I wonder about the latter. On face value, you = might say "oh, we know how many sockets there are", but if course, we = don't know how many threads will arrive when a package is inserted. For = many subsystems, DPCPU will present a more than adequate answer for = avoiding resizing, although not for low-level systems (perhaps such as = UMA?). Likewise, on virtual machine platforms where hotplug actually = might reflect a longer-term scheduling choice by the admin/hypervisor = (i.e., resource partitioning), it may be harder to reason about what the = future holds. Robert=