From owner-freebsd-stable@FreeBSD.ORG Mon May 9 22:52:42 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 161F916A4EB; Mon, 9 May 2005 22:52:42 +0000 (GMT) Received: from sp.dominia.org (efnet-math.org [69.60.109.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DCE543D64; Mon, 9 May 2005 22:52:41 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from [192.168.1.12] (63-170-138-118.cst-sg.blacksburg.ntc-com.net [63.170.138.118]) (authenticated bits=0) by sp.dominia.org (8.13.1/8.13.1) with ESMTP id j49Mqdwx014405 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Mon, 9 May 2005 18:52:40 -0400 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v728) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4D923762-6562-440B-8456-EA404F7FDA44@FreeBSD.org> Content-Transfer-Encoding: 7bit From: Suleiman Souhlal Date: Mon, 9 May 2005 18:52:33 -0400 To: Daniel Eischen X-Mailer: Apple Mail (2.728) cc: Ewan Todd cc: Peter Jeremy cc: freebsd-stable Subject: Re: Performance issue X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 22:52:42 -0000 Hello, On May 9, 2005, at 3:54 PM, Daniel Eischen wrote: > On Tue, 10 May 2005, Peter Jeremy wrote: > > >> On Mon, 2005-May-09 11:00:18 -0400, Ewan Todd wrote: >> >>> I have what I think is a serious performance issue with fbsd 5.3 >>> release. I've read about threading issues, and it seems to me that >>> that is what I'm looking at, but I'm not confident enough to rule >>> out >>> that it might be a hardware issue, a kernel configuration issue, or >>> something to do with the python port. >>> >> >> There does appear to be a problem in FreeBSD. Python is built with >> threading enabled by default, the threading libraries play with the >> signal mask and there have been extensive changes there. My >> > > The threading libraries don't play with the signal mask. In fact, > libpthread has userland versions of sigprocmask() et. al. and won't > even make the syscall() unless the threads are system scope. There > is a special thread in libpthread that handles signals which does > use the system sigprocmask(), but unless the application is > making heavy use of signals in general, it shouldn't matter. 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. -- Suleiman Souhlal | ssouhlal@vt.edu The FreeBSD Project | ssouhlal@FreeBSD.org