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

8272773: Configurable card table card size #5838

Closed
wants to merge 12 commits into from
Closed
@@ -45,6 +45,9 @@ static size_t calculate_heap_alignment(size_t space_alignment) {
}

void G1Arguments::initialize_alignments() {
// Initialize card size before initializing alignments
CardTable::initialize_card_size();

// Set up the region size and associated fields.
//
// There is a circular dependency here. We base the region size on the heap
@@ -1660,7 +1660,7 @@ jint G1CollectedHeap::initialize() {

// The G1FromCardCache reserves card with value 0 as "invalid", so the heap must not
// start within the first card.
guarantee(heap_rs.base() >= (char*)(uintptr_t)(G1CardTable::card_size), "Java heap must not start within the first card.");
guarantee((uintptr_t)(heap_rs.base()) >= G1CardTable::card_size, "Java heap must not start within the first card.");
G1FromCardCache::initialize(max_reserved_regions());
// Also create a G1 rem set.
_rem_set = new G1RemSet(this, _card_table, _hot_card_cache);
@@ -90,9 +90,6 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_size) {
guarantee(GrainWords == 0, "we should only set it once");
GrainWords = GrainBytes >> LogHeapWordSize;

// Initialize card size
CardTable::initialize_card_size();

guarantee(CardsPerRegion == 0, "we should only set it once");
CardsPerRegion = GrainBytes >> G1CardTable::card_shift;

@@ -454,6 +454,7 @@ MemRegion CardTable::dirty_card_range_after_reset(MemRegion mr,
}

uintx CardTable::ct_max_alignment_constraint() {
// Calculate maximum alignment using GCCardSizeInBytes as card_size hasn't been set yet
return GCCardSizeInBytes * os::vm_page_size();
Copy link
Member

@albertnetymk albertnetymk Nov 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why card_size can't be used here is that card_size haven't been set when this method is called, correct? If so, please put a comment here.

}