Skip to content

Commit

Permalink
8315242: G1: Fix -Wconversion warnings around GCDrainStackTargetSize
Browse files Browse the repository at this point in the history
Reviewed-by: tschatzl, mli
  • Loading branch information
albertnetymk committed Aug 31, 2023
1 parent b594f01 commit b0353ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2317,9 +2317,9 @@ void G1CMTask::drain_local_queue(bool partially) {
// Decide what the target size is, depending whether we're going to
// drain it partially (so that other tasks can steal if they run out
// of things to do) or totally (at the very end).
size_t target_size;
uint target_size;
if (partially) {
target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
target_size = MIN2(_task_queue->max_elems() / 3, GCDrainStackTargetSize);
} else {
target_size = 0;
}
Expand Down
6 changes: 2 additions & 4 deletions src/hotspot/share/gc/parallel/psPromotionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,13 @@ PSPromotionManager::PSPromotionManager() {
// We set the old lab's start array.
_old_lab.set_start_array(old_gen()->start_array());

uint queue_size;
queue_size = claimed_stack_depth()->max_elems();
uint queue_size = claimed_stack_depth()->max_elems();

if (ParallelGCThreads == 1) {
_target_stack_size = 0;
} else {
// don't let the target stack size to be more than 1/4 of the entries
_target_stack_size = (uint) MIN2((uint) GCDrainStackTargetSize,
(uint) (queue_size / 4));
_target_stack_size = MIN2(GCDrainStackTargetSize, (queue_size / 4));
}

_array_chunk_size = ParGCArrayScanChunk;
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/shared/gc_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,10 @@
develop(uintx, GCExpandToAllocateDelayMillis, 0, \
"Delay between expansion and allocation (in milliseconds)") \
\
product(uintx, GCDrainStackTargetSize, 64, \
product(uint, GCDrainStackTargetSize, 64, \
"Number of entries we will try to leave on the stack " \
"during parallel gc") \
range(0, max_juint) \
range(0, (UINT_MAX - 1) / 2) \
\
product(uint, GCCardSizeInBytes, 512, \
"Card table entry size (in bytes) for card based collectors") \
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/utilities/globalDefinitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ const int badCodeHeapFreeVal = 0xDD; // value used to zap
#define badHeapWord (::badHeapWordVal)

// Default TaskQueue size is 16K (32-bit) or 128K (64-bit)
const size_t TASKQUEUE_SIZE = (NOT_LP64(1<<14) LP64_ONLY(1<<17));
const uint TASKQUEUE_SIZE = (NOT_LP64(1<<14) LP64_ONLY(1<<17));

//----------------------------------------------------------------------------------------------------
// Utility functions for bitfield manipulations
Expand Down

1 comment on commit b0353ad

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