97 lines
3.5 KiB
Diff
97 lines
3.5 KiB
Diff
|
|
From 21a76a7829958e0064051956d1d1f6ddb8b48650 Mon Sep 17 00:00:00 2001
|
||
|
|
From: eapen <zhangyipeng7@huawei.com>
|
||
|
|
Date: Mon, 24 Oct 2022 14:54:04 +0800
|
||
|
|
Subject: [PATCH 28/33] I68TO2: 8065402: G1 does not expand marking stack when mark
|
||
|
|
stack overflow happens during concurrent marking
|
||
|
|
---
|
||
|
|
.../vm/gc_implementation/g1/concurrentMark.cpp | 22 ++++++----------------
|
||
|
|
.../vm/gc_implementation/g1/concurrentMark.hpp | 4 ----
|
||
|
|
2 files changed, 6 insertions(+), 20 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
|
||
|
|
index 831ec94..df901a5 100644
|
||
|
|
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
|
||
|
|
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
|
||
|
|
@@ -247,7 +247,6 @@ bool CMMarkStack::allocate(size_t capacity) {
|
||
|
|
setEmpty();
|
||
|
|
_capacity = (jint) capacity;
|
||
|
|
_saved_index = -1;
|
||
|
|
- _should_expand = false;
|
||
|
|
NOT_PRODUCT(_max_depth = 0);
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
@@ -256,8 +255,6 @@ void CMMarkStack::expand() {
|
||
|
|
// Called, during remark, if we've overflown the marking stack during marking.
|
||
|
|
assert(isEmpty(), "stack should been emptied while handling overflow");
|
||
|
|
assert(_capacity <= (jint) MarkStackSizeMax, "stack bigger than permitted");
|
||
|
|
- // Clear expansion flag
|
||
|
|
- _should_expand = false;
|
||
|
|
if (_capacity == (jint) MarkStackSizeMax) {
|
||
|
|
if (PrintGCDetails && Verbose) {
|
||
|
|
gclog_or_tty->print_cr(" (benign) Can't expand marking stack capacity, at max size limit");
|
||
|
|
@@ -290,13 +287,6 @@ void CMMarkStack::expand() {
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
-void CMMarkStack::set_should_expand() {
|
||
|
|
- // If we're resetting the marking state because of an
|
||
|
|
- // marking stack overflow, record that we should, if
|
||
|
|
- // possible, expand the stack.
|
||
|
|
- _should_expand = _cm->has_overflown();
|
||
|
|
-}
|
||
|
|
-
|
||
|
|
CMMarkStack::~CMMarkStack() {
|
||
|
|
if (_base != NULL) {
|
||
|
|
_base = NULL;
|
||
|
|
@@ -795,8 +785,13 @@ void ConcurrentMark::reset() {
|
||
|
|
|
||
|
|
|
||
|
|
void ConcurrentMark::reset_marking_state(bool clear_overflow) {
|
||
|
|
- _markStack.set_should_expand();
|
||
|
|
_markStack.setEmpty(); // Also clears the _markStack overflow flag
|
||
|
|
+
|
||
|
|
+ // Expand the marking stack, if we have to and if we can.
|
||
|
|
+ if (has_overflown()) {
|
||
|
|
+ _markStack.expand();
|
||
|
|
+ }
|
||
|
|
+
|
||
|
|
if (clear_overflow) {
|
||
|
|
clear_has_overflown();
|
||
|
|
} else {
|
||
|
|
@@ -1367,11 +1362,6 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
|
||
|
|
set_non_marking_state();
|
||
|
|
}
|
||
|
|
|
||
|
|
- // Expand the marking stack, if we have to and if we can.
|
||
|
|
- if (_markStack.should_expand()) {
|
||
|
|
- _markStack.expand();
|
||
|
|
- }
|
||
|
|
-
|
||
|
|
// Statistics
|
||
|
|
double now = os::elapsedTime();
|
||
|
|
_remark_mark_times.add((mark_work_end - start) * 1000.0);
|
||
|
|
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
|
||
|
|
index f78b1cb..bbd5d59 100644
|
||
|
|
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
|
||
|
|
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
|
||
|
|
@@ -178,7 +178,6 @@ class CMMarkStack VALUE_OBJ_CLASS_SPEC {
|
||
|
|
NOT_PRODUCT(jint _max_depth;) // max depth plumbed during run
|
||
|
|
|
||
|
|
bool _overflow;
|
||
|
|
- bool _should_expand;
|
||
|
|
DEBUG_ONLY(bool _drain_in_progress;)
|
||
|
|
DEBUG_ONLY(bool _drain_in_progress_yields;)
|
||
|
|
|
||
|
|
@@ -255,9 +254,6 @@ class CMMarkStack VALUE_OBJ_CLASS_SPEC {
|
||
|
|
bool overflow() { return _overflow; }
|
||
|
|
void clear_overflow() { _overflow = false; }
|
||
|
|
|
||
|
|
- bool should_expand() const { return _should_expand; }
|
||
|
|
- void set_should_expand();
|
||
|
|
-
|
||
|
|
// Expand the stack, typically in response to an overflow condition
|
||
|
|
void expand();
|
||
|
|
|
||
|
|
--
|
||
|
|
1.8.3.1
|