Solaris 2.5 severely slow for mutexes (known problem?)

Solaris 2.5 severely slow for mutexes (known problem?)

Post by Jake Hamb » Wed, 16 Apr 1997 04:00:00



I wrote a little program to test the speed of mutex and semaphore
lock/unlock, and discovered something interesting:  Solaris 2.5.1 (with
recommended patches) appears an order of magnitude faster than Solaris
2.5 (at least on Intel).  On my 486 at home, running Solaris 2.5:

loop overhead = 0.053270
1000000 mutex locks/unlocks in 34.027299
1000000 shared mutex locks/unlocks in 38.714911
1000000 semaphore locks/unlocks in 232.684178
1000000 shared semaphore locks/unlocks in 83.801712

On a Pentium/90 at work, running Solaris 2.5.1:

loop overhead = 0.043601
1000000 mutex locks/unlocks in 0.678123
1000000 shared mutex locks/unlocks in 0.684707
1000000 semaphore locks/unlocks in 6.291752
1000000 shared semaphore locks/unlocks in 8.843948

I haven't had time to upgrade my home box, but I definitely want to
explore these results further.  I've upgraded my SPARCs at work to
Solaris 2.5.1, so I wasn't able to test if SPARC shares the same
performance problem, but I'd guess that it does (at any rate, 2.5.1 on
SPARC is approximately as fast as 2.5.1 on Intel).  While POSIX
semaphores are a bit slower than Solaris semaphores (the numbers I
quoted above are Solaris mutexes/semaphores), the same general results
regarding 2.5/2.5.1 hold for them as well.

Another disturbing observation:  A semaphore with the "shared" option
(shareable between processes) should be, if anything, slower than a
semaphore without shared (and indeed, it is a bit slower under 2.5.1),
but under Solaris 2.5, the exact opposite is true!  This sounds like a
bug to me.

Can anyone at Sun shed some light on these numbers?  I don't think the
speed is a problem, but the semaphore numbers are worrying me that maybe
someone reversed a test for the shared flag, which would imply that
semaphores aren't safe to share across processes?  I can post my test
program if that would help.  Thanks in advance!

Cheers,
Jake

 
 
 

Solaris 2.5 severely slow for mutexes (known problem?)

Post by Steve Col » Fri, 18 Apr 1997 04:00:00



> I wrote a little program to test the speed of mutex and semaphore
> lock/unlock, and discovered something interesting:  Solaris 2.5.1 (with
> recommended patches) appears an order of magnitude faster than Solaris
> 2.5 (at least on Intel).  On my 486 at home, running Solaris 2.5:

You're correct.  2.5.1 is much, much faster on Pentium than 2.5 - in fact,
there is something to that effect on the Sun pages rationalizing the
2.5.1 upgrade... although they don't claim the speed increases you see
(they don't post any numbers, actually).

Cheers,
Steve      |President & Systems Administrator,  Kingston Online Services
           |(e pluribus unix)    Multiple-T1    URL: http://www.kos.net/
           |Business and Education partners in SouthEastern Ontario
           |
           |"Through the firewall, out the router, down the T1, across the
           | backbone, bounced from satellite, it's nothing but net."
           | (forgive me if I'm terse, I answer hundreds of e-mails a day)

 
 
 

Solaris 2.5 severely slow for mutexes (known problem?)

Post by Steve Col » Sun, 11 May 1997 04:00:00



> I wrote a little program to test the speed of mutex and semaphore
> lock/unlock, and discovered something interesting:  Solaris 2.5.1 (with
> recommended patches) appears an order of magnitude faster than Solaris
> 2.5 (at least on Intel).  On my 486 at home, running Solaris 2.5:

Solaris 2.5.1 had fairly major optimizations for Pentium systems.  Because
you're using a Pentium at work with 2.5.1 and a 486 at home with 2.5 you
see fairly dramatic results.

Cheers,
Steve      |President & Systems Administrator,  Kingston Online Services
           |(e pluribus unix)    Multiple-T1    URL: http://www.kos.net/
           |Business and Education partners in SouthEastern Ontario
           |
           |"Through the firewall, out the router, down the T1, across the
           |backbone, bounced from satellite, it's nothing but net."
           |(forgive me if I'm terse, I answer hundreds of e-mails a day)