diff options
| author | Yury Norov [NVIDIA] <[email protected]> | 2025-06-19 18:26:25 +0000 |
|---|---|---|
| committer | Yury Norov <[email protected]> | 2025-07-31 15:27:48 +0000 |
| commit | 8557c8628cf3cf8ebd3b32601ccdde550bbf6c54 (patch) | |
| tree | d93dcf9819b8999760aec589411511e82a5732cf /drivers/fpga/microchip-spi.c | |
| parent | cpumask: introduce cpumask_random() (diff) | |
| download | kernel-8557c8628cf3cf8ebd3b32601ccdde550bbf6c54.tar.gz kernel-8557c8628cf3cf8ebd3b32601ccdde550bbf6c54.zip | |
clocksource: Improve randomness in clocksource_verify_choose_cpus()
The current algorithm of picking a random CPU works OK for dense online
cpumask, but if cpumask is non-dense, the distribution of picked CPUs
is skewed.
For example, on 8-CPU board with CPUs 4-7 offlined, the probability of
selecting CPU 0 is 5/8. Accordingly, cpus 1, 2 and 3 are chosen with
probability 1/8 each. The proper algorithm should pick each online CPU
with probability 1/4.
Switch it to cpumask_random(), which has better statistical
characteristics.
CC: Andrew Morton <[email protected]>
Acked-by: John Stultz <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Signed-off-by: "Yury Norov [NVIDIA]" <[email protected]>
Diffstat (limited to 'drivers/fpga/microchip-spi.c')
0 files changed, 0 insertions, 0 deletions
