author | drwhite |
Thu, 02 Apr 2015 16:42:24 -0400 | |
changeset 30157 | e36165b16dde |
parent 29796 | 7a04e5c250d1 |
child 30175 | 543725014c9d |
permissions | -rw-r--r-- |
1374 | 1 |
/* |
29697
92501504191b
8074459: Flags handling memory sizes should be of type size_t
jwilhelm
parents:
29693
diff
changeset
|
2 |
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. |
1374 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5033
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5033
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5033
diff
changeset
|
21 |
* questions. |
1374 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "gc_implementation/g1/concurrentG1Refine.hpp" |
|
27 |
#include "gc_implementation/g1/concurrentG1RefineThread.hpp" |
|
28 |
#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" |
|
29 |
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
|
30 |
#include "gc_implementation/g1/g1CollectorPolicy.hpp" |
|
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
31 |
#include "gc_implementation/g1/g1HotCardCache.hpp" |
13288
331d5b6725f3
7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
brutisso
parents:
11586
diff
changeset
|
32 |
#include "gc_implementation/g1/g1GCPhaseTimes.hpp" |
7397 | 33 |
#include "gc_implementation/g1/g1OopClosures.inline.hpp" |
34 |
#include "gc_implementation/g1/g1RemSet.inline.hpp" |
|
26316
93f6b40c038b
8054819: Rename HeapRegionSeq to HeapRegionManager
tschatzl
parents:
26160
diff
changeset
|
35 |
#include "gc_implementation/g1/heapRegionManager.inline.hpp" |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
36 |
#include "gc_implementation/g1/heapRegionRemSet.hpp" |
7397 | 37 |
#include "memory/iterator.hpp" |
38 |
#include "oops/oop.inline.hpp" |
|
24098
48f07e2c74de
8039957: Replace the last few %p usages with PTR_FORMAT in the GC code
stefank
parents:
23858
diff
changeset
|
39 |
#include "utilities/globalDefinitions.hpp" |
7397 | 40 |
#include "utilities/intHisto.hpp" |
1374 | 41 |
|
42 |
#define CARD_REPEAT_HISTO 0 |
|
43 |
||
44 |
#if CARD_REPEAT_HISTO |
|
45 |
static size_t ct_freq_sz; |
|
46 |
static jbyte* ct_freq = NULL; |
|
47 |
||
48 |
void init_ct_freq_table(size_t heap_sz_bytes) { |
|
49 |
if (ct_freq == NULL) { |
|
50 |
ct_freq_sz = heap_sz_bytes/CardTableModRefBS::card_size; |
|
51 |
ct_freq = new jbyte[ct_freq_sz]; |
|
52 |
for (size_t j = 0; j < ct_freq_sz; j++) ct_freq[j] = 0; |
|
53 |
} |
|
54 |
} |
|
55 |
||
56 |
void ct_freq_note_card(size_t index) { |
|
57 |
assert(0 <= index && index < ct_freq_sz, "Bounds error."); |
|
58 |
if (ct_freq[index] < 100) { ct_freq[index]++; } |
|
59 |
} |
|
60 |
||
61 |
static IntHistogram card_repeat_count(10, 10); |
|
62 |
||
63 |
void ct_freq_update_histo_and_reset() { |
|
64 |
for (size_t j = 0; j < ct_freq_sz; j++) { |
|
65 |
card_repeat_count.add_entry(ct_freq[j]); |
|
66 |
ct_freq[j] = 0; |
|
67 |
} |
|
68 |
||
69 |
} |
|
70 |
#endif |
|
71 |
||
6958 | 72 |
G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) |
73 |
: _g1(g1), _conc_refine_cards(0), |
|
74 |
_ct_bs(ct_bs), _g1p(_g1->g1_policy()), |
|
1374 | 75 |
_cg1r(g1->concurrent_g1_refine()), |
6247 | 76 |
_cset_rs_update_cl(NULL), |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
77 |
_cards_scanned(NULL), _total_cards_scanned(0), |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
78 |
_prev_period_summary() |
1374 | 79 |
{ |
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
80 |
_cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC); |
2142
032f4652700c
6720309: G1: don't synchronously update RSet during evacuation pauses
iveresov
parents:
2009
diff
changeset
|
81 |
for (uint i = 0; i < n_workers(); i++) { |
6247 | 82 |
_cset_rs_update_cl[i] = NULL; |
2142
032f4652700c
6720309: G1: don't synchronously update RSet during evacuation pauses
iveresov
parents:
2009
diff
changeset
|
83 |
} |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
20309
diff
changeset
|
84 |
if (G1SummarizeRSetStats) { |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
20309
diff
changeset
|
85 |
_prev_period_summary.initialize(this); |
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
20309
diff
changeset
|
86 |
} |
1374 | 87 |
} |
88 |
||
6958 | 89 |
G1RemSet::~G1RemSet() { |
2142
032f4652700c
6720309: G1: don't synchronously update RSet during evacuation pauses
iveresov
parents:
2009
diff
changeset
|
90 |
for (uint i = 0; i < n_workers(); i++) { |
6247 | 91 |
assert(_cset_rs_update_cl[i] == NULL, "it should be"); |
2142
032f4652700c
6720309: G1: don't synchronously update RSet during evacuation pauses
iveresov
parents:
2009
diff
changeset
|
92 |
} |
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
93 |
FREE_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, _cset_rs_update_cl); |
1374 | 94 |
} |
95 |
||
96 |
class ScanRSClosure : public HeapRegionClosure { |
|
97 |
size_t _cards_done, _cards; |
|
98 |
G1CollectedHeap* _g1h; |
|
19339 | 99 |
|
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
100 |
G1ParPushHeapRSClosure* _oc; |
26422 | 101 |
CodeBlobClosure* _code_root_cl; |
19339 | 102 |
|
1374 | 103 |
G1BlockOffsetSharedArray* _bot_shared; |
20309 | 104 |
G1SATBCardTableModRefBS *_ct_bs; |
19339 | 105 |
|
106 |
double _strong_code_root_scan_time_sec; |
|
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
107 |
uint _worker_i; |
29697
92501504191b
8074459: Flags handling memory sizes should be of type size_t
jwilhelm
parents:
29693
diff
changeset
|
108 |
size_t _block_size; |
19339 | 109 |
bool _try_claimed; |
110 |
||
1374 | 111 |
public: |
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
112 |
ScanRSClosure(G1ParPushHeapRSClosure* oc, |
26422 | 113 |
CodeBlobClosure* code_root_cl, |
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
114 |
uint worker_i) : |
1374 | 115 |
_oc(oc), |
19339 | 116 |
_code_root_cl(code_root_cl), |
117 |
_strong_code_root_scan_time_sec(0.0), |
|
1374 | 118 |
_cards(0), |
119 |
_cards_done(0), |
|
120 |
_worker_i(worker_i), |
|
121 |
_try_claimed(false) |
|
122 |
{ |
|
123 |
_g1h = G1CollectedHeap::heap(); |
|
124 |
_bot_shared = _g1h->bot_shared(); |
|
20309 | 125 |
_ct_bs = _g1h->g1_barrier_set(); |
29697
92501504191b
8074459: Flags handling memory sizes should be of type size_t
jwilhelm
parents:
29693
diff
changeset
|
126 |
_block_size = MAX2<size_t>(G1RSetScanBlockSize, 1); |
1374 | 127 |
} |
128 |
||
129 |
void set_try_claimed() { _try_claimed = true; } |
|
130 |
||
131 |
void scanCard(size_t index, HeapRegion *r) { |
|
10770 | 132 |
// Stack allocate the DirtyCardToOopClosure instance |
133 |
HeapRegionDCTOC cl(_g1h, r, _oc, |
|
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
134 |
CardTableModRefBS::Precise); |
1374 | 135 |
|
136 |
// Set the "from" region in the closure. |
|
137 |
_oc->set_region(r); |
|
27889
7d50f95e0076
8065358: Refactor G1s usage of save_marks and reduce related races
mgerdin
parents:
27635
diff
changeset
|
138 |
MemRegion card_region(_bot_shared->address_for_index(index), G1BlockOffsetSharedArray::N_words); |
7d50f95e0076
8065358: Refactor G1s usage of save_marks and reduce related races
mgerdin
parents:
27635
diff
changeset
|
139 |
MemRegion pre_gc_allocated(r->bottom(), r->scan_top()); |
7d50f95e0076
8065358: Refactor G1s usage of save_marks and reduce related races
mgerdin
parents:
27635
diff
changeset
|
140 |
MemRegion mr = pre_gc_allocated.intersection(card_region); |
9418
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
141 |
if (!mr.is_empty() && !_ct_bs->is_card_claimed(index)) { |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
142 |
// We make the card as "claimed" lazily (so races are possible |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
143 |
// but they're benign), which reduces the number of duplicate |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
144 |
// scans (the rsets of the regions in the cset can intersect). |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
145 |
_ct_bs->set_card_claimed(index); |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
146 |
_cards_done++; |
10770 | 147 |
cl.do_MemRegion(mr); |
1374 | 148 |
} |
149 |
} |
|
150 |
||
151 |
void printCard(HeapRegion* card_region, size_t card_index, |
|
152 |
HeapWord* card_start) { |
|
23858
dae377f5a7c7
8039244: Don't use UINT32_FORMAT and INT32_FORMAT when printing uints and ints in the GC code
stefank
parents:
23855
diff
changeset
|
153 |
gclog_or_tty->print_cr("T %u Region [" PTR_FORMAT ", " PTR_FORMAT ") " |
24098
48f07e2c74de
8039957: Replace the last few %p usages with PTR_FORMAT in the GC code
stefank
parents:
23858
diff
changeset
|
154 |
"RS names card " SIZE_FORMAT_HEX ": " |
1374 | 155 |
"[" PTR_FORMAT ", " PTR_FORMAT ")", |
156 |
_worker_i, |
|
29796
7a04e5c250d1
8076054: g1: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
david
parents:
29697
diff
changeset
|
157 |
p2i(card_region->bottom()), p2i(card_region->end()), |
1374 | 158 |
card_index, |
29796
7a04e5c250d1
8076054: g1: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
david
parents:
29697
diff
changeset
|
159 |
p2i(card_start), p2i(card_start + G1BlockOffsetSharedArray::N_words)); |
1374 | 160 |
} |
161 |
||
19339 | 162 |
void scan_strong_code_roots(HeapRegion* r) { |
163 |
double scan_start = os::elapsedTime(); |
|
164 |
r->strong_code_roots_do(_code_root_cl); |
|
165 |
_strong_code_root_scan_time_sec += (os::elapsedTime() - scan_start); |
|
166 |
} |
|
167 |
||
1374 | 168 |
bool doHeapRegion(HeapRegion* r) { |
169 |
assert(r->in_collection_set(), "should only be called on elements of CS."); |
|
170 |
HeapRegionRemSet* hrrs = r->rem_set(); |
|
171 |
if (hrrs->iter_is_complete()) return false; // All done. |
|
172 |
if (!_try_claimed && !hrrs->claim_iter()) return false; |
|
9418
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
173 |
// If we ever free the collection set concurrently, we should also |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
174 |
// clear the card table concurrently therefore we won't need to |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
175 |
// add regions of the collection set to the dirty cards region. |
2883
406d1e6d1aa1
6819065: G1: eliminate high serial card table clearing time
apetrusenko
parents:
2881
diff
changeset
|
176 |
_g1h->push_dirty_cards_region(r); |
1374 | 177 |
// If we didn't return above, then |
178 |
// _try_claimed || r->claim_iter() |
|
179 |
// is true: either we're supposed to work on claimed-but-not-complete |
|
180 |
// regions, or we successfully claimed the region. |
|
19339 | 181 |
|
17108
cf72dcf9a8f2
8011724: G1: Stack allocate instances of HeapRegionRemSetIterator
johnc
parents:
13728
diff
changeset
|
182 |
HeapRegionRemSetIterator iter(hrrs); |
1374 | 183 |
size_t card_index; |
4902
991aaddb5165
6923991: G1: improve scalability of RSet scanning
iveresov
parents:
3590
diff
changeset
|
184 |
|
22551 | 185 |
// We claim cards in block so as to reduce the contention. The block size is determined by |
4902
991aaddb5165
6923991: G1: improve scalability of RSet scanning
iveresov
parents:
3590
diff
changeset
|
186 |
// the G1RSetScanBlockSize parameter. |
991aaddb5165
6923991: G1: improve scalability of RSet scanning
iveresov
parents:
3590
diff
changeset
|
187 |
size_t jump_to_card = hrrs->iter_claimed_next(_block_size); |
17108
cf72dcf9a8f2
8011724: G1: Stack allocate instances of HeapRegionRemSetIterator
johnc
parents:
13728
diff
changeset
|
188 |
for (size_t current_card = 0; iter.has_next(card_index); current_card++) { |
4902
991aaddb5165
6923991: G1: improve scalability of RSet scanning
iveresov
parents:
3590
diff
changeset
|
189 |
if (current_card >= jump_to_card + _block_size) { |
991aaddb5165
6923991: G1: improve scalability of RSet scanning
iveresov
parents:
3590
diff
changeset
|
190 |
jump_to_card = hrrs->iter_claimed_next(_block_size); |
2737 | 191 |
} |
4902
991aaddb5165
6923991: G1: improve scalability of RSet scanning
iveresov
parents:
3590
diff
changeset
|
192 |
if (current_card < jump_to_card) continue; |
1374 | 193 |
HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index); |
194 |
#if 0 |
|
195 |
gclog_or_tty->print("Rem set iteration yielded card [" PTR_FORMAT ", " PTR_FORMAT ").\n", |
|
196 |
card_start, card_start + CardTableModRefBS::card_size_in_words); |
|
197 |
#endif |
|
198 |
||
199 |
HeapRegion* card_region = _g1h->heap_region_containing(card_start); |
|
200 |
_cards++; |
|
201 |
||
2883
406d1e6d1aa1
6819065: G1: eliminate high serial card table clearing time
apetrusenko
parents:
2881
diff
changeset
|
202 |
if (!card_region->is_on_dirty_cards_region_list()) { |
406d1e6d1aa1
6819065: G1: eliminate high serial card table clearing time
apetrusenko
parents:
2881
diff
changeset
|
203 |
_g1h->push_dirty_cards_region(card_region); |
406d1e6d1aa1
6819065: G1: eliminate high serial card table clearing time
apetrusenko
parents:
2881
diff
changeset
|
204 |
} |
406d1e6d1aa1
6819065: G1: eliminate high serial card table clearing time
apetrusenko
parents:
2881
diff
changeset
|
205 |
|
9418
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
206 |
// If the card is dirty, then we will scan it during updateRS. |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
207 |
if (!card_region->in_collection_set() && |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
208 |
!_ct_bs->is_card_dirty(card_index)) { |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
209 |
scanCard(card_index, card_region); |
1374 | 210 |
} |
211 |
} |
|
2737 | 212 |
if (!_try_claimed) { |
19339 | 213 |
// Scan the strong code root list attached to the current region |
214 |
scan_strong_code_roots(r); |
|
215 |
||
2737 | 216 |
hrrs->set_iter_complete(); |
217 |
} |
|
1374 | 218 |
return false; |
219 |
} |
|
19339 | 220 |
|
221 |
double strong_code_root_scan_time_sec() { |
|
222 |
return _strong_code_root_scan_time_sec; |
|
223 |
} |
|
224 |
||
1374 | 225 |
size_t cards_done() { return _cards_done;} |
226 |
size_t cards_looked_up() { return _cards;} |
|
227 |
}; |
|
228 |
||
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
229 |
void G1RemSet::scanRS(G1ParPushHeapRSClosure* oc, |
26422 | 230 |
CodeBlobClosure* code_root_cl, |
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
231 |
uint worker_i) { |
1374 | 232 |
double rs_time_start = os::elapsedTime(); |
11176
9bb1ddd8da51
7112743: G1: Reduce overhead of marking closure during evacuation pauses
johnc
parents:
11174
diff
changeset
|
233 |
HeapRegion *startRegion = _g1->start_cset_region_for_worker(worker_i); |
1374 | 234 |
|
19339 | 235 |
ScanRSClosure scanRScl(oc, code_root_cl, worker_i); |
10670
4ea0e7d2ffbc
6484982: G1: process references during evacuation pauses
johnc
parents:
10000
diff
changeset
|
236 |
|
1374 | 237 |
_g1->collection_set_iterate_from(startRegion, &scanRScl); |
238 |
scanRScl.set_try_claimed(); |
|
239 |
_g1->collection_set_iterate_from(startRegion, &scanRScl); |
|
240 |
||
19339 | 241 |
double scan_rs_time_sec = (os::elapsedTime() - rs_time_start) |
242 |
- scanRScl.strong_code_root_scan_time_sec(); |
|
1374 | 243 |
|
19339 | 244 |
assert(_cards_scanned != NULL, "invariant"); |
1374 | 245 |
_cards_scanned[worker_i] = scanRScl.cards_done(); |
246 |
||
29680
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
28207
diff
changeset
|
247 |
_g1p->phase_times()->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, scan_rs_time_sec); |
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
28207
diff
changeset
|
248 |
_g1p->phase_times()->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, scanRScl.strong_code_root_scan_time_sec()); |
1374 | 249 |
} |
250 |
||
6247 | 251 |
// Closure used for updating RSets and recording references that |
252 |
// point into the collection set. Only called during an |
|
253 |
// evacuation pause. |
|
254 |
||
255 |
class RefineRecordRefsIntoCSCardTableEntryClosure: public CardTableEntryClosure { |
|
256 |
G1RemSet* _g1rs; |
|
257 |
DirtyCardQueue* _into_cset_dcq; |
|
258 |
public: |
|
259 |
RefineRecordRefsIntoCSCardTableEntryClosure(G1CollectedHeap* g1h, |
|
260 |
DirtyCardQueue* into_cset_dcq) : |
|
261 |
_g1rs(g1h->g1_rem_set()), _into_cset_dcq(into_cset_dcq) |
|
262 |
{} |
|
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
263 |
bool do_card_ptr(jbyte* card_ptr, uint worker_i) { |
6247 | 264 |
// The only time we care about recording cards that |
265 |
// contain references that point into the collection set |
|
266 |
// is during RSet updating within an evacuation pause. |
|
267 |
// In this case worker_i should be the id of a GC worker thread. |
|
268 |
assert(SafepointSynchronize::is_at_safepoint(), "not during an evacuation pause"); |
|
27251
7d667f91ec8d
6979279: remove special-case code for ParallelGCThreads==0
mlarsson
parents:
27009
diff
changeset
|
269 |
assert(worker_i < ParallelGCThreads, "should be a GC worker"); |
1374 | 270 |
|
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
271 |
if (_g1rs->refine_card(card_ptr, worker_i, true)) { |
6247 | 272 |
// 'card_ptr' contains references that point into the collection |
273 |
// set. We need to record the card in the DCQS |
|
274 |
// (G1CollectedHeap::into_cset_dirty_card_queue_set()) |
|
275 |
// that's used for that purpose. |
|
276 |
// |
|
277 |
// Enqueue the card |
|
278 |
_into_cset_dcq->enqueue(card_ptr); |
|
279 |
} |
|
280 |
return true; |
|
281 |
} |
|
282 |
}; |
|
283 |
||
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
284 |
void G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, uint worker_i) { |
29680
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
28207
diff
changeset
|
285 |
G1GCParPhaseTimesTracker x(_g1p->phase_times(), G1GCPhaseTimes::UpdateRS, worker_i); |
6247 | 286 |
// Apply the given closure to all remaining log entries. |
287 |
RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq); |
|
10670
4ea0e7d2ffbc
6484982: G1: process references during evacuation pauses
johnc
parents:
10000
diff
changeset
|
288 |
|
6247 | 289 |
_g1->iterate_dirty_card_closure(&into_cset_update_rs_cl, into_cset_dcq, false, worker_i); |
1374 | 290 |
} |
291 |
||
6958 | 292 |
void G1RemSet::cleanupHRRS() { |
1374 | 293 |
HeapRegionRemSet::cleanup(); |
294 |
} |
|
295 |
||
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
296 |
void G1RemSet::oops_into_collection_set_do(G1ParPushHeapRSClosure* oc, |
26422 | 297 |
CodeBlobClosure* code_root_cl, |
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
298 |
uint worker_i) { |
1374 | 299 |
#if CARD_REPEAT_HISTO |
300 |
ct_freq_update_histo_and_reset(); |
|
301 |
#endif |
|
302 |
||
6247 | 303 |
// We cache the value of 'oc' closure into the appropriate slot in the |
304 |
// _cset_rs_update_cl for this worker |
|
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
305 |
assert(worker_i < n_workers(), "sanity"); |
6247 | 306 |
_cset_rs_update_cl[worker_i] = oc; |
307 |
||
308 |
// A DirtyCardQueue that is used to hold cards containing references |
|
309 |
// that point into the collection set. This DCQ is associated with a |
|
310 |
// special DirtyCardQueueSet (see g1CollectedHeap.hpp). Under normal |
|
311 |
// circumstances (i.e. the pause successfully completes), these cards |
|
312 |
// are just discarded (there's no need to update the RSets of regions |
|
313 |
// that were in the collection set - after the pause these regions |
|
314 |
// are wholly 'free' of live objects. In the event of an evacuation |
|
26701
f8ff74a6c058
8052172: Evacuation failure handling in G1 does not evacuate all objects if -XX:-G1DeferredRSUpdate is set
tschatzl
parents:
26422
diff
changeset
|
315 |
// failure the cards/buffers in this queue set are passed to the |
f8ff74a6c058
8052172: Evacuation failure handling in G1 does not evacuate all objects if -XX:-G1DeferredRSUpdate is set
tschatzl
parents:
26422
diff
changeset
|
316 |
// DirtyCardQueueSet that is used to manage RSet updates |
6247 | 317 |
DirtyCardQueue into_cset_dcq(&_g1->into_cset_dirty_card_queue_set()); |
318 |
||
25909
571781915421
8051837: Remove temporary G1UseParallelRSetUpdating and G1UseParallelRSetScanning flags
brutisso
parents:
24424
diff
changeset
|
319 |
updateRS(&into_cset_dcq, worker_i); |
571781915421
8051837: Remove temporary G1UseParallelRSetUpdating and G1UseParallelRSetScanning flags
brutisso
parents:
24424
diff
changeset
|
320 |
scanRS(oc, code_root_cl, worker_i); |
6247 | 321 |
|
322 |
// We now clear the cached values of _cset_rs_update_cl for this worker |
|
323 |
_cset_rs_update_cl[worker_i] = NULL; |
|
1374 | 324 |
} |
325 |
||
6958 | 326 |
void G1RemSet::prepare_for_oops_into_collection_set_do() { |
1374 | 327 |
cleanupHRRS(); |
328 |
_g1->set_refine_cte_cl_concurrency(false); |
|
329 |
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); |
|
330 |
dcqs.concatenate_logs(); |
|
331 |
||
332 |
guarantee( _cards_scanned == NULL, "invariant" ); |
|
13195 | 333 |
_cards_scanned = NEW_C_HEAP_ARRAY(size_t, n_workers(), mtGC); |
2009 | 334 |
for (uint i = 0; i < n_workers(); ++i) { |
335 |
_cards_scanned[i] = 0; |
|
336 |
} |
|
1374 | 337 |
_total_cards_scanned = 0; |
338 |
} |
|
339 |
||
6958 | 340 |
void G1RemSet::cleanup_after_oops_into_collection_set_do() { |
1374 | 341 |
guarantee( _cards_scanned != NULL, "invariant" ); |
342 |
_total_cards_scanned = 0; |
|
10000
5bbb58b0dbb9
7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents:
9988
diff
changeset
|
343 |
for (uint i = 0; i < n_workers(); ++i) { |
1374 | 344 |
_total_cards_scanned += _cards_scanned[i]; |
10000
5bbb58b0dbb9
7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents:
9988
diff
changeset
|
345 |
} |
27880
afb974a04396
8060074: os::free() takes MemoryTrackingLevel but doesn't need it
coleenp
parents:
27635
diff
changeset
|
346 |
FREE_C_HEAP_ARRAY(size_t, _cards_scanned); |
1374 | 347 |
_cards_scanned = NULL; |
348 |
// Cleanup after copy |
|
349 |
_g1->set_refine_cte_cl_concurrency(true); |
|
350 |
// Set all cards back to clean. |
|
351 |
_g1->cleanUpCardTable(); |
|
2881 | 352 |
|
6247 | 353 |
DirtyCardQueueSet& into_cset_dcqs = _g1->into_cset_dirty_card_queue_set(); |
354 |
int into_cset_n_buffers = into_cset_dcqs.completed_buffers_num(); |
|
355 |
||
2142
032f4652700c
6720309: G1: don't synchronously update RSet during evacuation pauses
iveresov
parents:
2009
diff
changeset
|
356 |
if (_g1->evacuation_failed()) { |
23455
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
22772
diff
changeset
|
357 |
double restore_remembered_set_start = os::elapsedTime(); |
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
22772
diff
changeset
|
358 |
|
6247 | 359 |
// Restore remembered sets for the regions pointing into the collection set. |
26701
f8ff74a6c058
8052172: Evacuation failure handling in G1 does not evacuate all objects if -XX:-G1DeferredRSUpdate is set
tschatzl
parents:
26422
diff
changeset
|
360 |
// We just need to transfer the completed buffers from the DirtyCardQueueSet |
f8ff74a6c058
8052172: Evacuation failure handling in G1 does not evacuate all objects if -XX:-G1DeferredRSUpdate is set
tschatzl
parents:
26422
diff
changeset
|
361 |
// used to hold cards that contain references that point into the collection set |
f8ff74a6c058
8052172: Evacuation failure handling in G1 does not evacuate all objects if -XX:-G1DeferredRSUpdate is set
tschatzl
parents:
26422
diff
changeset
|
362 |
// to the DCQS used to hold the deferred RS updates. |
f8ff74a6c058
8052172: Evacuation failure handling in G1 does not evacuate all objects if -XX:-G1DeferredRSUpdate is set
tschatzl
parents:
26422
diff
changeset
|
363 |
_g1->dirty_card_queue_set().merge_bufferlists(&into_cset_dcqs); |
23455
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
22772
diff
changeset
|
364 |
_g1->g1_policy()->phase_times()->record_evac_fail_restore_remsets((os::elapsedTime() - restore_remembered_set_start) * 1000.0); |
2142
032f4652700c
6720309: G1: don't synchronously update RSet during evacuation pauses
iveresov
parents:
2009
diff
changeset
|
365 |
} |
6247 | 366 |
|
367 |
// Free any completed buffers in the DirtyCardQueueSet used to hold cards |
|
368 |
// which contain references that point into the collection. |
|
369 |
_g1->into_cset_dirty_card_queue_set().clear(); |
|
370 |
assert(_g1->into_cset_dirty_card_queue_set().completed_buffers_num() == 0, |
|
371 |
"all buffers should be freed"); |
|
372 |
_g1->into_cset_dirty_card_queue_set().clear_n_completed_buffers(); |
|
1374 | 373 |
} |
374 |
||
375 |
class ScrubRSClosure: public HeapRegionClosure { |
|
376 |
G1CollectedHeap* _g1h; |
|
377 |
BitMap* _region_bm; |
|
378 |
BitMap* _card_bm; |
|
379 |
CardTableModRefBS* _ctbs; |
|
380 |
public: |
|
381 |
ScrubRSClosure(BitMap* region_bm, BitMap* card_bm) : |
|
382 |
_g1h(G1CollectedHeap::heap()), |
|
383 |
_region_bm(region_bm), _card_bm(card_bm), |
|
20309 | 384 |
_ctbs(_g1h->g1_barrier_set()) {} |
1374 | 385 |
|
386 |
bool doHeapRegion(HeapRegion* r) { |
|
26846
7d4376f8560e
8058495: G1: normalize names for isHumongous() and friends
tonyp
parents:
26701
diff
changeset
|
387 |
if (!r->is_continues_humongous()) { |
1374 | 388 |
r->rem_set()->scrub(_ctbs, _region_bm, _card_bm); |
389 |
} |
|
390 |
return false; |
|
391 |
} |
|
392 |
}; |
|
393 |
||
27251
7d667f91ec8d
6979279: remove special-case code for ParallelGCThreads==0
mlarsson
parents:
27009
diff
changeset
|
394 |
void G1RemSet::scrub(BitMap* region_bm, BitMap* card_bm, uint worker_num, HeapRegionClaimer *hrclaimer) { |
1374 | 395 |
ScrubRSClosure scrub_cl(region_bm, card_bm); |
27009
e7e723732b6b
8058298: Separate heap region iterator claim values from the data structures iterated over
mlarsson
parents:
26846
diff
changeset
|
396 |
_g1->heap_region_par_iterate(&scrub_cl, worker_num, hrclaimer); |
1374 | 397 |
} |
398 |
||
11586
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
399 |
G1TriggerClosure::G1TriggerClosure() : |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
400 |
_triggered(false) { } |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
401 |
|
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
402 |
G1InvokeIfNotTriggeredClosure::G1InvokeIfNotTriggeredClosure(G1TriggerClosure* t_cl, |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
403 |
OopClosure* oop_cl) : |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
404 |
_trigger_cl(t_cl), _oop_cl(oop_cl) { } |
6247 | 405 |
|
11586
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
406 |
G1Mux2Closure::G1Mux2Closure(OopClosure *c1, OopClosure *c2) : |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
407 |
_c1(c1), _c2(c2) { } |
6247 | 408 |
|
11586
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
409 |
G1UpdateRSOrPushRefOopClosure:: |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
410 |
G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h, |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
411 |
G1RemSet* rs, |
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
412 |
G1ParPushHeapRSClosure* push_ref_cl, |
11586
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
413 |
bool record_refs_into_cset, |
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
414 |
uint worker_i) : |
11586
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
415 |
_g1(g1h), _g1_rem_set(rs), _from(NULL), |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
416 |
_record_refs_into_cset(record_refs_into_cset), |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
417 |
_push_ref_cl(push_ref_cl), _worker_i(worker_i) { } |
6247 | 418 |
|
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
419 |
// Returns true if the given card contains references that point |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
420 |
// into the collection set, if we're checking for such references; |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
421 |
// false otherwise. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
422 |
|
23855
c4574075402c
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
23455
diff
changeset
|
423 |
bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i, |
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
424 |
bool check_for_refs_into_cset) { |
26160 | 425 |
assert(_g1->is_in_exact(_ct_bs->addr_for(card_ptr)), |
426 |
err_msg("Card at "PTR_FORMAT" index "SIZE_FORMAT" representing heap at "PTR_FORMAT" (%u) must be in committed heap", |
|
427 |
p2i(card_ptr), |
|
428 |
_ct_bs->index_for(_ct_bs->addr_for(card_ptr)), |
|
29796
7a04e5c250d1
8076054: g1: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
david
parents:
29697
diff
changeset
|
429 |
p2i(_ct_bs->addr_for(card_ptr)), |
26160 | 430 |
_g1->addr_to_region(_ct_bs->addr_for(card_ptr)))); |
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
431 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
432 |
// If the card is no longer dirty, nothing to do. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
433 |
if (*card_ptr != CardTableModRefBS::dirty_card_val()) { |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
434 |
// No need to return that this card contains refs that point |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
435 |
// into the collection set. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
436 |
return false; |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
437 |
} |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
438 |
|
3590
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
439 |
// Construct the region representing the card. |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
440 |
HeapWord* start = _ct_bs->addr_for(card_ptr); |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
441 |
// And find the region containing it. |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
442 |
HeapRegion* r = _g1->heap_region_containing(start); |
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
443 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
444 |
// Why do we have to check here whether a card is on a young region, |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
445 |
// given that we dirty young regions and, as a result, the |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
446 |
// post-barrier is supposed to filter them out and never to enqueue |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
447 |
// them? When we allocate a new region as the "allocation region" we |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
448 |
// actually dirty its cards after we release the lock, since card |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
449 |
// dirtying while holding the lock was a performance bottleneck. So, |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
450 |
// as a result, it is possible for other threads to actually |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
451 |
// allocate objects in the region (after the acquire the lock) |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
452 |
// before all the cards on the region are dirtied. This is unlikely, |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
453 |
// and it doesn't happen often, but it can happen. So, the extra |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
454 |
// check below filters out those cards. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
455 |
if (r->is_young()) { |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
456 |
return false; |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
457 |
} |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
458 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
459 |
// While we are processing RSet buffers during the collection, we |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
460 |
// actually don't want to scan any cards on the collection set, |
22551 | 461 |
// since we don't want to update remembered sets with entries that |
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
462 |
// point into the collection set, given that live objects from the |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
463 |
// collection set are about to move and such entries will be stale |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
464 |
// very soon. This change also deals with a reliability issue which |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
465 |
// involves scanning a card in the collection set and coming across |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
466 |
// an array that was being chunked and looking malformed. Note, |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
467 |
// however, that if evacuation fails, we have to scan any objects |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
468 |
// that were not moved and create any missing entries. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
469 |
if (r->in_collection_set()) { |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
470 |
return false; |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
471 |
} |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
472 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
473 |
// The result from the hot card cache insert call is either: |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
474 |
// * pointer to the current card |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
475 |
// (implying that the current card is not 'hot'), |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
476 |
// * null |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
477 |
// (meaning we had inserted the card ptr into the "hot" card cache, |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
478 |
// which had some headroom), |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
479 |
// * a pointer to a "hot" card that was evicted from the "hot" cache. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
480 |
// |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
481 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
482 |
G1HotCardCache* hot_card_cache = _cg1r->hot_card_cache(); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
483 |
if (hot_card_cache->use_cache()) { |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
484 |
assert(!check_for_refs_into_cset, "sanity"); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
485 |
assert(!SafepointSynchronize::is_at_safepoint(), "sanity"); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
486 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
487 |
card_ptr = hot_card_cache->insert(card_ptr); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
488 |
if (card_ptr == NULL) { |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
489 |
// There was no eviction. Nothing to do. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
490 |
return false; |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
491 |
} |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
492 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
493 |
start = _ct_bs->addr_for(card_ptr); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
494 |
r = _g1->heap_region_containing(start); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
495 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
496 |
// Checking whether the region we got back from the cache |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
497 |
// is young here is inappropriate. The region could have been |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
498 |
// freed, reallocated and tagged as young while in the cache. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
499 |
// Hence we could see its young type change at any time. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
500 |
} |
3590
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
501 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13516
diff
changeset
|
502 |
// Don't use addr_for(card_ptr + 1) which can ask for |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13516
diff
changeset
|
503 |
// a card beyond the heap. This is not safe without a perm |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13516
diff
changeset
|
504 |
// gen at the upper end of the heap. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13516
diff
changeset
|
505 |
HeapWord* end = start + CardTableModRefBS::card_size_in_words; |
3590
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
506 |
MemRegion dirtyRegion(start, end); |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
507 |
|
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
508 |
#if CARD_REPEAT_HISTO |
8103
65eafe3fb3c7
6923430: G1: assert(res != 0,"This should have worked.")
johnc
parents:
7397
diff
changeset
|
509 |
init_ct_freq_table(_g1->max_capacity()); |
3590
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
510 |
ct_freq_note_card(_ct_bs->index_for(start)); |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
511 |
#endif |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
512 |
|
28207
6ad23566cbef
8067655: Clean up G1 remembered set oop iteration
mgerdin
parents:
27905
diff
changeset
|
513 |
G1ParPushHeapRSClosure* oops_in_heap_closure = NULL; |
10995
b3b2d17ff45d
7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
brutisso
parents:
10770
diff
changeset
|
514 |
if (check_for_refs_into_cset) { |
b3b2d17ff45d
7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
brutisso
parents:
10770
diff
changeset
|
515 |
// ConcurrentG1RefineThreads have worker numbers larger than what |
b3b2d17ff45d
7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
brutisso
parents:
10770
diff
changeset
|
516 |
// _cset_rs_update_cl[] is set up to handle. But those threads should |
b3b2d17ff45d
7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
brutisso
parents:
10770
diff
changeset
|
517 |
// only be active outside of a collection which means that when they |
b3b2d17ff45d
7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
brutisso
parents:
10770
diff
changeset
|
518 |
// reach here they should have check_for_refs_into_cset == false. |
b3b2d17ff45d
7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
brutisso
parents:
10770
diff
changeset
|
519 |
assert((size_t)worker_i < n_workers(), "index of worker larger than _cset_rs_update_cl[].length"); |
b3b2d17ff45d
7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
brutisso
parents:
10770
diff
changeset
|
520 |
oops_in_heap_closure = _cset_rs_update_cl[worker_i]; |
b3b2d17ff45d
7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
brutisso
parents:
10770
diff
changeset
|
521 |
} |
11586
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
522 |
G1UpdateRSOrPushRefOopClosure update_rs_oop_cl(_g1, |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
523 |
_g1->g1_rem_set(), |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
524 |
oops_in_heap_closure, |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
525 |
check_for_refs_into_cset, |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
526 |
worker_i); |
3590
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
527 |
update_rs_oop_cl.set_from(r); |
6247 | 528 |
|
11586
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
529 |
G1TriggerClosure trigger_cl; |
10674
09e6f8d20337
7097053: G1: assert(da ? referent->is_oop() : referent->is_oop_or_null()) failed: referenceProcessor.cpp:1054
johnc
parents:
10670
diff
changeset
|
530 |
FilterIntoCSClosure into_cs_cl(NULL, _g1, &trigger_cl); |
11586
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
531 |
G1InvokeIfNotTriggeredClosure invoke_cl(&trigger_cl, &into_cs_cl); |
ccc217c177ee
7133038: G1: Some small profile based optimizations
johnc
parents:
11396
diff
changeset
|
532 |
G1Mux2Closure mux(&invoke_cl, &update_rs_oop_cl); |
6247 | 533 |
|
534 |
FilterOutOfRegionClosure filter_then_update_rs_oop_cl(r, |
|
535 |
(check_for_refs_into_cset ? |
|
536 |
(OopClosure*)&mux : |
|
537 |
(OopClosure*)&update_rs_oop_cl)); |
|
3590
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
538 |
|
6068
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
539 |
// The region for the current card may be a young region. The |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
540 |
// current card may have been a card that was evicted from the |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
541 |
// card cache. When the card was inserted into the cache, we had |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
542 |
// determined that its region was non-young. While in the cache, |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
543 |
// the region may have been freed during a cleanup pause, reallocated |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
544 |
// and tagged as young. |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
545 |
// |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
546 |
// We wish to filter out cards for such a region but the current |
9418
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
547 |
// thread, if we're running concurrently, may "see" the young type |
6068
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
548 |
// change at any time (so an earlier "is_young" check may pass or |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
549 |
// fail arbitrarily). We tell the iteration code to perform this |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
550 |
// filtering when it has been determined that there has been an actual |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
551 |
// allocation in this region and making it safe to check the young type. |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
552 |
bool filter_young = true; |
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
553 |
|
3590
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
554 |
HeapWord* stop_point = |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
555 |
r->oops_on_card_seq_iterate_careful(dirtyRegion, |
6068
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
556 |
&filter_then_update_rs_oop_cl, |
9418
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
557 |
filter_young, |
32a87dd6b746
7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents:
8683
diff
changeset
|
558 |
card_ptr); |
6068
80ef41e75a2d
6956639: G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
johnc
parents:
5891
diff
changeset
|
559 |
|
3590
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
560 |
// If stop_point is non-null, then we encountered an unallocated region |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
561 |
// (perhaps the unfilled portion of a TLAB.) For now, we'll dirty the |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
562 |
// card and re-enqueue: if we put off the card until a GC pause, then the |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
563 |
// unallocated portion will be filled in. Alternatively, we might try |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
564 |
// the full complexity of the technique used in "regular" precleaning. |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
565 |
if (stop_point != NULL) { |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
566 |
// The card might have gotten re-dirtied and re-enqueued while we |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
567 |
// worked. (In fact, it's pretty likely.) |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
568 |
if (*card_ptr != CardTableModRefBS::dirty_card_val()) { |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
569 |
*card_ptr = CardTableModRefBS::dirty_card_val(); |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
570 |
MutexLockerEx x(Shared_DirtyCardQ_lock, |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
571 |
Mutex::_no_safepoint_check_flag); |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
572 |
DirtyCardQueue* sdcq = |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
573 |
JavaThread::dirty_card_queue_set().shared_dirty_card_queue(); |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
574 |
sdcq->enqueue(card_ptr); |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
575 |
} |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
576 |
} else { |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
577 |
_conc_refine_cards++; |
a268fa66d7fb
6819077: G1: first GC thread coming late into the GC.
johnc
parents:
3262
diff
changeset
|
578 |
} |
6247 | 579 |
|
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
580 |
// This gets set to true if the card being refined has |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
581 |
// references that point into the collection set. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
582 |
bool has_refs_into_cset = trigger_cl.triggered(); |
1374 | 583 |
|
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
584 |
// We should only be detecting that the card contains references |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
585 |
// that point into the collection set if the current thread is |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
586 |
// a GC worker thread. |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
587 |
assert(!has_refs_into_cset || SafepointSynchronize::is_at_safepoint(), |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
588 |
"invalid result at non safepoint"); |
6247 | 589 |
|
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
590 |
return has_refs_into_cset; |
1374 | 591 |
} |
592 |
||
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
19339
diff
changeset
|
593 |
void G1RemSet::print_periodic_summary_info(const char* header) { |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
594 |
G1RemSetSummary current; |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
20309
diff
changeset
|
595 |
current.initialize(this); |
1374 | 596 |
|
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
597 |
_prev_period_summary.subtract_from(¤t); |
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
19339
diff
changeset
|
598 |
print_summary_info(&_prev_period_summary, header); |
1374 | 599 |
|
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
600 |
_prev_period_summary.set(¤t); |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
601 |
} |
2881 | 602 |
|
6958 | 603 |
void G1RemSet::print_summary_info() { |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
604 |
G1RemSetSummary current; |
20310
903b398490d9
8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents:
20309
diff
changeset
|
605 |
current.initialize(this); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
606 |
|
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
607 |
print_summary_info(¤t, " Cumulative RS summary"); |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
608 |
} |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
609 |
|
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
610 |
void G1RemSet::print_summary_info(G1RemSetSummary * summary, const char * header) { |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
611 |
assert(summary != NULL, "just checking"); |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
612 |
|
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
613 |
if (header != NULL) { |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
614 |
gclog_or_tty->print_cr("%s", header); |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
615 |
} |
1374 | 616 |
|
617 |
#if CARD_REPEAT_HISTO |
|
618 |
gclog_or_tty->print_cr("\nG1 card_repeat count histogram: "); |
|
619 |
gclog_or_tty->print_cr(" # of repeats --> # of cards with that number."); |
|
620 |
card_repeat_count.print_on(gclog_or_tty); |
|
621 |
#endif |
|
622 |
||
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
17327
diff
changeset
|
623 |
summary->print_on(gclog_or_tty); |
1374 | 624 |
} |
6247 | 625 |
|
6958 | 626 |
void G1RemSet::prepare_for_verify() { |
2249
fb8abed44792
6817419: G1: Enable extensive verification for humongous regions
iveresov
parents:
2152
diff
changeset
|
627 |
if (G1HRRSFlushLogBuffersOnVerify && |
fb8abed44792
6817419: G1: Enable extensive verification for humongous regions
iveresov
parents:
2152
diff
changeset
|
628 |
(VerifyBeforeGC || VerifyAfterGC) |
17855
9d0719d7bb85
8015244: G1: Verification after a full GC is incorrectly placed.
johnc
parents:
17854
diff
changeset
|
629 |
&& (!_g1->full_collection() || G1VerifyRSetsDuringFullGC)) { |
1374 | 630 |
cleanupHRRS(); |
631 |
_g1->set_refine_cte_cl_concurrency(false); |
|
632 |
if (SafepointSynchronize::is_at_safepoint()) { |
|
633 |
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); |
|
634 |
dcqs.concatenate_logs(); |
|
635 |
} |
|
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
636 |
|
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
637 |
G1HotCardCache* hot_card_cache = _cg1r->hot_card_cache(); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
638 |
bool use_hot_card_cache = hot_card_cache->use_cache(); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
639 |
hot_card_cache->set_use_cache(false); |
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
640 |
|
6247 | 641 |
DirtyCardQueue into_cset_dcq(&_g1->into_cset_dirty_card_queue_set()); |
642 |
updateRS(&into_cset_dcq, 0); |
|
643 |
_g1->into_cset_dirty_card_queue_set().clear(); |
|
2249
fb8abed44792
6817419: G1: Enable extensive verification for humongous regions
iveresov
parents:
2152
diff
changeset
|
644 |
|
17327
4bd0581aa231
7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
17108
diff
changeset
|
645 |
hot_card_cache->set_use_cache(use_hot_card_cache); |
2249
fb8abed44792
6817419: G1: Enable extensive verification for humongous regions
iveresov
parents:
2152
diff
changeset
|
646 |
assert(JavaThread::dirty_card_queue_set().completed_buffers_num() == 0, "All should be consumed"); |
1374 | 647 |
} |
648 |
} |