--- old/src/hotspot/share/gc/g1/heapRegionManager.hpp 2019-09-30 17:13:14.016029299 -0700 +++ new/src/hotspot/share/gc/g1/heapRegionManager.hpp 2019-09-30 17:13:13.652029312 -0700 @@ -108,6 +108,9 @@ // sequence could be found, otherwise res_idx contains the start index of this range. uint find_empty_from_idx_reverse(uint start_idx, uint* res_idx) const; + // Checks the G1MemoryNodeManager to see if this region is on the preferred node. + bool is_on_preferred_index(uint region_index, uint preferred_node_index); + protected: G1HeapRegionTable _regions; G1RegionToSpaceMapper* _heap_mapper; @@ -174,15 +177,8 @@ _free_list.add_ordered(list); } - virtual HeapRegion* allocate_free_region(HeapRegionType type) { - HeapRegion* hr = _free_list.remove_region(!type.is_young()); - - if (hr != NULL) { - assert(hr->next() == NULL, "Single region should not have next"); - assert(is_available(hr->hrm_index()), "Must be committed"); - } - return hr; - } + // Allocate a free region with specific node index. If fails allocate with next node index. + virtual HeapRegion* allocate_free_region(HeapRegionType type, uint requested_node_index); inline void allocate_free_regions_starting_at(uint first, uint num_regions); @@ -227,6 +223,9 @@ // this. virtual uint expand_at(uint start, uint num_regions, WorkGang* pretouch_workers); + // Try to expand on the given node index. + virtual uint expand_on_preferred_node(uint node_index); + // Find a contiguous set of empty regions of length num. Returns the start index of // that set, or G1_NO_HRM_INDEX. virtual uint find_contiguous_only_empty(size_t num) { return find_contiguous(num, true); }