Skip to content
Permalink
Browse files
8274004: Change 'nonleaf' rank name
8273956: Add checking for rank values

Reviewed-by: dholmes, pchilanomate
  • Loading branch information
coleenp committed Oct 8, 2021
1 parent b60837a commit 6364719cd1c57220769ea580d958da8dc2fdf7f9
Showing 41 changed files with 335 additions and 347 deletions.
@@ -46,8 +46,7 @@ void OSThread::pd_initialize() {

sigemptyset(&_caller_sigmask);

_startThread_lock = new Monitor(Mutex::event, "startThread_lock",
Monitor::_safepoint_check_never);
_startThread_lock = new Monitor(Mutex::event, "startThread_lock");
assert(_startThread_lock != NULL, "check");
}

@@ -45,8 +45,7 @@ void OSThread::pd_initialize() {

sigemptyset(&_caller_sigmask);

_startThread_lock = new Monitor(Mutex::event, "startThread_lock",
Monitor::_safepoint_check_never);
_startThread_lock = new Monitor(Mutex::event, "startThread_lock");
assert(_startThread_lock !=NULL, "check");
}

@@ -40,8 +40,7 @@ void OSThread::pd_initialize() {

sigemptyset(&_caller_sigmask);

_startThread_lock = new Monitor(Mutex::event, "startThread_lock",
Monitor::_safepoint_check_never);
_startThread_lock = new Monitor(Mutex::event, "startThread_lock");
assert(_startThread_lock !=NULL, "check");
}

