From owner-freebsd-questions@FreeBSD.ORG Thu Aug 28 14:45:48 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E8F8106566C for ; Thu, 28 Aug 2008 14:45:48 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id D6B418FC1C for ; Thu, 28 Aug 2008 14:45:47 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KYikp-0006CP-Dt for freebsd-questions@freebsd.org; Thu, 28 Aug 2008 14:45:43 +0000 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Aug 2008 14:45:43 +0000 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Aug 2008 14:45:43 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Ivan Voras Date: Thu, 28 Aug 2008 16:45:35 +0200 Lines: 62 Message-ID: References: <48B6A114.1080006@sepehrs.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig96A4A375694A5AA722F8E35E" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.16 (X11/20080724) In-Reply-To: <48B6A114.1080006@sepehrs.com> X-Enigmail-Version: 0.95.0 Sender: news Subject: Re: SMP questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2008 14:45:48 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig96A4A375694A5AA722F8E35E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable H.fazaeli wrote: >=20 > Hi all, > I have 3 questions regrading SMP on freebsd 6.x: >=20 > 1. Is there any userland tool/api to bound a process to a specific cpu?= This support is native to 8-CURRENT, I think most of it is backported to 7.1. > 2. Is there any way to force UP operation apart form recompiling kernel= > without SMP option? "mostly" - if you have a SMP kernel it will always use SMP locking and scheduling algorithms, which are in 6.x somewhat slower than the UP variants. You can force the kernel to use only one CPU with machdep.hlt_cpus sysctl: > sysctl -d machdep.hlt_cpus machdep.hlt_cpus: Bitmap of CPUs to halt. 101 (binary) will halt CPUs 0 and 2. (note that you have to give a decimal number to the sysctl) > 3. Can someone shed some light on the logic of how schedulers (4.4.BSD/= ULE) > dispatch processes among CPUs? 4.4BSD has a single queue of running threads from which the threads are dispatched to CPUs when needed, in a way that's similar in effect to round-robin. ULE has separate per-CPU queues and is aware of CPU topologies so it knows that dispatching threads to cores on the same physical CPU is better than picking a "distant" CPU. (this is all about ULE in 7-STABLE and 8-CURRENT. ULE in 6.x is broken). This is why 4.4BSD scales less well than ULE (but on the other hand 4.4BSD has had many decades of hand optimizations and there are even now reports that it behaves better in some edge circumstances). --------------enig96A4A375694A5AA722F8E35E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFItroPldnAQVacBcgRAjLNAKCPMiWo2MaejzFNfKJEqigo9KplEQCdHDn+ tKh6OGhR7G3HlufC7hHqoVc= =/+nu -----END PGP SIGNATURE----- --------------enig96A4A375694A5AA722F8E35E--