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 > >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

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); > > a

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 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 a znode. So, e.g., the end of zf

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 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 necessary? In bot

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 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 mutex in some common en

Re: NetBSD vs Solaris condvar semantics

2012-10-14 Thread David Laight
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 i

Re: NetBSD vs Solaris condvar semantics

2012-10-14 Thread Martin Husemann
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); I like this, t

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 unha