mirror_zfs/module/os/linux/spl
Richard Yao a06df8d7c1
Linux: Upgrade random_get_pseudo_bytes() to xoshiro256++ 1.0
The motivation for upgrading our PRNG is the recent buildbot failures in
the ZTS' tests/functional/fault/decompress_fault test. The probability
of a failure in that test is 0.8^256, which is ~1.6e-25 out of 1, yet we
have observed multiple test failures in it. This suggests a problem with
our random number generation.

The xorshift128+ generator that we were using has been replaced by newer
generators that have "better statistical properties". After doing some
reading, it turns out that these generators have "low linear complexity
of the lowest bits", which could explain the ZTS test failures.

We do two things to try to fix this:

	1. We upgrade from xorshift128+ to xoshiro256++ 1.0.

	2. We tweak random_get_pseudo_bytes() to copy the higher order
	   bytes first.

It is hoped that this will fix the test failures in
tests/functional/fault/decompress_fault, although I have not done
simulations. I am skeptical that any simulations I do on a PRNG with a
period of 2^256 - 1 would be meaningful.

Since we have raised the minimum kernel version to 3.10 since this was
first implemented, we have the option of using the Linux kernel's
get_random_int(). However, I am not currently prepared to do performance
tests to ensure that this would not be a regression (for the time
being), so we opt for upgrading our PRNG to a newer one from Sebastiano
Vigna.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13983
2022-10-20 14:14:42 -07:00
..
README.md Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-atomic.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-condvar.c Fix declarations of non-global variables 2022-10-18 11:05:32 -07:00
spl-cred.c Fix ACL checks for NFS kernel server 2022-03-18 06:47:57 -06:00
spl-err.c Fix declarations of non-global variables 2022-10-18 11:05:32 -07:00
spl-generic.c Linux: Upgrade random_get_pseudo_bytes() to xoshiro256++ 1.0 2022-10-20 14:14:42 -07:00
spl-kmem-cache.c Fix declarations of non-global variables 2022-10-18 11:05:32 -07:00
spl-kmem.c Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
spl-kstat.c Cleanup: Switch to strlcpy from strncpy 2022-09-27 16:35:29 -07:00
spl-proc.c Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
spl-procfs-list.c Linux 6.1 compat: change order of sys/mutex.h includes 2022-10-18 12:29:44 -07:00
spl-taskq.c Cleanup: Specify unsignedness on things that should not be signed 2022-09-27 16:42:41 -07:00
spl-thread.c Cleanup: Switch to strlcpy from strncpy 2022-09-27 16:35:29 -07:00
spl-trace.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
spl-tsd.c Linux SPL module init: Handle memory allocation failures correctly 2022-09-08 10:28:20 -07:00
spl-vmem.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-xdr.c module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
spl-zlib.c Linux SPL module init: Handle memory allocation failures correctly 2022-09-08 10:28:20 -07:00
spl-zone.c Linux 6.1 compat: change order of sys/mutex.h includes 2022-10-18 12:29:44 -07:00
THIRDPARTYLICENSE.gplv2 OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
THIRDPARTYLICENSE.gplv2.descrip OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00

The Solaris Porting Layer, SPL, is a Linux kernel module which provides a compatibility layer used by the OpenZFS project.

Installation

The latest version of the SPL is maintained as part of this repository. Only when building ZFS version 0.7.x or earlier must an external SPL release be used. These releases can be found at:

Release

The SPL is released under a GPLv2 license.
For more details see the NOTICE and THIRDPARTYLICENSE files; UCRL-CODE-235197