Date: Mon, 09 May 2005 22:38:31 -0500 From: Jonathan Noack <noackjr@alumni.rice.edu> To: Daniel Eischen <deischen@freebsd.org> Cc: freebsd-stable <freebsd-stable@freebsd.org> Subject: Re: Performance issue Message-ID: <42802CB7.80301@alumni.rice.edu> In-Reply-To: <Pine.GSO.4.43.0505091941130.27904-100000@sea.ntplx.net> References: <Pine.GSO.4.43.0505091941130.27904-100000@sea.ntplx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42802CB7.80301>