Skip to content

Commit

Permalink
8317661: [REDO] store/load order not preserved when handling memory p…
Browse files Browse the repository at this point in the history
…ool due to weakly ordered memory architecture of aarch64

Reviewed-by: dholmes, aph
  • Loading branch information
Damon Fenacci committed Oct 27, 2023
1 parent 141dae8 commit ddd0716
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/share/code/codeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/services/memoryPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

1 comment on commit ddd0716

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.