JIT: scalable profile counter mode (#84427)
authorAndy Ayers <andya@microsoft.com>
Sun, 9 Apr 2023 21:22:58 +0000 (14:22 -0700)
committerGitHub <noreply@github.com>
Sun, 9 Apr 2023 21:22:58 +0000 (14:22 -0700)
commite641efb93d6fb6e82bc1aa01e3867ac06572ab93
treeba4f9dfd8a4ae4c02f5966b2efca64d18ef0e7ab
parent2d062c00e367024040991ed1f45c36868357f463
JIT: scalable profile counter mode (#84427)

Add an config option to use a "scalable" profile helper for edge counters,
where we try and avoid contention by probablistic updates once the counter
value exceeds some threshold (currently 8192). Using the current xorshift
RNG this gives the counter a two-sigma accuracy of around +/- 2%.

The idea is loosely based on "Scalable Statistics Counters" by Dice, Lev,
and Moir (SPAA’13).

Also allow the scalable and interlocked profile modes to operate at the same
time, recording two sets of counts per probe, so we can verify that this new mode
is sufficiently accurate.
13 files changed:
docs/design/features/ScalableApproximateCounting.md [new file with mode: 0644]
docs/design/features/counter-accuracy-detail.png [new file with mode: 0644]
docs/design/features/counter-accuracy-tunable.png [new file with mode: 0644]
docs/design/features/counter-accuracy.png [new file with mode: 0644]
docs/design/features/counter-scaling-detail.png [new file with mode: 0644]
docs/design/features/counter-scaling.png [new file with mode: 0644]
src/coreclr/inc/corinfo.h
src/coreclr/inc/jiteeversionguid.h
src/coreclr/inc/jithelpers.h
src/coreclr/jit/fgprofile.cpp
src/coreclr/jit/jitconfigvalues.h
src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs
src/coreclr/vm/jithelpers.cpp