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)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Wed, 27 Apr 2022 22:17:43 +0000 (17:17 -0500)
commit911c63a51c690dd1a97dfc587097277029baf00f
tree3cfe8539d127dce90996abb50704a2eb3d2b3348
parent7c477b57a31487eda516db02b9e04f22d1a6e6af
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>
sysdeps/generic/fast-jitter.h [new file with mode: 0644]