Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8278475: G1 dirty card refinement by Java threads may get unnecessarily paused #7148

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2022, 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
@@ -495,6 +495,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 int 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;