Skip to content

Commit ddd0716

Browse files
committed
8317661: [REDO] store/load order not preserved when handling memory pool due to weakly ordered memory architecture of aarch64
Reviewed-by: dholmes, aph
1 parent 141dae8 commit ddd0716

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/hotspot/share/code/codeCache.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ CodeBlob* CodeCache::allocate(int size, CodeBlobType code_blob_type, bool handle
573573
CompileBroker::handle_full_code_cache(orig_code_blob_type);
574574
}
575575
return nullptr;
576+
} else {
577+
OrderAccess::release(); // ensure heap expansion is visible to an asynchronous observer (e.g. CodeHeapPool::get_memory_usage())
576578
}
577579
if (PrintCodeCacheExtension) {
578580
ResourceMark rm;

src/hotspot/share/services/memoryPool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ CodeHeapPool::CodeHeapPool(CodeHeap* codeHeap, const char* name, bool support_us
179179

180180
MemoryUsage CodeHeapPool::get_memory_usage() {
181181
size_t used = used_in_bytes();
182+
OrderAccess::acquire(); // ensure possible cache expansion in CodeCache::allocate is seen
182183
size_t committed = _codeHeap->capacity();
183184
size_t maxSize = (available_for_allocation() ? max_size() : 0);
184185

0 commit comments

Comments
 (0)