Skip to content

Commit

Permalink
8281455: Change JVM options with small ranges from 64 to 32 bits, for…
Browse files Browse the repository at this point in the history
… gc_globals.hpp

Reviewed-by: tschatzl, coleenp
  • Loading branch information
Afshin Zafari committed Jun 27, 2023
1 parent f6133ed commit 7ce967a
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1Arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void G1Arguments::initialize() {

// By default do not let the target stack size to be more than 1/4 of the entries
if (FLAG_IS_DEFAULT(GCDrainStackTargetSize)) {
FLAG_SET_ERGO(GCDrainStackTargetSize, MIN2(GCDrainStackTargetSize, (uintx)TASKQUEUE_SIZE / 4));
FLAG_SET_ERGO(GCDrainStackTargetSize, MIN2(GCDrainStackTargetSize, TASKQUEUE_SIZE / 4));
}

#ifdef COMPILER2
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2308,7 +2308,7 @@ void G1CMTask::drain_local_queue(bool partially) {
// of things to do) or totally (at the very end).
size_t target_size;
if (partially) {
target_size = MIN2((size_t)_task_queue->max_elems()/3, (size_t)GCDrainStackTargetSize);
target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
} else {
target_size = 0;
}
Expand Down
12 changes: 6 additions & 6 deletions src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ JVMFlag::Error ParallelGCThreadsConstraintFuncParallel(uint value, bool verbose)
return JVMFlag::SUCCESS;
}

JVMFlag::Error InitialTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) {
JVMFlag::Error InitialTenuringThresholdConstraintFuncParallel(uint value, bool verbose) {
// InitialTenuringThreshold is only used for ParallelGC.
if (UseParallelGC && (value > MaxTenuringThreshold)) {
JVMFlag::printError(verbose,
"InitialTenuringThreshold (" UINTX_FORMAT ") must be "
"less than or equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n",
"InitialTenuringThreshold (%u) must be "
"less than or equal to MaxTenuringThreshold (%u)\n",
value, MaxTenuringThreshold);
return JVMFlag::VIOLATES_CONSTRAINT;
}
return JVMFlag::SUCCESS;
}

JVMFlag::Error MaxTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) {
JVMFlag::Error MaxTenuringThresholdConstraintFuncParallel(uint value, bool verbose) {
// As only ParallelGC uses InitialTenuringThreshold,
// we don't need to compare InitialTenuringThreshold with MaxTenuringThreshold.
if (UseParallelGC && (value < InitialTenuringThreshold)) {
JVMFlag::printError(verbose,
"MaxTenuringThreshold (" UINTX_FORMAT ") must be "
"greater than or equal to InitialTenuringThreshold (" UINTX_FORMAT ")\n",
"MaxTenuringThreshold (%u) must be "
"greater than or equal to InitialTenuringThreshold (%u)\n",
value, InitialTenuringThreshold);
return JVMFlag::VIOLATES_CONSTRAINT;
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
// Parallel Subconstraints
#define PARALLEL_GC_CONSTRAINTS(f) \
f(uint, ParallelGCThreadsConstraintFuncParallel) \
f(uintx, InitialTenuringThresholdConstraintFuncParallel) \
f(uintx, MaxTenuringThresholdConstraintFuncParallel)
f(uint, InitialTenuringThresholdConstraintFuncParallel) \
f(uint, MaxTenuringThresholdConstraintFuncParallel)

PARALLEL_GC_CONSTRAINTS(DECLARE_CONSTRAINT)

Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -349,7 +349,7 @@ void PSAdaptiveSizePolicy::compute_eden_space_size(
log_debug(gc, ergo)(
"PSAdaptiveSizePolicy::compute_eden_space_size: gc time limit"
" gc_cost: %f "
" GCTimeLimit: " UINTX_FORMAT,
" GCTimeLimit: %u",
gc_cost(), GCTimeLimit);
}

Expand Down Expand Up @@ -526,7 +526,7 @@ void PSAdaptiveSizePolicy::compute_old_gen_free_space(
log_debug(gc, ergo)(
"PSAdaptiveSizePolicy::compute_old_gen_free_space: gc time limit"
" gc_cost: %f "
" GCTimeLimit: " UINTX_FORMAT,
" GCTimeLimit: %u",
gc_cost(), GCTimeLimit);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/parallel/psScavenge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ bool PSScavenge::invoke_no_policy() {
_tenuring_threshold,
survivor_limit);

log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u (max threshold " UINTX_FORMAT ")",
log_debug(gc, age)("Desired survivor size %zu bytes, new threshold %u (max threshold %u)",
size_policy->calculated_survivor_size_in_bytes(),
_tenuring_threshold, MaxTenuringThreshold);

Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/shared/ageTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ uint AgeTable::compute_tenuring_threshold(size_t desired_survivor_size) {

if (AlwaysTenure || NeverTenure) {
assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markWord::max_age + 1,
"MaxTenuringThreshold should be 0 or markWord::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold);
"MaxTenuringThreshold should be 0 or markWord::max_age + 1, but is %u", MaxTenuringThreshold);
result = MaxTenuringThreshold;
} else {
size_t total = 0;
Expand All @@ -99,7 +99,7 @@ uint AgeTable::compute_tenuring_threshold(size_t desired_survivor_size) {
}


log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold " UINTX_FORMAT " (max threshold " UINTX_FORMAT ")",
log_debug(gc, age)("Desired survivor size %zu bytes, new threshold " UINTX_FORMAT " (max threshold %u)",
desired_survivor_size * oopSize, (uintx) result, MaxTenuringThreshold);

return result;
Expand All @@ -114,7 +114,7 @@ void AgeTable::print_age_table(uint tenuring_threshold) {
}

void AgeTable::print_on(outputStream* st, uint tenuring_threshold) {
st->print_cr("Age table with threshold %u (max threshold " UINTX_FORMAT ")",
st->print_cr("Age table with threshold %u (max threshold %u)",
tenuring_threshold, MaxTenuringThreshold);

size_t total = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/shared/gcOverheadChecker.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, Google and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -90,11 +90,11 @@ void GCOverheadChecker::check_gc_overhead_limit(GCOverheadTester* time_overhead,

if (UseGCOverheadLimit) {
if (gc_overhead_limit_exceeded()) {
log_trace(gc, ergo)("GC is exceeding overhead limit of " UINTX_FORMAT "%%", GCTimeLimit);
log_trace(gc, ergo)("GC is exceeding overhead limit of %u%%", GCTimeLimit);
reset_gc_overhead_limit_count();
} else if (print_gc_overhead_limit_would_be_exceeded) {
assert(_gc_overhead_limit_count > 0, "Should not be printing");
log_trace(gc, ergo)("GC would exceed overhead limit of " UINTX_FORMAT "%% %d consecutive time(s)",
log_trace(gc, ergo)("GC would exceed overhead limit of %u%% %d consecutive time(s)",
GCTimeLimit, _gc_overhead_limit_count);
}
}
Expand Down

1 comment on commit 7ce967a

@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.