NetBSD vs Solaris condvar semantics

2012-10-14 Thread Taylor R Campbell
I'm working on fixing ZFS locking, and I ran into a diference between NetBSD's and Solaris's interpretation of condvars. In Solaris, it seems to be kosher to do cv_broadcast(cv); cv_destroy(cv); at least if waiters use only cv_wait and not cv_wait_sig c. That idiom makes NetBSD very

Re: NetBSD vs Solaris condvar semantics

2012-10-14 Thread Taylor R Campbell
Date: Sun, 14 Oct 2012 09:37:09 +0200 From: Martin Husemann mar...@duskware.de In the zfs code, where do they store the mutex needed for cv_wait? In the two cases I have come across, dirent locks and range locks, a number of condvars, one per dirent or one per range, share a common

Re: NetBSD vs Solaris condvar semantics

2012-10-14 Thread Taylor R Campbell
Date: Sun, 14 Oct 2012 10:04:53 +0100 From: David Laight da...@l8s.co.uk Hmmm IIRC solaris kernel cv_init() is actually a malloc, so cv_destroy() is a free() - and thus mandatory. OTOH doesn't NetBSD's cv_init() just initialise the memory, making cv_destroy() not strictly

Re: NetBSD vs Solaris condvar semantics

2012-10-14 Thread Taylor R Campbell
Date: Sun, 14 Oct 2012 14:27:48 + From: Taylor R Campbell campbell+netbsd-tech-k...@mumble.net In the two cases I have come across, dirent locks and range locks, a number of condvars, one per dirent or one per range, share a common mutex in some common enclosing object, such as

Re: NetBSD vs Solaris condvar semantics

2012-10-14 Thread David Holland
On Sun, Oct 14, 2012 at 07:20:02AM +, Taylor R Campbell wrote: I'm working on fixing ZFS locking, and I ran into a diference between NetBSD's and Solaris's interpretation of condvars. In Solaris, it seems to be kosher to do cv_broadcast(cv); cv_destroy(cv); at least

Re: NetBSD vs Solaris condvar semantics

2012-10-14 Thread David Laight
On Sun, Oct 14, 2012 at 02:27:48PM +, Taylor R Campbell wrote: Date: Sun, 14 Oct 2012 09:37:09 +0200 From: Martin Husemann mar...@duskware.de In the zfs code, where do they store the mutex needed for cv_wait? In the two cases I have come across, dirent locks and range locks, a