From owner-freebsd-stable@FreeBSD.ORG Tue May 10 03:38:43 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B56B916A4EE for ; Tue, 10 May 2005 03:38:43 +0000 (GMT) Received: from smtp800.mail.sc5.yahoo.com (smtp800.mail.sc5.yahoo.com [66.163.168.179]) by mx1.FreeBSD.org (Postfix) with SMTP id 25C0943D53 for ; Tue, 10 May 2005 03:38:43 +0000 (GMT) (envelope-from noackjr@alumni.rice.edu) Received: from unknown (HELO optimator.noacks.org) (noacks@swbell.net@70.240.205.64 with login) by smtp800.mail.sc5.yahoo.com with SMTP; 10 May 2005 03:38:42 -0000 Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id E89EF610A; Mon, 9 May 2005 22:38:41 -0500 (CDT) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07692-15; Mon, 9 May 2005 22:38:37 -0500 (CDT) Received: from compgeek.noacks.org (compgeek [192.168.1.10]) by optimator.noacks.org (Postfix) with ESMTP id E3FE860F3; Mon, 9 May 2005 22:38:37 -0500 (CDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by compgeek.noacks.org (8.13.3/8.13.3) with ESMTP id j4A3caRp001687; Mon, 9 May 2005 22:38:36 -0500 (CDT) (envelope-from noackjr@alumni.rice.edu) Message-ID: <42802CB7.80301@alumni.rice.edu> Date: Mon, 09 May 2005 22:38:31 -0500 From: Jonathan Noack User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050428) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: X-Enigmail-Version: 0.91.0.0 OpenPGP: id=991D8195; url=http://www.noacks.org/cert/noackjr.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC6757BBCF7F718E15A0C2A46" X-Virus-Scanned: amavisd-new at noacks.org cc: Ewan Todd cc: Peter Jeremy cc: Suleiman Souhlal cc: freebsd-stable Subject: Re: Performance issue X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: noackjr@alumni.rice.edu List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 03:38:43 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC6757BBCF7F718E15A0C2A46 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05/09/05 18:47, Daniel Eischen wrote: > On Mon, 9 May 2005, Daniel Eischen wrote: >>On Mon, 9 May 2005, Suleiman Souhlal wrote: >>>I think I've found the problem: Python uses setjmp/longjmp to protect >>>against SIGFPU every time it does floating point operations. The >>>python script does not actually use threads, and libpthread assumes >>>non-threaded processes are system scope. So, it would end up using >>>the sigprocmask syscall, even though it doesn't really need to. >>>The diff at http://people.freebsd.org/~ssouhlal/testing/ >>>thr_sigmask-20050509.diff fixes this, by making sure the process is >>>threaded, before using the syscall. > > [ ... ] > >>If the process wasn't linked to libpthread, then the longjmp() >>and setjmp() would still be calling the syscall, so it isn't >>the syscall itself that is making things slower. You'll notice >>that there are two calls to __sys_sigprocmask() in the section >>of code you have patched. You could eliminate the second call >>if you do some of what the remainder of the function does instead >>of returning early (the locks aren't needed and pending signals >>don't need to be run down). > > As in something like this: > > http://people.freebsd.org/~deischen/kse/thr_sigmask.c.diffs > > It has not been tested. When I tried to test this every threaded program died with sig 11. Does this require me to recompile the program before it will work? -- Jonathan Noack | noackjr@alumni.rice.edu | OpenPGP: 0x991D8195 --------------enigC6757BBCF7F718E15A0C2A46 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.1 (FreeBSD) iD8DBQFCgCy8UFz01pkdgZURAo7oAJ9kLLyW+958YwPB71UWFVTFwUODowCgk8Uo niKOiqXHS6rLVC9WfS2yndQ= =FtUg -----END PGP SIGNATURE----- --------------enigC6757BBCF7F718E15A0C2A46--