HomeFreeBSD

random(4): depessimize arc4random

Description

random(4): depessimize arc4random

  • __predict_false reseeding on entry as it is almost never true.
  • don't blindly atomic_cmpset as on x86 it ends up dirtying the cacheline.

it almost ever succeeds per above

  • fetch the timestamp prior to getting the cpu number

Reviewed by: cem
Approved by: secteam (delphij)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20242

Details

Provenance
mjgAuthored on May 12 2019, 6:32 AM
Parents
rG3e08dc749ca0: Factor code into two new functions in preparation for a future commit.
Branches
Unknown
Tags
Unknown

Event Timeline