mirror_zfs/include/os/freebsd/spl/sys
Alexander Motin f3969ea78b Optimize small random numbers generation
In all places except two spa_get_random() is used for small values,
and the consumers do not require well seeded high quality values.
Switch those two exceptions directly to random_get_pseudo_bytes()
and optimize spa_get_random(), renaming it to random_in_range(),
since it is not related to SPA or ZFS in general.

On FreeBSD directly map random_in_range() to new prng32_bounded() KPI
added in FreeBSD 13.  On Linux and in user-space just reduce the type
used to uint32_t to avoid more expensive 64bit division.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12183
2021-09-14 12:10:17 -07:00
..
acl_impl.h
acl.h
atomic.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
byteorder.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
callb.h
ccompat.h
ccompile.h FreeBSD: fix HEAD build, conditionally remove FDSYNC defines 2021-01-23 15:39:55 -08:00
cmn_err.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
condvar.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
cred.h
ctype.h
debug.h Microoptimizations for VERIFY() and friends 2021-03-11 17:16:09 -08:00
dirent.h
disp.h
dkio.h
extdirent.h
fcntl.h FreeBSD: fix HEAD build, conditionally remove FDSYNC defines 2021-01-23 15:39:55 -08:00
file.h
freebsd_rwlock.h
idmap.h
inttypes.h
isa_defs.h
kidmap.h
kmem_cache.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
kmem.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
kstat.h Remove pool io kstats 2021-06-10 10:50:16 -07:00
list_impl.h
list.h
lock.h
Makefile.am Introduce write-mostly sums 2021-06-09 13:05:34 -07:00
misc.h Consolidate zfs_holey and zfs_access 2020-10-31 09:40:08 -07:00
mod_os.h FreeBSD: Implement sysctl for fletcher4 impl 2020-12-11 10:29:01 -08:00
mode.h
mount.h
mutex.h
param.h
policy.h Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD 2020-10-21 14:08:06 -07:00
proc.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
processor.h
procfs_list.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
random.h Optimize small random numbers generation 2021-09-14 12:10:17 -07:00
rwlock.h
sdt.h
sid.h
sig.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
simd_x86.h
simd.h
spl_condvar.h
string.h
strings.h
sunddi.h Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
sysmacros.h Introduce CPU_SEQID_UNSTABLE 2020-11-02 11:51:12 -08:00
systeminfo.h
systm.h
taskq.h FreeBSD: make adjustments for the standalone environment 2020-10-13 21:05:49 -07:00
thread.h
time.h
timer.h
trace_zfs.h
trace.h
types32.h
types.h FreeBSD: minor_t needs to be signed so that -1 is recognized as such 2021-01-07 10:41:27 -08:00
uio.h Cleaning up uio headers 2021-02-20 20:16:50 -08:00
uuid.h
vfs.h
vm.h
vmsystm.h
vnode_impl.h Fix various typos 2021-04-07 13:27:11 -07:00
vnode.h FreeBSD: Prune some unneeded definitions 2021-05-10 12:09:34 -07:00
wmsum.h Introduce write-mostly sums 2021-06-09 13:05:34 -07:00
zmod.h
zone.h