From owner-freebsd-java@FreeBSD.ORG Tue Sep 25 19:25:17 2007 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3E2F16A419; Tue, 25 Sep 2007 19:25:17 +0000 (UTC) (envelope-from arno@heho.snv.jussieu.fr) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.freebsd.org (Postfix) with ESMTP id 3D7B413C480; Tue, 25 Sep 2007 19:25:16 +0000 (UTC) (envelope-from arno@heho.snv.jussieu.fr) Received: from heho.snv.jussieu.fr (heho.snv.jussieu.fr [134.157.184.22]) by shiva.jussieu.fr (8.13.8/jtpda-5.4) with ESMTP id l8PIslvh068475 ; Tue, 25 Sep 2007 20:54:48 +0200 (CEST) X-Ids: 166 Received: from heho.snv.jussieu.fr (localhost [127.0.0.1]) by heho.snv.jussieu.fr (8.13.3/jtpda-5.2) with ESMTP id l8PIskmm030171 ; Tue, 25 Sep 2007 20:54:46 +0200 (MEST) Received: (from arno@localhost) by heho.snv.jussieu.fr (8.13.3/8.13.1/Submit) id l8PIskNl030168; Tue, 25 Sep 2007 20:54:46 +0200 (MEST) (envelope-from arno) To: Kurt Miller References: <46EC1B55.4060202@FreeBSD.org> <200709180721.48995.kurt@intricatesoftware.com> <46F0243A.8020902@FreeBSD.org> <200709182213.00777.kurt@intricatesoftware.com> From: "Arno J. Klaassen" Date: 25 Sep 2007 20:54:45 +0200 In-Reply-To: <200709182213.00777.kurt@intricatesoftware.com> Message-ID: Lines: 58 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (shiva.jussieu.fr [134.157.0.166]); Tue, 25 Sep 2007 20:54:48 +0200 (CEST) X-Virus-Scanned: ClamAV 0.88.7/4394/Tue Sep 25 19:08:25 2007 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at shiva.jussieu.fr with ID 46F95977.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! Cc: Daniel Eischen , davidxu@freebsd.org, freebsd-java@freebsd.org Subject: Re: Massive performance loss from OS::sleep hack X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 19:25:17 -0000 Hello, Kurt Miller writes: > On Tuesday 18 September 2007 03:17:14 pm Kris Kennaway wrote: > > Kurt Miller wrote: > > > David Xu confirmed for me that pthread_yield() does give some > > > time to lower priority threads on 7.0 using thr. Attached and inline > > > are two patches for the 1.5 port that is how I suggest the issue be > > > addressed. > > > > > > For 7.0 and up default UseThreadPriorities to true and always > > > use pthread_yield(). For < 7.0 default UseThreadPriorities to > > > false and conditionally use pthread_yield()/os_sleep(). User's > > > can toggle UseThreadPriorities with the command line argument > > > -XX:+UseThreadPriorities > > > > Do we know that 6.x requires the old behaviour? Maybe it can default to > > on there too. Otherwise this looks good to my eyeball (but the > > DEFAULT_LD_LIBRARY_PATH change looks unrelated) > > > > -#define DEFAULT_LD_LIBRARY_PATH "/usr/lib" /* See ld.so.1(1) */ > > +#define DEFAULT_LD_LIBRARY_PATH "/usr/lib:/usr/local/lib" /* See > > ld.so.1(1) > > Yea I messed up the DEFAULT_LD_LIBRARY_PATH part. I didn't intend > to change that segment of the existing os_bsd.cpp patch. > > Regarding 6.x it either needs UseThreadPriorities defaulted to false > or the os_sleep hack. After discussing the options with Daniel we > agree that defaulting UseThreadPriorities to false and eliminating > the os_sleep hack for all versions is the most consitant approach. I use libthr with jdk15 on 6.x for at least a year and notice the following after this change : - on i386-UP systems my programs continue to work properly when using libthr - on a 4-way amd64-SMP system it very easily stucks java ( top(1) giving it in 'umtx'-state and 265% or so CPU). switching back to standard libpthread makes the program working as before. - this is reproducable for me by using libthr for javac as well : just compile a bunch of java files and javac hangs Is this due to a difference in libthr between 6.x and -current or some subtility in thread yielding between UP and SMP systems? I didn't tes yet with '-XX:+UseThreadPriorities' but can do so if you judge it useful. Regards, Arno