Fix correct accumulated time for parallelized jobs in SGEN. (mono/mono#17518)
authorJohan Lorensson <lateralusx.github@gmail.com>
Tue, 5 Nov 2019 06:57:06 +0000 (07:57 +0100)
committerZoltan Varga <vargaz@gmail.com>
Tue, 5 Nov 2019 06:57:06 +0000 (01:57 -0500)
commitdc46b0766ae34ca86789e8cb924df815832719e8
treecb0b170b21e1021ad003934bdf9dec689c993392
parent1aa4939c24787916463c1ae8d76bf144e3d54208
Fix correct accumulated time for parallelized jobs in SGEN. (mono/mono#17518)

* Fix correct accumulated time for parallelized jobs in SGEN.

Current implementation incorrectly accumulate time for scan jobs for
the follow metrics when running parallel minor GC:

time_minor_scan_major_blocks,
time_minor_scan_los,
time_major_scan_mod_union_blocks,
time_major_scan_mod_union_los

Commit fix so updates are atomic making sure values are correct in cases
where parallel minor GC is used.

* Implement 64-bit atommic add fallback in SGEN.

Commit migrated from https://github.com/mono/mono/commit/44e6226c31d8ffcae58f81350d71a728edecfe22
src/mono/mono/sgen/sgen-gc.c
src/mono/mono/sgen/sgen-gc.h
src/mono/mono/utils/atomic.c
src/mono/mono/utils/atomic.h