8a0edc914f
Add prng(9) as a replacement for random(9) in the kernel. There are two major differences from random(9) and random(3): - General prng(9) APIs (prng32(9), etc) do not guarantee an implementation or particular sequence; they should not be used for repeatable simulations. - However, specific named API families are also exposed (for now: PCG), and those are expected to be repeatable (when so-guaranteed by the named algorithm). Some minor differences from random(3) and earlier random(9): - PRNG state for the general prng(9) APIs is per-CPU; this eliminates contention on PRNG state in SMP workloads. Each PCPU generator in an SMP system produces a unique sequence. - Better statistical properties than the Park-Miller ("minstd") PRNG (longer period, uniform distribution in all bits, passes BigCrush/PractRand analysis). - Faster than Park-Miller ("minstd") PRNG -- no division is required to step PCG-family PRNGs. For now, random(9) becomes a thin shim around prng32(). Eventually I would like to mechanically switch consumers over to the explicit API. Reviewed by: kib, markj (previous version both) Discussed with: markm Differential Revision: https://reviews.freebsd.org/D25916 |
||
---|---|---|
.. | ||
arm | ||
arm64 | ||
x86 | ||
arc4random_uniform.c | ||
arc4random.c | ||
ashldi3.c | ||
ashrdi3.c | ||
asprintf.c | ||
bcd.c | ||
bcmp.c | ||
bcopy.c | ||
bsearch.c | ||
cmpdi2.c | ||
divdi3.c | ||
explicit_bzero.c | ||
ffs.c | ||
ffsl.c | ||
ffsll.c | ||
fls.c | ||
flsl.c | ||
flsll.c | ||
fnmatch.c | ||
gsb_crc32.c | ||
iconv_converter_if.m | ||
iconv_ucs.c | ||
iconv_xlat16.c | ||
iconv_xlat.c | ||
iconv.c | ||
inet_aton.c | ||
inet_ntoa.c | ||
inet_ntop.c | ||
inet_pton.c | ||
jenkins_hash.c | ||
lshrdi3.c | ||
mcount.c | ||
memcchr.c | ||
memchr.c | ||
memcmp.c | ||
memmem.c | ||
memset.c | ||
moddi3.c | ||
murmur3_32.c | ||
qdivrem.c | ||
qsort_r.c | ||
qsort.c | ||
quad.h | ||
random.c | ||
scanc.c | ||
strcasecmp.c | ||
strcat.c | ||
strchr.c | ||
strchrnul.c | ||
strcmp.c | ||
strcpy.c | ||
strcspn.c | ||
strdup.c | ||
strlcat.c | ||
strlcpy.c | ||
strlen.c | ||
strncat.c | ||
strncmp.c | ||
strncpy.c | ||
strndup.c | ||
strnlen.c | ||
strrchr.c | ||
strsep.c | ||
strspn.c | ||
strstr.c | ||
strtol.c | ||
strtoq.c | ||
strtoul.c | ||
strtouq.c | ||
strvalid.c | ||
timingsafe_bcmp.c | ||
ucmpdi2.c | ||
udivdi3.c | ||
umoddi3.c |