atom feed22 messages in org.freebsd.freebsd-performanceMassive performance loss from OS::sle...
FromSent OnAttachments
Kris KennawaySep 15, 2007 10:49 am 
Kris KennawaySep 15, 2007 12:08 pm 
Daniel EischenSep 15, 2007 3:37 pm 
Daniel EischenSep 15, 2007 9:47 pm 
Kip MacySep 15, 2007 10:52 pm 
Kris KennawaySep 16, 2007 3:16 am 
Daniel EischenSep 16, 2007 8:45 am 
Kurt MillerSep 16, 2007 9:06 am 
Kurt MillerSep 16, 2007 9:06 am 
Kip MacySep 16, 2007 12:56 pm 
Alfred PerlsteinSep 16, 2007 6:16 pm 
Kurt MillerSep 16, 2007 6:47 pm 
David XuSep 16, 2007 7:33 pm 
Kurt MillerSep 18, 2007 4:21 am 
Daniel EischenSep 18, 2007 5:29 am 
Kurt MillerSep 18, 2007 7:15 am 
Daniel EischenSep 18, 2007 10:08 am 
Kurt MillerSep 18, 2007 10:28 am 
Daniel EischenSep 18, 2007 11:00 am 
Kris KennawaySep 18, 2007 12:16 pm 
Kurt MillerSep 18, 2007 7:12 pm 
Kris KennawaySep 19, 2007 3:16 am 
Subject:Massive performance loss from OS::sleep hack
From:Kip Macy (kip.@gmail.com)
Date:Sep 16, 2007 12:56:35 pm
List:org.freebsd.freebsd-performance

On 9/16/07, Daniel Eischen <deis@freebsd.org> wrote:

On Sat, 15 Sep 2007, Kip Macy wrote:

Or more likely they'll continue to maintain a sched_yield that isn't posix compliant. We may just want to add some sort of interface so the jvm can tell the kernel that sched_yield should be non-compliant for the current process.

I don't think that is a good idea, it seems like too much of a hack. The scheduler(s) should schedule threads the way they are designed to, either obeying a threads priority, using it as a hint, or totally ignoring it.

If the JVM kept track of the thread priorities in use, I suppose Thread.yield() could first lower the current thread's priority to the next used priority and then yield, raising the priority back after the yield. This isn't peIrfect, there are race conditions, the next highest priority thread(s) could be blocked and not runnable, etc. Maybe just lowering the priority to min or default priority would work well enough.

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.

This test would fail even on Solaris if you use SCHED_RR or SCHED_FIFO since it is POSIX compliant for those scheduling classes.

I honestly don't think it matters. The JCK using it implies that there are probably java apps that rely on this defective behavior. I would be willing to bet that Solaris and Java developers at Sun already had this argument and the Java developers won :-(.

-Kip