Skip to content

Commit

Permalink
8278475: G1 dirty card refinement by Java threads may get unnecessari…
Browse files Browse the repository at this point in the history
…ly paused

Reviewed-by: tschatzl, iwalulya
  • Loading branch information
Kim Barrett committed Feb 1, 2022
1 parent c5a8612 commit 1f6fcbe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,14 @@ void G1DirtyCardQueueSet::handle_completed_buffer(BufferNode* new_node,
return;
}

// Don't try to process a buffer that will just get immediately paused.
// When going into a safepoint it's just a waste of effort.
// When coming out of a safepoint, Java threads may be running before the
// yield request (for non-Java threads) has been cleared.
if (SuspendibleThreadSet::should_yield()) {
return;
}

// Only Java threads perform mutator refinement.
if (!Thread::current()->is_Java_thread()) {
return;
Expand Down

1 comment on commit 1f6fcbe

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