8317661: [REDO] store/load order not preserved when handling memory pool due to weakly ordered memory architecture of aarch64

Reviewed-by: dholmes, aph
This commit is contained in:
Damon Fenacci 2023-10-27 12:56:03 +00:00
parent 141dae8b76
commit ddd071617e
2 changed files with 3 additions and 0 deletions

View File

@ -573,6 +573,8 @@ CodeBlob* CodeCache::allocate(int size, CodeBlobType code_blob_type, bool handle
CompileBroker::handle_full_code_cache(orig_code_blob_type);
}
return nullptr;
} else {
OrderAccess::release(); // ensure heap expansion is visible to an asynchronous observer (e.g. CodeHeapPool::get_memory_usage())
}
if (PrintCodeCacheExtension) {
ResourceMark rm;

View File

@ -179,6 +179,7 @@ CodeHeapPool::CodeHeapPool(CodeHeap* codeHeap, const char* name, bool support_us
MemoryUsage CodeHeapPool::get_memory_usage() {
size_t used = used_in_bytes();
OrderAccess::acquire(); // ensure possible cache expansion in CodeCache::allocate is seen
size_t committed = _codeHeap->capacity();
size_t maxSize = (available_for_allocation() ? max_size() : 0);