Conrad Meyer 8a0edc914f Add prng(9) API
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
2020-08-13 20:48:14 +00:00
..
2020-02-26 16:22:28 +00:00
2020-07-06 16:34:49 +00:00
2020-08-12 00:32:31 +00:00
2020-07-15 10:24:04 +00:00
2020-07-15 10:24:04 +00:00
2020-08-05 11:39:09 +00:00
2020-08-04 23:00:00 +00:00
2020-08-04 20:31:03 +00:00
2020-03-02 15:30:52 +00:00
2020-03-02 15:30:52 +00:00
2020-03-02 15:30:52 +00:00
2020-07-04 06:22:05 +00:00
2019-03-12 05:10:41 +00:00
2018-10-12 00:32:45 +00:00
2020-03-02 15:30:52 +00:00
2020-05-09 15:56:02 +00:00
2020-08-13 20:48:14 +00:00
2019-02-20 09:38:19 +00:00
2020-06-24 18:51:01 +00:00
2020-01-12 23:52:16 +00:00
2020-08-05 19:15:59 +00:00
2020-03-20 20:09:00 +00:00
2020-08-11 14:27:57 +00:00
2020-08-05 11:39:09 +00:00
2020-08-10 12:28:56 +00:00
2020-08-07 23:06:40 +00:00
2020-08-12 04:53:20 +00:00
2020-08-07 23:06:40 +00:00