< prev index next >

src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp

Print this page
rev 6992 : 8062063: Usage of UseHugeTLBFS, UseLargePagesInMetaspace and huge SurvivorAlignmentInBytes cause crashes in CMBitMapClosure::do_bit
Summary: Making sure committed memory is cleared when re-committed, even if using large pages.
Reviewed-by: kbarrett, tschatzl

*** 65,77 **** guarantee(alloc_granularity >= os_commit_granularity, "allocation granularity smaller than commit granularity"); _commit_map.resize(rs.size() * commit_factor / alloc_granularity, /* in_resource_area */ false); } virtual void commit_regions(uintptr_t start_idx, size_t num_regions) { ! _storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region); _commit_map.set_range(start_idx, start_idx + num_regions); ! fire_on_commit(start_idx, num_regions, true); } virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) { _storage.uncommit(start_idx * _pages_per_region, num_regions * _pages_per_region); _commit_map.clear_range(start_idx, start_idx + num_regions); --- 65,77 ---- guarantee(alloc_granularity >= os_commit_granularity, "allocation granularity smaller than commit granularity"); _commit_map.resize(rs.size() * commit_factor / alloc_granularity, /* in_resource_area */ false); } virtual void commit_regions(uintptr_t start_idx, size_t num_regions) { ! bool zero_filled = _storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region); _commit_map.set_range(start_idx, start_idx + num_regions); ! fire_on_commit(start_idx, num_regions, zero_filled); } virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) { _storage.uncommit(start_idx * _pages_per_region, num_regions * _pages_per_region); _commit_map.clear_range(start_idx, start_idx + num_regions);
*** 115,126 **** assert(!_commit_map.at(i), err_msg("Trying to commit storage at region "INTPTR_FORMAT" that is already committed", i)); uintptr_t idx = region_idx_to_page_idx(i); uint old_refcount = _refcounts.get_by_index(idx); bool zero_filled = false; if (old_refcount == 0) { ! _storage.commit(idx, 1); ! zero_filled = true; } _refcounts.set_by_index(idx, old_refcount + 1); _commit_map.set_bit(i); fire_on_commit(i, 1, zero_filled); } --- 115,125 ---- assert(!_commit_map.at(i), err_msg("Trying to commit storage at region "INTPTR_FORMAT" that is already committed", i)); uintptr_t idx = region_idx_to_page_idx(i); uint old_refcount = _refcounts.get_by_index(idx); bool zero_filled = false; if (old_refcount == 0) { ! zero_filled = _storage.commit(idx, 1); } _refcounts.set_by_index(idx, old_refcount + 1); _commit_map.set_bit(i); fire_on_commit(i, 1, zero_filled); }
< prev index next >