mirror_zfs/include
Alexander Motin 29274c9f6d
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-06-22 17:35:23 -06:00
..
os Optimize small random numbers generation 2021-06-22 17:35:23 -06:00
sys Optimize small random numbers generation 2021-06-22 17:35:23 -06:00
.gitignore OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
cityhash.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
libnvpair.h lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 2021-06-09 17:04:32 -07:00
libuutil_common.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libuutil_impl.h libuutil: purge unused functions 2021-04-12 09:32:43 -07:00
libuutil.h libuutil: purge unused functions 2021-04-12 09:32:43 -07:00
libzfs_core.h lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 2021-06-09 17:04:32 -07:00
libzfs.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
libzfsbootenv.h lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 2021-06-09 17:04:32 -07:00
libzutil.h libzutil: add zfs_{base,dir}name() 2021-06-11 09:10:05 -07:00
Makefile.am libzfs: don't distribute libzfs_impl.h 2021-06-03 13:17:35 -07:00
thread_pool.h lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 2021-06-09 17:04:32 -07:00
zfeature_common.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
zfs_comutil.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
zfs_deleg.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
zfs_fletcher.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
zfs_namecheck.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
zfs_prop.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00