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:29 +00:00
2019-10-29 17:28:25 +00:00
2020-04-15 20:21:30 +00:00
2020-02-26 14:26:36 +00:00
2020-04-16 21:53:17 +00:00
2018-11-29 21:00:56 +00:00
2020-07-22 23:35:41 +00:00
2020-07-06 16:34:49 +00:00
2020-02-26 14:26:36 +00:00
2020-01-30 20:05:05 +00:00
2020-07-25 15:19:38 +00:00
2018-09-06 02:10:59 +00:00
2020-08-12 00:32:31 +00:00
2020-02-26 14:26:36 +00:00
2018-11-26 20:56:05 +00:00
2020-04-29 14:14:15 +00:00
2020-07-06 16:34:09 +00:00
2020-01-03 22:29:58 +00:00
2020-07-25 15:34:29 +00:00
2020-07-28 10:58:37 +00:00
2020-06-25 20:17:34 +00:00
2020-02-26 14:26:36 +00:00
2020-04-21 03:57:30 +00:00
2020-07-15 10:24:04 +00:00
2020-05-25 12:41:44 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-07-15 10:24:04 +00:00
2020-01-30 20:05:05 +00:00
2020-07-25 15:19:38 +00:00
2020-07-19 15:16:27 +00:00
2020-02-26 14:26:36 +00:00
2020-07-25 07:14:33 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-06-01 03:37:58 +00:00
2020-07-24 17:28:24 +00:00
2020-07-05 23:07:54 +00:00
2019-08-21 23:43:58 +00:00
2018-12-07 16:11:45 +00:00
2020-08-04 13:58:36 +00:00
2020-08-05 11:39:09 +00:00
2020-05-15 13:53:10 +00:00
2020-01-30 20:05:05 +00:00
2020-08-04 23:00:00 +00:00
2020-02-26 14:26:36 +00:00
2019-01-15 01:02:16 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-07-30 22:14:04 +00:00
2020-08-11 14:27:57 +00:00
2020-05-01 14:30:59 +00:00
2020-08-01 16:02:32 +00:00
2020-02-26 14:26:36 +00:00
2019-09-15 02:59:53 +00:00
2020-02-15 18:48:38 +00:00
2020-01-30 20:05:05 +00:00
2020-08-04 20:31:03 +00:00
2020-07-23 17:26:53 +00:00
2020-06-06 00:02:50 +00:00
2019-12-02 22:38:25 +00:00
2020-06-25 20:17:34 +00:00
2020-05-29 07:44:02 +00:00
2020-02-26 14:26:36 +00:00
2020-07-23 17:26:53 +00:00
2020-04-21 17:13:06 +00:00
2019-12-11 15:52:29 +00:00
2020-04-16 17:24:13 +00:00
2020-06-10 22:30:32 +00:00
2020-02-26 14:26:36 +00:00
2020-08-01 16:02:32 +00:00
2020-04-14 20:53:12 +00:00
2020-03-16 22:25:25 +00:00
2020-01-30 20:05:05 +00:00
2020-03-02 15:30:52 +00:00
2020-04-15 18:39:12 +00:00
2018-12-04 16:48:47 +00:00
2020-01-30 20:05:05 +00:00
2020-07-05 14:38:22 +00:00
2019-06-25 16:39:25 +00:00
2020-02-12 19:06:34 +00:00
2020-07-28 01:05:40 +00:00
2020-02-26 14:26:36 +00:00
2020-03-02 15:30:52 +00:00
2020-03-02 15:30:52 +00:00
2019-05-13 23:37:44 +00:00
2020-08-05 09:27:03 +00:00
2020-08-05 09:27:03 +00:00
2020-01-03 18:29:20 +00:00
2020-07-25 18:29:10 +00:00
2019-04-18 22:52:12 +00:00
2020-01-30 20:05:05 +00:00
2020-05-25 22:12:04 +00:00
2020-08-07 18:21:48 +00:00
2018-10-30 18:26:34 +00:00
2020-03-26 15:02:37 +00:00
2020-01-30 20:05:05 +00:00
2020-02-20 23:53:48 +00:00
2020-03-06 19:09:01 +00:00
2020-02-14 23:18:03 +00:00
2020-07-04 06:22:05 +00:00
2019-12-20 03:40:53 +00:00
2020-02-26 14:26:36 +00:00
2019-03-12 05:10:41 +00:00
2018-10-12 00:32:45 +00:00
2020-08-07 15:32:42 +00:00
2019-05-21 20:38:48 +00:00
2020-01-30 20:05:05 +00:00
2020-01-30 20:05:05 +00:00
2020-06-29 21:35:50 +00:00
2020-03-30 14:24:03 +00:00
2020-01-30 20:05:05 +00:00
2020-07-21 22:47:02 +00:00
2020-02-26 14:26:36 +00:00
2020-03-02 15:30:52 +00:00
2020-02-26 14:26:36 +00:00
2018-07-19 20:00:28 +00:00
2018-08-09 17:42:27 +00:00
2020-02-26 14:26:36 +00:00
2020-03-06 19:09:01 +00:00
2020-07-24 17:32:10 +00:00
2020-04-19 00:12:30 +00:00
2019-05-20 00:38:23 +00:00
2020-05-09 15:56:02 +00:00
2020-08-13 20:48:14 +00:00
2020-02-26 14:26:36 +00:00
2019-02-20 09:38:19 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-01-30 20:05:05 +00:00
2019-08-16 19:46:22 +00:00
2020-05-03 00:37:16 +00:00
2020-02-26 14:26:36 +00:00
2020-08-03 17:17:17 +00:00
2020-03-06 19:10:00 +00:00
2020-07-06 16:33:28 +00:00
2020-02-26 14:26:36 +00:00
2020-04-01 19:22:09 +00:00
2020-02-11 18:48:07 +00:00
2020-06-02 01:21:48 +00:00
2020-04-01 19:22:09 +00:00
2020-04-02 20:47:51 +00:00
2020-05-20 20:58:17 +00:00
2020-01-30 20:05:05 +00:00
2020-02-19 08:17:27 +00:00
2020-06-24 18:51:01 +00:00
2020-03-19 15:39:45 +00:00
2020-07-15 10:24:39 +00:00
2020-01-12 23:52:16 +00:00
2020-08-05 19:15:59 +00:00
2019-11-25 18:33:21 +00:00
2020-06-09 16:43:23 +00:00
2020-03-20 20:09:00 +00:00
2020-05-28 21:23:02 +00:00
2020-05-28 21:06:10 +00:00
2020-05-28 21:23:02 +00:00
2019-05-04 19:05:30 +00:00
2020-07-09 17:26:49 +00:00
2020-07-09 18:34:54 +00:00
2020-04-14 20:30:48 +00:00
2020-07-06 16:34:15 +00:00
2019-11-29 03:56:01 +00:00
2019-05-20 00:38:23 +00:00
2020-04-17 18:34:49 +00:00
2020-08-11 14:27:57 +00:00
2020-02-26 14:26:36 +00:00
2020-01-15 03:34:21 +00:00
2020-07-23 23:48:18 +00:00
2019-11-06 22:40:19 +00:00
2020-08-05 11:39:09 +00:00
2020-08-05 09:27:03 +00:00
2020-08-05 09:27:03 +00:00
2020-08-05 09:27:03 +00:00
2020-07-25 07:15:23 +00:00
2020-07-29 23:24:32 +00:00
2019-08-11 19:16:07 +00:00
2020-08-03 22:13:02 +00:00
2020-07-10 09:01:36 +00:00
2020-02-26 14:26:36 +00:00
2020-08-02 16:34:27 +00:00
2020-08-10 12:28:56 +00:00
2020-07-10 09:01:36 +00:00
2020-08-07 23:06:40 +00:00
2020-07-10 09:01:36 +00:00
2020-05-14 03:01:23 +00:00
2020-08-05 19:34:13 +00:00
2020-07-10 09:01:36 +00:00
2020-08-13 10:24:45 +00:00
2020-07-25 10:31:52 +00:00
2020-07-10 09:01:36 +00:00
2020-08-12 04:53:20 +00:00
2020-08-11 14:27:57 +00:00
2020-08-07 23:06:40 +00:00
2020-08-10 10:34:22 +00:00