> I'm still confused though, I believe that locking an adaptive mutex will spin 
> for a short
> period then context switch and so they shouldn't be burning CPU - at least 
> not .4s worth!

An adaptive mutex will spin as long as the thread which holds the mutex is on 
CPU.  If the lock is moderately contended, you can wind up with threads 
spinning for quite a while as ownership of the lock passes from thread to 
thread across CPUs.

Mutexes in Solaris tend to be most useful when they're held for very short 
periods of time; they also work pretty well if the owning thread blocks. If 
somebody is computing for quite a while while holding them (e.g. if 
dnode_next_offset is repeatedly called and is slow), they can waste a lot of 
time on other CPUs. In this case an rwlock usually works better.

Anton
 
 
This message posted from opensolaris.org
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to