mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
6883834: ParNew: assert(!_g->to()->is_in_reserved(obj),"Scanning field twice?") with LargeObjects tests
Fixed process_chunk_boundaries(), used for parallel card scanning when using ParNew/CMS, so as to prevent double-scanning, or worse, non-scanning of imprecisely marked objects exceeding parallel chunk size. Made some sizing parameters for parallel card scanning diagnostic, disabled ParallelGCRetainPLAB, and elaborated and clarified some comments. Reviewed-by: stefank, johnc
This commit is contained in:
parent
90ab9d500c
commit
8e56205189
8 changed files with 297 additions and 140 deletions
|
@ -173,18 +173,17 @@ class CardTableModRefBS: public ModRefBarrierSet {
|
|||
// A variant of the above that will operate in a parallel mode if
|
||||
// worker threads are available, and clear the dirty cards as it
|
||||
// processes them.
|
||||
// ClearNoncleanCardWrapper cl must wrap the DirtyCardToOopClosure dcto_cl,
|
||||
// which may itself be modified by the method.
|
||||
// XXX ??? MemRegionClosure above vs OopsInGenClosure below XXX
|
||||
// XXX some new_dcto_cl's take OopClosure's, plus as above there are
|
||||
// some MemRegionClosures. Clean this up everywhere. XXX
|
||||
void non_clean_card_iterate_possibly_parallel(Space* sp, MemRegion mr,
|
||||
DirtyCardToOopClosure* dcto_cl,
|
||||
ClearNoncleanCardWrapper* cl);
|
||||
OopsInGenClosure* cl, CardTableRS* ct);
|
||||
|
||||
private:
|
||||
// Work method used to implement non_clean_card_iterate_possibly_parallel()
|
||||
// above in the parallel case.
|
||||
void non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
|
||||
DirtyCardToOopClosure* dcto_cl,
|
||||
ClearNoncleanCardWrapper* cl,
|
||||
OopsInGenClosure* cl, CardTableRS* ct,
|
||||
int n_threads);
|
||||
|
||||
protected:
|
||||
|
@ -198,11 +197,6 @@ class CardTableModRefBS: public ModRefBarrierSet {
|
|||
|
||||
// *** Support for parallel card scanning.
|
||||
|
||||
enum SomeConstantsForParallelism {
|
||||
StridesPerThread = 2,
|
||||
CardsPerStrideChunk = 256
|
||||
};
|
||||
|
||||
// This is an array, one element per covered region of the card table.
|
||||
// Each entry is itself an array, with one element per chunk in the
|
||||
// covered region. Each entry of these arrays is the lowest non-clean
|
||||
|
@ -235,7 +229,7 @@ class CardTableModRefBS: public ModRefBarrierSet {
|
|||
// covers the given address.
|
||||
uintptr_t addr_to_chunk_index(const void* addr) {
|
||||
uintptr_t card = (uintptr_t) byte_for(addr);
|
||||
return card / CardsPerStrideChunk;
|
||||
return card / ParGCCardsPerStrideChunk;
|
||||
}
|
||||
|
||||
// Apply cl, which must either itself apply dcto_cl or be dcto_cl,
|
||||
|
@ -243,8 +237,8 @@ class CardTableModRefBS: public ModRefBarrierSet {
|
|||
void process_stride(Space* sp,
|
||||
MemRegion used,
|
||||
jint stride, int n_strides,
|
||||
DirtyCardToOopClosure* dcto_cl,
|
||||
ClearNoncleanCardWrapper* cl,
|
||||
OopsInGenClosure* cl,
|
||||
CardTableRS* ct,
|
||||
jbyte** lowest_non_clean,
|
||||
uintptr_t lowest_non_clean_base_chunk_index,
|
||||
size_t lowest_non_clean_chunk_size);
|
||||
|
@ -482,7 +476,7 @@ public:
|
|||
void verify_dirty_region(MemRegion mr) PRODUCT_RETURN;
|
||||
|
||||
static size_t par_chunk_heapword_alignment() {
|
||||
return CardsPerStrideChunk * card_size_in_words;
|
||||
return ParGCCardsPerStrideChunk * card_size_in_words;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue