8261501: Shenandoah: reconsider heap statistics memory ordering
Reviewed-by: rkennke
This commit is contained in:
parent
3cbd16de3d
commit
3f8819c666
@ -620,12 +620,11 @@ void ShenandoahHeap::post_initialize() {
|
||||
}
|
||||
|
||||
size_t ShenandoahHeap::used() const {
|
||||
return Atomic::load_acquire(&_used);
|
||||
return Atomic::load(&_used);
|
||||
}
|
||||
|
||||
size_t ShenandoahHeap::committed() const {
|
||||
OrderAccess::acquire();
|
||||
return _committed;
|
||||
return Atomic::load(&_committed);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::increase_committed(size_t bytes) {
|
||||
@ -639,20 +638,20 @@ void ShenandoahHeap::decrease_committed(size_t bytes) {
|
||||
}
|
||||
|
||||
void ShenandoahHeap::increase_used(size_t bytes) {
|
||||
Atomic::add(&_used, bytes);
|
||||
Atomic::add(&_used, bytes, memory_order_relaxed);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::set_used(size_t bytes) {
|
||||
Atomic::release_store_fence(&_used, bytes);
|
||||
Atomic::store(&_used, bytes);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::decrease_used(size_t bytes) {
|
||||
assert(used() >= bytes, "never decrease heap size by more than we've left");
|
||||
Atomic::sub(&_used, bytes);
|
||||
Atomic::sub(&_used, bytes, memory_order_relaxed);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::increase_allocated(size_t bytes) {
|
||||
Atomic::add(&_bytes_allocated_since_gc_start, bytes);
|
||||
Atomic::add(&_bytes_allocated_since_gc_start, bytes, memory_order_relaxed);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::notify_mutator_alloc_words(size_t words, bool waste) {
|
||||
@ -1883,11 +1882,11 @@ address ShenandoahHeap::gc_state_addr() {
|
||||
}
|
||||
|
||||
size_t ShenandoahHeap::bytes_allocated_since_gc_start() {
|
||||
return Atomic::load_acquire(&_bytes_allocated_since_gc_start);
|
||||
return Atomic::load(&_bytes_allocated_since_gc_start);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::reset_bytes_allocated_since_gc_start() {
|
||||
Atomic::release_store_fence(&_bytes_allocated_since_gc_start, (size_t)0);
|
||||
Atomic::store(&_bytes_allocated_since_gc_start, (size_t)0);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::set_degenerated_gc_in_progress(bool in_progress) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user