]> git.ipfire.org Git - thirdparty/glibc.git/commit
sysdeps: Add 'get_fast_jitter' interace in fast-jitter.h
authorNoah Goldstein <goldstein.w.n@gmail.com>
Wed, 27 Apr 2022 20:13:02 +0000 (15:13 -0500)
committerSunil K Pandey <skpgkp2@gmail.com>
Wed, 28 Sep 2022 14:29:24 +0000 (07:29 -0700)
commit4f3c6dcd2048dcf2fb0143819e51135985effda1
tree99881de83aa38bcf785c817cb6b25d11febf58e3
parenta7d53833280541daa93fedb13c19aa6f1bf49f99
sysdeps: Add 'get_fast_jitter' interace in fast-jitter.h

'get_fast_jitter' is meant to be used purely for performance
purposes. In all cases it's used it should be acceptable to get no
randomness (see default case). An example use case is in setting
jitter for retries between threads at a lock. There is a
performance benefit to having jitter, but only if the jitter can
be generated very quickly and ultimately there is no serious issue
if no jitter is generated.

The implementation generally uses 'HP_TIMING_NOW' iff it is
inlined (avoid any potential syscall paths).
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 911c63a51c690dd1a97dfc587097277029baf00f)
sysdeps/generic/fast-jitter.h [new file with mode: 0644]