< prev index next >

src/hotspot/share/gc/g1/heterogeneousHeapRegionManager.cpp

Print this page
rev 56323 : imported patch 8220310.mut.0
rev 56324 : imported patch 8220310.mut.1_thomas
rev 56326 : [mq]: 8220310.mut.1-3_kim

*** 1,7 **** /* ! * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 56,75 **** } // expand_by() is called to grow the heap. We grow into nvdimm now. // Dram regions are committed later as needed during mutator region allocation or // when young list target length is determined after gc cycle. ! uint HeterogeneousHeapRegionManager::expand_by(uint num_regions, WorkGang* pretouch_workers) { uint num_regions_possible = total_regions_committed() >= max_expandable_length() ? 0 : max_expandable_length() - total_regions_committed(); uint num_expanded = expand_nvdimm(MIN2(num_regions, num_regions_possible), pretouch_workers); return num_expanded; } // Expands heap starting from 'start' index. The question is should we expand from one memory (e.g. nvdimm) to another (e.g. dram). // Looking at the code, expand_at() is called for humongous allocation where 'start' is in nv-dimm. // So we only allocate regions in the same kind of memory as 'start'. ! uint HeterogeneousHeapRegionManager::expand_at(uint start, uint num_regions, WorkGang* pretouch_workers) { if (num_regions == 0) { return 0; } uint target_num_regions = MIN2(num_regions, max_expandable_length() - total_regions_committed()); uint end = is_in_nvdimm(start) ? end_index_of_nvdimm() : end_index_of_dram(); --- 56,75 ---- } // expand_by() is called to grow the heap. We grow into nvdimm now. // Dram regions are committed later as needed during mutator region allocation or // when young list target length is determined after gc cycle. ! uint HeterogeneousHeapRegionManager::expand_by(uint num_regions, uint node_index, WorkGang* pretouch_workers) { uint num_regions_possible = total_regions_committed() >= max_expandable_length() ? 0 : max_expandable_length() - total_regions_committed(); uint num_expanded = expand_nvdimm(MIN2(num_regions, num_regions_possible), pretouch_workers); return num_expanded; } // Expands heap starting from 'start' index. The question is should we expand from one memory (e.g. nvdimm) to another (e.g. dram). // Looking at the code, expand_at() is called for humongous allocation where 'start' is in nv-dimm. // So we only allocate regions in the same kind of memory as 'start'. ! uint HeterogeneousHeapRegionManager::expand_at(uint start, uint num_regions, uint node_index, WorkGang* pretouch_workers) { if (num_regions == 0) { return 0; } uint target_num_regions = MIN2(num_regions, max_expandable_length() - total_regions_committed()); uint end = is_in_nvdimm(start) ? end_index_of_nvdimm() : end_index_of_dram();
*** 188,198 **** uint chunk_start = 0; uint num_last_found = 0; while (so_far < num_regions && (num_last_found = find_unavailable_in_range(start, end, &chunk_start)) > 0) { uint to_commit = MIN2(num_regions - so_far, num_last_found); ! make_regions_available(chunk_start, to_commit, pretouch_gang); so_far += to_commit; start = chunk_start + to_commit + 1; } return so_far; --- 188,198 ---- uint chunk_start = 0; uint num_last_found = 0; while (so_far < num_regions && (num_last_found = find_unavailable_in_range(start, end, &chunk_start)) > 0) { uint to_commit = MIN2(num_regions - so_far, num_last_found); ! make_regions_available(chunk_start, to_commit, G1MemoryNodeManager::AnyNodeIndex, pretouch_gang); so_far += to_commit; start = chunk_start + to_commit + 1; } return so_far;
*** 261,271 **** } #endif return num_regions_found; } ! HeapRegion* HeterogeneousHeapRegionManager::allocate_free_region(HeapRegionType type) { // We want to prevent mutators from proceeding when we have borrowed regions from the last collection. This // will force a full collection to remedy the situation. // Free region requests from GC threads can proceed. if(type.is_eden() || type.is_humongous()) { --- 261,271 ---- } #endif return num_regions_found; } ! HeapRegion* HeterogeneousHeapRegionManager::allocate_free_region(HeapRegionType type, uint node_index) { // We want to prevent mutators from proceeding when we have borrowed regions from the last collection. This // will force a full collection to remedy the situation. // Free region requests from GC threads can proceed. if(type.is_eden() || type.is_humongous()) {
< prev index next >