diff options
author | 2020-02-21 14:09:57 -0800 | |
---|---|---|
committer | 2020-02-28 23:01:51 +0000 | |
commit | eedca4a5f72b449df035979f31785dd5eaa46e0e (patch) | |
tree | ca085e49078145359ca0226a17b6a4ce2116c298 /compiler/utils/assembler_test_base.h | |
parent | acb5c2dfabaf8126e20d17a4d02ac183af2afc26 (diff) |
Add more tests, spin before inflating monitors
This adds some additional tests/benchmarks to 2029-contended-monitors.
Modify the monitor inflation logic minimally to try pure spinning
before resorting to sched_yield.
Based on my testing with 2029-contended-monitors, it would be beneficial
to more aggressively avoid lock inflation. But in the end, I couldn't
figure out how to do that effectively without taking more wall clock
time when we actually inflate a lock. That seems like a questionable
trade-off, so this is the low-risk alternative that simply avoids the
clearly dubious choice to immediately spend a microsecond or so on a
sched_yield call whenever the lock is already held.
This is somehat similar to aosp/666639, but we still try everything
we tried before to avoid inflation. (aosp/666639 with a much higher
value of max_spins would probably be similar. I expect CpuRelax()
there doesn't have much impact either way. We could add it here.)
Bug:140590186
Test: experimentation with 2029-contended-monitors.
Change-Id: I58349cc2c45dd6ea16c67c3c3bffb791274eb99e
Diffstat (limited to 'compiler/utils/assembler_test_base.h')
0 files changed, 0 insertions, 0 deletions