Page MenuHomeFreeBSD

Depessimize arc4rand

Authored by mjg on May 12 2019, 1:52 AM.



The function starts with atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, ARC4_ENTR_SEED), which at least on x86 always dirties the cacheline. I.e. there is perfectly avoidable line bouncing. While here do minor cleanups.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mjg created this revision.May 12 2019, 1:52 AM
cem added a reviewer: markm.May 12 2019, 2:24 AM
cem accepted this revision.
This revision is now accepted and ready to land.May 12 2019, 2:24 AM
delphij accepted this revision.May 12 2019, 4:09 AM
delphij added a subscriber: delphij.

Looks reasonable to me.

This revision was automatically updated to reflect the committed changes.