Date: Tue, 11 Mar 2008 20:55:58 +1100 From: Peter Jeremy <peterjeremy@optushome.com.au> To: Jeff Roberson <jroberson@chesapeake.net> Cc: arch@freebsd.org Subject: Re: amd64 cpu_switch in C. Message-ID: <20080311095557.GX68971@server.vk2pj.dyndns.org> In-Reply-To: <20080310161115.X1091@desktop> References: <20080310161115.X1091@desktop>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080311095557.GX68971>