From owner-freebsd-smp Wed Jul 18 7:31: 1 2001 Delivered-To: freebsd-smp@freebsd.org Received: from technokratis.com (modemcable052.174-202-24.mtl.mc.videotron.ca [24.202.174.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D33537B407; Wed, 18 Jul 2001 07:30:55 -0700 (PDT) (envelope-from bmilekic@technokratis.com) Received: (from bmilekic@localhost) by technokratis.com (8.11.3/8.11.3) id f6IEgWI96955; Wed, 18 Jul 2001 10:42:32 -0400 (EDT) (envelope-from bmilekic) Date: Wed, 18 Jul 2001 10:42:32 -0400 From: Bosko Milekic To: Matthew Jacob Cc: smp@freebsd.org, audit@freebsd.org Subject: Re: planned change to mbinit code and minor changes to mp startup Message-ID: <20010718104232.A96785@technokratis.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mjacob@feral.com on Sat, Jul 14, 2001 at 11:25:46AM -0700 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi Matthew, Thanks for looking into this. It is clearly a problem. The proposed solution is also good. However, it poses a problem when it comes to netstat(1) and systat(1). They both presently rely on mp_ncpus and fetch the PCPU stats treating the whole thing as a dense array. This isn't your fault (it's mine), and I'd ask for this patch to sit pending for a while until I get to cleaning up some of systat(1) and netstat(1) again (when I re-enable mbtypes stats). It's relatively high on the TODO and I should be there soon, so just bear with me as I re-settle in. On Sat, Jul 14, 2001 at 11:25:46AM -0700, Matthew Jacob wrote: > > Problem: the MB init and alloc code assumes that in the SMP case that there is > a dense array of CPU ids for the CPUs present and reported via mp_ncpus. [...] As for moving toward the (c) point you mention: I wonder how reasonable it would be to offer (a) hook(s) to subsystems which they can use to configure PCPU-specific intialization routines to be called when a processor is enabled during runtime. i.e.: time 1: CPU 1 off; CPU 2 off; CPU 3 on; CPU 4 on; time 2: CPU 1 off -> on; hook_for_cpu1(); CPU 2 off -> on; hook_for_cpu2(); CPU 3 on; CPU 4 on; The hook functions could include, amongst other things, the code to malloc() the necessary structures for the relevant per-CPU container. Cheers, -- Bosko Milekic bmilekic@technokratis.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message