8283935: Parallel: Crash during pretouch after large pages allocation failure
Reviewed-by: kbarrett, ayang
This commit is contained in:
parent
0a67d68670
commit
b56df2808d
@ -589,7 +589,7 @@ void MutableNUMASpace::initialize(MemRegion mr,
|
|||||||
|
|
||||||
// Compute chunk sizes
|
// Compute chunk sizes
|
||||||
size_t prev_page_size = page_size();
|
size_t prev_page_size = page_size();
|
||||||
set_page_size(UseLargePages ? alignment() : os::vm_page_size());
|
set_page_size(alignment());
|
||||||
HeapWord* rounded_bottom = align_up(bottom(), page_size());
|
HeapWord* rounded_bottom = align_up(bottom(), page_size());
|
||||||
HeapWord* rounded_end = align_down(end(), page_size());
|
HeapWord* rounded_end = align_down(end(), page_size());
|
||||||
size_t base_space_size_pages = pointer_delta(rounded_end, rounded_bottom, sizeof(char)) / page_size();
|
size_t base_space_size_pages = pointer_delta(rounded_end, rounded_bottom, sizeof(char)) / page_size();
|
||||||
|
@ -52,9 +52,8 @@ MutableSpace::~MutableSpace() {
|
|||||||
delete _mangler;
|
delete _mangler;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MutableSpace::numa_setup_pages(MemRegion mr, bool clear_space) {
|
void MutableSpace::numa_setup_pages(MemRegion mr, size_t page_size, bool clear_space) {
|
||||||
if (!mr.is_empty()) {
|
if (!mr.is_empty()) {
|
||||||
size_t page_size = UseLargePages ? alignment() : os::vm_page_size();
|
|
||||||
HeapWord *start = align_up(mr.start(), page_size);
|
HeapWord *start = align_up(mr.start(), page_size);
|
||||||
HeapWord *end = align_down(mr.end(), page_size);
|
HeapWord *end = align_down(mr.end(), page_size);
|
||||||
if (end > start) {
|
if (end > start) {
|
||||||
@ -113,14 +112,14 @@ void MutableSpace::initialize(MemRegion mr,
|
|||||||
}
|
}
|
||||||
assert(mr.contains(head) && mr.contains(tail), "Sanity");
|
assert(mr.contains(head) && mr.contains(tail), "Sanity");
|
||||||
|
|
||||||
|
size_t page_size = alignment();
|
||||||
|
|
||||||
if (UseNUMA) {
|
if (UseNUMA) {
|
||||||
numa_setup_pages(head, clear_space);
|
numa_setup_pages(head, page_size, clear_space);
|
||||||
numa_setup_pages(tail, clear_space);
|
numa_setup_pages(tail, page_size, clear_space);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AlwaysPreTouch) {
|
if (AlwaysPreTouch) {
|
||||||
size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
|
|
||||||
|
|
||||||
PretouchTask::pretouch("ParallelGC PreTouch head", (char*)head.start(), (char*)head.end(),
|
PretouchTask::pretouch("ParallelGC PreTouch head", (char*)head.start(), (char*)head.end(),
|
||||||
page_size, pretouch_workers);
|
page_size, pretouch_workers);
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ class MutableSpace: public CHeapObj<mtGC> {
|
|||||||
|
|
||||||
MutableSpaceMangler* mangler() { return _mangler; }
|
MutableSpaceMangler* mangler() { return _mangler; }
|
||||||
|
|
||||||
void numa_setup_pages(MemRegion mr, bool clear_space);
|
void numa_setup_pages(MemRegion mr, size_t page_size, bool clear_space);
|
||||||
|
|
||||||
void set_last_setup_region(MemRegion mr) { _last_setup_region = mr; }
|
void set_last_setup_region(MemRegion mr) { _last_setup_region = mr; }
|
||||||
MemRegion last_setup_region() const { return _last_setup_region; }
|
MemRegion last_setup_region() const { return _last_setup_region; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user