Skip to content

Commit 2ca136a

Browse files
Ben Taylorshipilev
Ben Taylor
authored andcommittedAug 12, 2024
8337815: Relax G1EvacStats atomic operations
Reviewed-by: kbarrett, tschatzl, shade
1 parent 99edb4a commit 2ca136a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎src/hotspot/share/gc/g1/g1EvacStats.inline.hpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@
3030
#include "runtime/atomic.hpp"
3131

3232
inline void G1EvacStats::add_direct_allocated(size_t value) {
33-
Atomic::add(&_direct_allocated, value);
33+
Atomic::add(&_direct_allocated, value, memory_order_relaxed);
3434
}
3535

3636
inline void G1EvacStats::add_num_plab_filled(size_t value) {
37-
Atomic::add(&_num_plab_filled, value);
37+
Atomic::add(&_num_plab_filled, value, memory_order_relaxed);
3838
}
3939

4040
inline void G1EvacStats::add_num_direct_allocated(size_t value) {
41-
Atomic::add(&_num_direct_allocated, value);
41+
Atomic::add(&_num_direct_allocated, value, memory_order_relaxed);
4242
}
4343

4444
inline void G1EvacStats::add_region_end_waste(size_t value) {
45-
Atomic::add(&_region_end_waste, value);
46-
Atomic::inc(&_regions_filled);
45+
Atomic::add(&_region_end_waste, value, memory_order_relaxed);
46+
Atomic::inc(&_regions_filled, memory_order_relaxed);
4747
}
4848

4949
inline void G1EvacStats::add_failure_used_and_waste(size_t used, size_t waste) {
50-
Atomic::add(&_failure_used, used);
51-
Atomic::add(&_failure_waste, waste);
50+
Atomic::add(&_failure_used, used, memory_order_relaxed);
51+
Atomic::add(&_failure_waste, waste, memory_order_relaxed);
5252
}
5353

5454
#endif // SHARE_GC_G1_G1EVACSTATS_INLINE_HPP

0 commit comments

Comments
 (0)
Please sign in to comment.