mirror_zfs/include/os/freebsd/spl/sys
Matthew Macy 8056a75672
Disambiguate condvar API contract
On Illumos callers of cv_timedwait and cv_timedwait_hires
can't distinguish between whether or not the cv was signaled
or the call timed out. Illumos handles this (for some definition
of handles) by calling cv_signal in the return path if we were
signaled but the return value indicates instead that we timed
out. This would make sense if it were possible to query the the
cv for its net signal disposition. However, this isn't possible
and, in spite of the fact that there are places in the code that
clearly take a different and incompatible path if a timeout value
is indicated, this distinction appears to be rather subtle to most
developers. This problem is further compounded by the fact that on
Linux, calling cv_signal in the return path wouldn't even do the
right thing unless there are other waiters.

Since it is possible for the caller to independently determine how
much time is remaining but it is not possible to query if the cv
was in fact signaled, prioritizing signalling over timeout seems
like a cleaner solution. In addition, judging from usage patterns
within the code itself, it is also less error prone.

Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10471
2020-06-18 10:17:50 -07:00
..
acl_impl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
acl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
atomic.h Update FreeBSD SPL atomics 2020-05-04 15:07:04 -07:00
byteorder.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
callb.h Fix typos 2020-06-09 21:24:09 -07:00
ccompile.h Improve compatibility with C++ consumers 2020-06-06 12:54:04 -07:00
cmn_err.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
condvar.h Disambiguate condvar API contract 2020-06-18 10:17:50 -07:00
console.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
cred.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
ctype.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
debug.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
dirent.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
disp.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
dkio.h Remove unnecessary references to slavery 2020-06-10 17:07:59 -07:00
endian.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
extdirent.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
file.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
freebsd_rwlock.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
inttypes.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
isa_defs.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
kmem_cache.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
kmem.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
kstat.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
list_impl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
list.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
lock.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
Makefile.am Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
misc.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
mod_os.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
mode.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
mount.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
mutex.h FreeBSD: Don't require zeroing new locks before init 2020-06-13 10:58:10 -07:00
param.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
policy.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
proc.h Upstream: add missing thread_exit() 2020-05-14 15:58:09 -07:00
processor.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
procfs_list.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
random.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
rwlock.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sdt.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sid.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sig.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
simd_x86.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
simd.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
spl_condvar.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
string.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
strings.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sunddi.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sysmacros.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
systeminfo.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
systm.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
taskq.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
thread.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
time.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
timer.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
trace_zfs.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
trace.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
types32.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
types.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
uio.h Add convenience wrappers for common uio usage 2020-06-14 10:09:55 -07:00
uuid.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
vfs.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
vm.h Use new FreeBSD API to largely eliminate object locking 2020-04-17 09:30:26 -07:00
vmsystm.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
vnode_impl.h Fix typos 2020-06-09 21:24:09 -07:00
vnode.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
zmod.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
zone.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00