From owner-freebsd-arch@FreeBSD.ORG Tue Mar 11 09:56:10 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7923E1065674 for ; Tue, 11 Mar 2008 09:56:10 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail15.syd.optusnet.com.au (mail15.syd.optusnet.com.au [211.29.132.196]) by mx1.freebsd.org (Postfix) with ESMTP id EFB6D8FC36 for ; Tue, 11 Mar 2008 09:56:09 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mail15.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m2B9twW8016345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Mar 2008 20:55:59 +1100 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.1) with ESMTP id m2B9twSQ042761; Tue, 11 Mar 2008 20:55:58 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m2B9twDi042760; Tue, 11 Mar 2008 20:55:58 +1100 (EST) (envelope-from peter) Date: Tue, 11 Mar 2008 20:55:58 +1100 From: Peter Jeremy To: Jeff Roberson Message-ID: <20080311095557.GX68971@server.vk2pj.dyndns.org> References: <20080310161115.X1091@desktop> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="213E7WwkW+nU62+Y" Content-Disposition: inline In-Reply-To: <20080310161115.X1091@desktop> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) Cc: arch@freebsd.org Subject: Re: amd64 cpu_switch in C. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2008 09:56:10 -0000 --213E7WwkW+nU62+Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 10, 2008 at 04:26:17PM -1000, Jeff Roberson wrote: >In fact, the c version is ~10% faster than the assembly version at a two= =20 >thread sched_yield() test on a single cpu opteron: That sounds wonderful. How about comparing it on an SMP system. Are there any locking issues that might change that performance difference with lots of CPUs? >The only appreciable downside is that it lowers the barrier of entry for= =20 >modifying a very sensitive piece of code. IMHO, this isn't a valid reason. Increasing the both the legibility and performance of a very sensitive piece of code is a good thing. Having more people understand the code is also a good thing. FreeBSD already implements a substantial barrier of entry to code modification (commit bits) and I don't believe this should be further raised by unnecessarily hiding critical code in a language that the majority of committers are not expert in. I've seen relatively few examples of drive-by commits breaking critical code in the past and doubt that converting cpu_switch()/cpu_throw() into C will suddenly make them the target of a "how can I break FreeBSD in an obscure manner" competition. In any case, there is nothing stopping anyone with a src commit bit mangling the existing assembler implementation. --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --213E7WwkW+nU62+Y Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iEYEARECAAYFAkfWVy0ACgkQ/opHv/APuIc9mwCgiz3QPF4lOauPkYpWHtaVkQ0h JboAnjNs/04TBin4fag0B10tX254eo4O =n3b8 -----END PGP SIGNATURE----- --213E7WwkW+nU62+Y--