From owner-freebsd-performance@FreeBSD.ORG Mon Sep 17 01:47:56 2007 Return-Path: Delivered-To: performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D68F16A417; Mon, 17 Sep 2007 01:47:56 +0000 (UTC) (envelope-from kurt@intricatesoftware.com) Received: from mail1.intricatesoftware.com (cl-18.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:11::2]) by mx1.freebsd.org (Postfix) with ESMTP id 0EEE613C48D; Mon, 17 Sep 2007 01:47:55 +0000 (UTC) (envelope-from kurt@intricatesoftware.com) Received: from seraph.intricatesoftware.com (relay@localhost.intricatesoftware.com [IPv6:::1]) by mail1.intricatesoftware.com (8.14.1/8.13.4) with ESMTP id l8H1lrbN023210; Sun, 16 Sep 2007 21:47:54 -0400 (EDT) Received: from seraph.intricatesoftware.com (truk@localhost.intricatesoftware.com [127.0.0.1]) by seraph.intricatesoftware.com (8.14.1/8.14.1) with ESMTP id l8H1lrpZ004358; Sun, 16 Sep 2007 21:47:54 -0400 (EDT) Message-ID: <46EDDCC9.90403@intricatesoftware.com> Date: Sun, 16 Sep 2007 21:47:53 -0400 From: Kurt Miller User-Agent: Thunderbird 2.0.0.5 (X11/20070804) MIME-Version: 1.0 To: Kip Macy References: <46EC1B55.4060202@FreeBSD.org> <200709152250.50879.kurt@intricatesoftware.com> In-Reply-To: X-Enigmail-Version: 0.95.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SMTP-Vilter-Version: 1.3.6 X-SMTP-Vilter-Virus-Backend: clamd X-SMTP-Vilter-Status: clean X-SMTP-Vilter-clamd-Virus-Status: clean X-Spamd-Symbols: ALL_TRUSTED X-SMTP-Vilter-Spam-Backend: spamd X-Spam-Score: -1.4 X-Spam-Threshold: 5.0 X-Spam-Probability: -0.3 X-Its-A-Nuisance: This is spam X-SMTP-Vilter-Unwanted-Backend: attachment X-SMTP-Vilter-attachment-Unwanted-Status: clean Cc: Daniel Eischen , Kris Kennaway , performance@freebsd.org, freebsd-java@freebsd.org Subject: Re: Massive performance loss from OS::sleep hack X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2007 01:47:56 -0000 Kip Macy wrote: > Yes, if we could hack the jvm to work around this without calling > sleep that would be better yet. However, making java work well is more > important than keeping the interface clean. One possible alternative is to not honor thread priorities in the jdk by default. In hotspot/src/os/linux/vm/os_linux.cpp I see this comment: // Note: LinuxThreads only honor thread priority for real time threads. // sched_priority is ignored if policy is SCHED_OTHER. This function is // equivalent to a "noop" on current Linux platforms. OSReturn os::set_native_priority(Thread* thread, int newpri) { which leads me to believe linux doesn't honor thread priorities in the jdk. Perhaps someone could verify that on a linux box. If linux and/or windows doesn't actually honor thread priorities I don't see why we need to. IIRC, there weren't any specific JCK tests that validated a higher priority thread actually got more time then a lower one (I could be wrong on that since there was > 30k tests in the jck). So we could default UseThreadPriorities to false and make the os_sleep() call only be used when UseThreadPriorities is true (i.e. the user explicitly sets -XX:+UseThreadPriorities). Can someone check out linux to see if it indeed supports or ignores thread priorities for java programs? -Kurt