zfs/include/os/freebsd/spl/sys
Thomas Bertschinger f9a9aea126 Add mutex_enter_interruptible() for interruptible sleeping IOCTLs
Many long-running ZFS ioctls lock the spa_namespace_lock, forcing
concurrent ioctls to sleep for the mutex. Previously, the only
option is to call mutex_enter() which sleeps uninterruptibly. This
is a usability issue for sysadmins, for example, if the admin runs
`zpool status` while a slow `zpool import` is ongoing, the admin's
shell will be locked in uninterruptible sleep for a long time.

This patch resolves this admin usability issue by introducing
mutex_enter_interruptible() which sleeps interruptibly while waiting
to acquire a lock. It is implemented for both Linux and FreeBSD.

The ZFS_IOC_POOL_CONFIGS ioctl, used by `zpool status`, is changed to
use this new macro so that the command can be interrupted if it is
issued during a concurrent `zpool import` (or other long-running
operation).

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Thomas Bertschinger <bertschinger@lanl.gov>
Closes #15360
2023-11-06 16:47:41 -08:00
..
ia32 Use .section .rodata instead of .rodata on FreeBSD 2023-02-24 16:45:48 -08:00
acl.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
acl_impl.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
atomic.h
byteorder.h Reduce false positives from Static Analyzers 2022-09-30 15:30:12 -07:00
callb.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
ccompat.h FreeBSD: Reduce divergence from in-tree sources 2023-10-10 19:19:09 -07:00
ccompile.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
cmn_err.h spl: cmn_err_once() should be usable in brace-less if else statements 2023-03-15 11:13:25 -07:00
condvar.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
cred.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
ctype.h
debug.h debug: fix output from VERIFY0 assertion 2022-10-28 11:46:44 -07:00
dirent.h
disp.h
dkio.h
fcntl.h FreeBSD: fix HEAD build, conditionally remove FDSYNC defines 2021-01-23 15:39:55 -08:00
file.h Rename refcount.h to zfs_refcount.h 2020-07-29 16:35:33 -07:00
freebsd_rwlock.h
idmap.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
inttypes.h
isa_defs.h freebsd: simplify MD isa_defs.h 2022-11-07 15:55:37 -08:00
kmem.h
kmem_cache.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
kstat.h
list.h
list_impl.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
lock.h
misc.h Remove hw_serial, ddi_strtoul() 2022-05-13 10:15:31 -07:00
mod_os.h
mode.h
mount.h freebsd: changes necessary to coexist with dtrace in tree 2020-07-01 09:10:08 -07:00
mutex.h Add mutex_enter_interruptible() for interruptible sleeping IOCTLs 2023-11-06 16:47:41 -08:00
param.h Refactor ccompile.h to not include system headers 2020-07-25 20:09:50 -07:00
policy.h
proc.h
processor.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
procfs_list.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
random.h FreeBSD: fix compilation of FreeBSD world after 29274c9f6 2021-06-25 10:28:51 -07:00
rwlock.h
sdt.h
sid.h
sig.h
simd.h
simd_aarch64.h
simd_arm.h Miscellaneous FreBSD compilation bugfixes 2023-04-06 10:35:02 -07:00
simd_powerpc.h
simd_x86.h Miscellaneous FreBSD compilation bugfixes 2023-04-06 10:35:02 -07:00
spl_condvar.h
string.h
sunddi.h
sysmacros.h freebsd: simplify MD isa_defs.h 2022-11-07 15:55:37 -08:00
systeminfo.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
systm.h Refactor ccompile.h to not include system headers 2020-07-25 20:09:50 -07:00
taskq.h FreeBSD: Improve taskq wrapper 2023-11-06 16:33:18 -08:00
thread.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
time.h
timer.h Cleanup: Use OpenSolaris functions to call scheduler 2022-09-12 09:55:37 -07:00
trace.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
types.h
types32.h
uio.h
uuid.h
vfs.h
vm.h Use new FreeBSD API to largely eliminate object locking 2020-04-17 09:30:26 -07:00
vmsystm.h
vnode.h FreeBSD: catch up to __FreeBSD_version 1400093 2023-07-20 08:58:29 -07:00
vnode_impl.h FreeBSD: Cleanup zfs_readdir() 2022-09-20 14:50:16 -07:00
wmsum.h Introduce write-mostly sums 2021-05-27 14:27:29 -06:00
zmod.h
zone.h