mirror_zfs/include/sys
Brian Behlendorf d599e4fa79 Block in cv_destroy() on all waiters
Previously we would ASSERT in cv_destroy() if it was ever called
with active waiters.  However, I've now seen several instances in
OpenSolaris code where they do the following:

  cv_broadcast();
  cv_destroy();

This leaves no time for active waiters to be woken up and scheduled
and we trip the ASSERT.  This has not been observed to be an issue
on OpenSolaris because their cv_destroy() basically does nothing.
They still do run the risk of the memory being free'd after the
cv_destroy() and hitting a bad paging request.  But in practice
this race is so small and unlikely it either doesn't happen, or
is so unlikely when it does happen the root cause has not yet been
identified.

Rather than risk the same issue in our code this change updates
cv_destroy() to block until all waiters have been woken and
scheduled.  This may take some time because each waiter must
acquire the mutex.

This change may have an impact on performance for frequently
created and destroyed condition variables.  That however is a price
worth paying it avoid crashing your system.  If performance issues
are observed they can be addressed by the caller.
2011-02-04 14:09:08 -08:00
..
fm Public Release Prep 2010-05-17 15:18:00 -07:00
fs Public Release Prep 2010-05-17 15:18:00 -07:00
sysevent Public Release Prep 2010-05-17 15:18:00 -07:00
acl_impl.h Public Release Prep 2010-05-17 15:18:00 -07:00
acl.h Add VSA_ACE_* and MAX_ACL_ENTRIES defines 2011-01-27 16:06:09 -08:00
atomic.h atomic_*_*_nv() functions need to return the new value atomically. 2010-09-17 16:03:25 -07:00
attr.h Public Release Prep 2010-05-17 15:18:00 -07:00
bitmap.h Public Release Prep 2010-05-17 15:18:00 -07:00
bootconf.h Public Release Prep 2010-05-17 15:18:00 -07:00
bootprops.h Stub out additional missing headers 2010-06-11 15:57:25 -07:00
buf.h Public Release Prep 2010-05-17 15:18:00 -07:00
byteorder.h Public Release Prep 2010-05-17 15:18:00 -07:00
callb.h Public Release Prep 2010-05-17 15:18:00 -07:00
cmn_err.h Public Release Prep 2010-05-17 15:18:00 -07:00
compress.h Public Release Prep 2010-05-17 15:18:00 -07:00
condvar.h Block in cv_destroy() on all waiters 2011-02-04 14:09:08 -08:00
conf.h Public Release Prep 2010-05-17 15:18:00 -07:00
console.h Public Release Prep 2010-05-17 15:18:00 -07:00
cpupart.h Stub out additional missing headers 2010-06-11 15:57:25 -07:00
cpuvar.h Public Release Prep 2010-05-17 15:18:00 -07:00
crc32.h Public Release Prep 2010-05-17 15:18:00 -07:00
cred.h Public Release Prep 2010-05-17 15:18:00 -07:00
ctype.h Public Release Prep 2010-05-17 15:18:00 -07:00
ddi.h Public Release Prep 2010-05-17 15:18:00 -07:00
debug.h Display DEBUG keyword during module load when --enable-debug is used. 2010-07-20 15:31:03 -07:00
dirent.h Public Release Prep 2010-05-17 15:18:00 -07:00
disp.h Public Release Prep 2010-05-17 15:18:00 -07:00
dkio.h Public Release Prep 2010-05-17 15:18:00 -07:00
dklabel.h Public Release Prep 2010-05-17 15:18:00 -07:00
dnlc.h Public Release Prep 2010-05-17 15:18:00 -07:00
dumphdr.h Public Release Prep 2010-05-17 15:18:00 -07:00
efi_partition.h Public Release Prep 2010-05-17 15:18:00 -07:00
errno.h Public Release Prep 2010-05-17 15:18:00 -07:00
extdirent.h Add missing headers 2011-01-27 16:06:09 -08:00
fcntl.h Add missing headers 2011-01-27 16:06:09 -08:00
file.h Add FIGNORECASE define 2011-01-27 16:06:09 -08:00
idmap.h Add missing headers 2011-01-27 16:06:09 -08:00
int_limits.h Public Release Prep 2010-05-17 15:18:00 -07:00
int_types.h Public Release Prep 2010-05-17 15:18:00 -07:00
inttypes.h Public Release Prep 2010-05-17 15:18:00 -07:00
isa_defs.h Public Release Prep 2010-05-17 15:18:00 -07:00
kidmap.h Add missing headers 2011-01-27 16:06:09 -08:00
kmem.h Stub out kmem cache defrag API 2010-08-27 14:23:42 -07:00
kobj.h Public Release Prep 2010-05-17 15:18:00 -07:00
kstat.h Cleanly split Linux proc.h (fs) from conflicting Solaris proc.h (process) 2010-06-11 15:57:25 -07:00
list.h Add list_link_replace() function 2010-08-27 14:23:48 -07:00
Makefile.in Build system and packaging (RPM support) 2009-03-09 15:56:55 -07:00
mkdev.h Public Release Prep 2010-05-17 15:18:00 -07:00
mntent.h Public Release Prep 2010-05-17 15:18:00 -07:00
modctl.h Public Release Prep 2010-05-17 15:18:00 -07:00
mode.h Add vn_mode_to_vtype/vn_vtype to_mode helpers 2011-01-12 11:38:04 -08:00
mount.h Public Release Prep 2010-05-17 15:18:00 -07:00
mutex.h Make kmutex_t typesafe in all cases. 2010-11-29 11:25:32 -08:00
note.h Public Release Prep 2010-05-17 15:18:00 -07:00
open.h Public Release Prep 2010-05-17 15:18:00 -07:00
param.h Add MAXUID define 2011-01-27 16:06:09 -08:00
pathname.h Public Release Prep 2010-05-17 15:18:00 -07:00
policy.h Minor policy interface 2011-01-27 16:06:09 -08:00
pool.h Stub out additional missing headers 2010-06-11 15:57:25 -07:00
priv_impl.h Stub out additional missing headers 2010-06-11 15:57:25 -07:00
proc.h Cleanly split Linux proc.h (fs) from conflicting Solaris proc.h (process) 2010-06-11 15:57:25 -07:00
processor.h Public Release Prep 2010-05-17 15:18:00 -07:00
pset.h Stub out additional missing headers 2010-06-11 15:57:25 -07:00
random.h Public Release Prep 2010-05-17 15:18:00 -07:00
refstr.h Public Release Prep 2010-05-17 15:18:00 -07:00
resource.h Public Release Prep 2010-05-17 15:18:00 -07:00
rwlock.h Correctly handle rwsem_is_locked() behavior 2010-08-10 16:43:00 -07:00
sdt.h Public Release Prep 2010-05-17 15:18:00 -07:00
sid.h Add ksid_index_t and ksid_t types 2011-01-27 16:06:09 -08:00
signal.h Split <sys/debug.h> header 2010-07-20 13:29:35 -07:00
stat.h Public Release Prep 2010-05-17 15:18:00 -07:00
stropts.h Public Release Prep 2010-05-17 15:18:00 -07:00
sunddi.h Split <sys/debug.h> header 2010-07-20 13:29:35 -07:00
sunldi.h Public Release Prep 2010-05-17 15:18:00 -07:00
sysdc.h Stub out additional missing headers 2010-06-11 15:57:25 -07:00
sysevent.h Public Release Prep 2010-05-17 15:18:00 -07:00
sysmacros.h Give ENOTSUP a valid user space error value 2010-11-10 13:25:49 -08:00
systeminfo.h Public Release Prep 2010-05-17 15:18:00 -07:00
systm.h Public Release Prep 2010-05-17 15:18:00 -07:00
t_lock.h Public Release Prep 2010-05-17 15:18:00 -07:00
taskq.h Implementation of the TQ_FRONT flag. 2010-07-01 10:59:38 -07:00
thread.h Add Thread Specific Data (TSD) Implementation 2010-12-07 10:02:32 -08:00
time.h Public Release Prep 2010-05-17 15:18:00 -07:00
timer.h Minor cleanup and Solaris API additions. 2010-06-11 15:57:25 -07:00
tsd.h Add Thread Specific Data (TSD) Implementation 2010-12-07 10:02:32 -08:00
types32.h Public Release Prep 2010-05-17 15:18:00 -07:00
types.h Add __divdi3(), remove __udivdi3() kernel dependency 2010-07-13 16:44:02 -07:00
u8_textprep.h Public Release Prep 2010-05-17 15:18:00 -07:00
uio.h Add xuio_* structures and typedefs. 2010-06-11 15:57:25 -07:00
unistd.h Public Release Prep 2010-05-17 15:18:00 -07:00
utsname.h Public Release Prep 2010-05-17 15:18:00 -07:00
va_list.h Public Release Prep 2010-05-17 15:18:00 -07:00
varargs.h Public Release Prep 2010-05-17 15:18:00 -07:00
vfs_opreg.h Public Release Prep 2010-05-17 15:18:00 -07:00
vfs.h Minimal VFS additions 2011-01-27 16:06:04 -08:00
vmsystm.h Public Release Prep 2010-05-17 15:18:00 -07:00
vnode.h Remove VN_HOLD/VN_RELE/VOP_PUTPAGE 2011-01-12 11:38:05 -08:00
zmod.h Public Release Prep 2010-05-17 15:18:00 -07:00
zone.h Public Release Prep 2010-05-17 15:18:00 -07:00