@@ -133,8 +133,7 @@ void ClassLoaderData::initialize_name(Handle class_loader) {

ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool has_class_mirror_holder) :
_metaspace(NULL),
_metaspace_lock(new Mutex(Mutex::nosafepoint-2, "MetaspaceAllocation_lock",
Mutex::_safepoint_check_never)),
_metaspace_lock(new Mutex(Mutex::nosafepoint-2, "MetaspaceAllocation_lock")),
_unloading(false), _has_class_mirror_holder(has_class_mirror_holder),
_modified_oops(true),
// A non-strong hidden class loader data doesn't have anything to keep
@@ -104,7 +104,7 @@ class CompileTask : public CHeapObj<mtCompiler> {

public:
CompileTask() : _failure_reason(NULL), _failure_reason_on_C_heap(false) {
_lock = new Monitor(Mutex::nonleaf, "CompileTask_lock", Mutex::_safepoint_check_always);
_lock = new Monitor(Mutex::safepoint, "CompileTask_lock");
}

void initialize(int compile_id, const methodHandle& method, int osr_bci, int comp_level,
@@ -167,7 +167,7 @@ class G1RegionsSmallerThanCommitSizeMapper : public G1RegionToSpaceMapper {
MEMFLAGS type) :
G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, commit_factor, type),
_regions_per_page((page_size * commit_factor) / alloc_granularity),
_lock(Mutex::service-3, "G1Mapper_lock", Mutex::_safepoint_check_never) {
_lock(Mutex::service-3, "G1Mapper_lock") {

guarantee((page_size * commit_factor) >= alloc_granularity, "allocation granularity smaller than commit granularity");
}
@@ -40,9 +40,7 @@ void G1SentinelTask::execute() {

G1ServiceThread::G1ServiceThread() :
ConcurrentGCThread(),
_monitor(Mutex::nosafepoint,
"G1ServiceThread_lock",
Monitor::_safepoint_check_never),
_monitor(Mutex::nosafepoint, "G1ServiceThread_lock"),
_task_queue() {
set_name("G1 Service");
create_and_start();
@@ -233,7 +233,7 @@ HeapRegion::HeapRegion(uint hrm_index,
_top(NULL),
_compaction_top(NULL),
_bot_part(bot, this),
_par_alloc_lock(Mutex::service-2, "HeapRegionParAlloc_lock", Mutex::_safepoint_check_never),
_par_alloc_lock(Mutex::service-2, "HeapRegionParAlloc_lock"),
_pre_dummy_top(NULL),
_rem_set(NULL),
_hrm_index(hrm_index),
@@ -47,7 +47,7 @@ const char* HeapRegionRemSet::_short_state_strings[] = {"UNTRA", "UPDAT", "CMPL

HeapRegionRemSet::HeapRegionRemSet(HeapRegion* hr,
G1CardSetConfiguration* config) :
_m(Mutex::service - 1, FormatBuffer<128>("HeapRegionRemSet#%u_lock", hr->hrm_index()), Monitor::_safepoint_check_never),
_m(Mutex::service - 1, FormatBuffer<128>("HeapRegionRemSet#%u_lock", hr->hrm_index())),
_code_roots(),
_card_set_mm(config, G1CardSetFreePool::free_list_pool()),
_card_set(config, &_card_set_mm),
@@ -92,8 +92,7 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) {

_shadow_region_array = new (ResourceObj::C_HEAP, mtGC) GrowableArray<size_t >(10, mtGC);

_shadow_region_monitor = new Monitor(Mutex::nosafepoint, "CompactionManager_lock",
Monitor::_safepoint_check_never);
_shadow_region_monitor = new Monitor(Mutex::nosafepoint, "CompactionManager_lock");
}

void ParCompactionManager::reset_all_bitmap_query_caches() {
@@ -34,8 +34,7 @@ void GCLogPrecious::initialize() {
_lines = new (ResourceObj::C_HEAP, mtGC) stringStream();
_temp = new (ResourceObj::C_HEAP, mtGC) stringStream();
_lock = new Mutex(Mutex::event, /* The lowest lock rank I could find */
"GCLogPrecious Lock",
Mutex::_safepoint_check_never);
"GCLogPrecious Lock");
}

void GCLogPrecious::vwrite_inner(LogTargetHandle log, const char* format, va_list args) {
@@ -811,10 +811,10 @@ const size_t initial_active_array_size = 8;

static Mutex* make_oopstorage_mutex(const char* storage_name,
const char* kind,
int rank) {
Mutex::Rank rank) {
char name[256];
os::snprintf(name, sizeof(name), "%s %s lock", storage_name, kind);
return new PaddedMutex(rank, name, Mutex::_safepoint_check_never);
return new PaddedMutex(rank, name);
}

void* OopStorage::operator new(size_t size, MEMFLAGS memflags) {
@@ -844,10 +844,6 @@ OopStorage::OopStorage(const char* name, MEMFLAGS memflags) :
"%s: active_mutex must have lower rank than allocation_mutex", _name);
assert(Service_lock->rank() < _active_mutex->rank(),
"%s: active_mutex must have higher rank than Service_lock", _name);
assert(_active_mutex->_safepoint_check_required == Mutex::_safepoint_check_never,
"%s: active mutex requires never safepoint check", _name);
assert(_allocation_mutex->_safepoint_check_required == Mutex::_safepoint_check_never,
"%s: allocation mutex requires never safepoint check", _name);
}

void OopStorage::delete_empty_block(const Block& block) {
@@ -773,8 +773,7 @@ void OffsetTableContigSpace::alloc_block(HeapWord* start, HeapWord* end) {
OffsetTableContigSpace::OffsetTableContigSpace(BlockOffsetSharedArray* sharedOffsetArray,
MemRegion mr) :
_offsets(sharedOffsetArray, mr),
_par_alloc_lock(Mutex::nonleaf, "OffsetTableContigSpaceParAlloc_lock",
Mutex::_safepoint_check_always, true)
_par_alloc_lock(Mutex::safepoint, "OffsetTableContigSpaceParAlloc_lock", true)
{
_offsets.set_contig_space(this);
initialize(mr, SpaceDecorator::Clear, SpaceDecorator::Mangle);
@@ -72,7 +72,7 @@ TaskTerminator::TaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set) :
_n_threads(n_threads),
_queue_set(queue_set),
_offered_termination(0),
_blocker(Mutex::nosafepoint, "TaskTerminator_lock", Monitor::_safepoint_check_never),
_blocker(Mutex::nosafepoint, "TaskTerminator_lock"),
_spin_master(NULL) { }

TaskTerminator::~TaskTerminator() {
@@ -245,8 +245,7 @@ void GangWorker::loop() {
// *** WorkGangBarrierSync

WorkGangBarrierSync::WorkGangBarrierSync()
: _monitor(Mutex::nosafepoint, "WorkGangBarrierSync_lock",
Monitor::_safepoint_check_never),
: _monitor(Mutex::nosafepoint, "WorkGangBarrierSync_lock"),
_n_workers(0), _n_completed(0), _should_reset(false), _aborted(false) {
}

@@ -47,8 +47,8 @@

ShenandoahControlThread::ShenandoahControlThread() :
ConcurrentGCThread(),
_alloc_failure_waiters_lock(Mutex::nonleaf, "ShenandoahAllocFailureGC_lock", Monitor::_safepoint_check_always, true),
_gc_waiters_lock(Mutex::nonleaf, "ShenandoahRequestedGC_lock", Monitor::_safepoint_check_always, true),
_alloc_failure_waiters_lock(Mutex::safepoint, "ShenandoahAllocFailureGC_lock", true),
_gc_waiters_lock(Mutex::safepoint, "ShenandoahRequestedGC_lock", true),
_periodic_task(this),
_requested_gc_cause(GCCause::_no_cause_specified),
_degen_point(ShenandoahGC::_degenerated_outside_cycle),
@@ -67,7 +67,7 @@ class ShenandoahPacer : public CHeapObj<mtGC> {
_heap(heap),
_last_time(os::elapsedTime()),
_progress_history(new TruncatedSeq(5)),
_wait_monitor(new Monitor(Mutex::nonleaf-1, "ShenandoahWaitMonitor_lock", Monitor::_safepoint_check_always, true)),
_wait_monitor(new Monitor(Mutex::safepoint-1, "ShenandoahWaitMonitor_lock", true)),
_epoch(0),
_tax_rate(1),
_budget(0),
@@ -66,9 +66,7 @@ class ZMessageRequest : public StackObj {

template <typename T>
inline ZMessagePort<T>::ZMessagePort() :
_monitor(Monitor::nosafepoint,
"ZMessagePort_lock",
Monitor::_safepoint_check_never),
_monitor(Monitor::nosafepoint, "ZMessagePort_lock"),
_has_message(false),
_seqnum(0),
_queue() {}
@@ -28,7 +28,7 @@
#include "utilities/ticks.hpp"

ZMetronome::ZMetronome(uint64_t hz) :
_monitor(Monitor::nosafepoint, "ZMetronome_lock", Monitor::_safepoint_check_never),
_monitor(Monitor::nosafepoint, "ZMetronome_lock"),
_interval_ms(MILLIUNITS / hz),
_start_ms(0),
_nticks(0),
@@ -245,7 +245,7 @@ class ParHeapInspectTask : public AbstractGangTask {
_filter(filter),
_missed_count(0),
_success(true),
_mutex(Mutex::nosafepoint, "ParHeapInspectTask_lock", Mutex::_safepoint_check_never) {}
_mutex(Mutex::nosafepoint, "ParHeapInspectTask_lock") {}

uintx missed_count() const {
return _missed_count;
@@ -92,7 +92,7 @@ MetaspaceTestContext::~MetaspaceTestContext() {
// Create an arena, feeding off this area.
MetaspaceTestArena* MetaspaceTestContext::create_arena(Metaspace::MetaspaceType type) {
const ArenaGrowthPolicy* growth_policy = ArenaGrowthPolicy::policy_for_space_type(type, false);
Mutex* lock = new Mutex(Monitor::nosafepoint, "MetaspaceTestArea_lock", Monitor::_safepoint_check_never);
Mutex* lock = new Mutex(Monitor::nosafepoint, "MetaspaceTestArea_lock");
MetaspaceArena* arena = NULL;
{
MutexLocker ml(lock, Mutex::_no_safepoint_check_flag);
@@ -1207,7 +1207,7 @@ void MethodData::post_initialize(BytecodeStream* stream) {
MethodData::MethodData(const methodHandle& method)
: _method(method()),
// Holds Compile_lock
_extra_data_lock(Mutex::nonleaf-2, "MDOExtraData_lock", Mutex::_safepoint_check_always),
_extra_data_lock(Mutex::safepoint-2, "MDOExtraData_lock"),
_compiler_counters(),
_parameters_type_data_di(parameters_uninitialized) {
initialize();
@@ -72,7 +72,7 @@ bool JvmtiTagMap::_has_object_free_events = false;
// create a JvmtiTagMap
JvmtiTagMap::JvmtiTagMap(JvmtiEnv* env) :
_env(env),
_lock(Mutex::nosafepoint, "JvmtiTagMap_lock", Mutex::_safepoint_check_never),
_lock(Mutex::nosafepoint, "JvmtiTagMap_lock"),
_needs_rehashing(false),
_needs_cleaning(false) {

@@ -408,7 +408,7 @@ void Handshake::execute(AsyncHandshakeClosure* hs_cl, JavaThread* target) {
HandshakeState::HandshakeState(JavaThread* target) :
_handshakee(target),
_queue(),
_lock(Monitor::nosafepoint, "HandshakeState_lock", Monitor::_safepoint_check_never),
_lock(Monitor::nosafepoint, "HandshakeState_lock"),
_active_handshaker(),
_suspended(false),
_async_suspend_handshake(false)

1 comment on commit 6364719

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 6364719 Oct 8, 2021

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.