提交 c958ef94 编写于 作者: J jmasa

8021809: Partitioning based on eden sampling during allocation not reset correctly

Reviewed-by: ysr, hiroshi
上级 80cf1b33
...@@ -5478,40 +5478,42 @@ CMSParMarkTask::do_young_space_rescan(uint worker_id, ...@@ -5478,40 +5478,42 @@ CMSParMarkTask::do_young_space_rescan(uint worker_id,
HandleMark hm; HandleMark hm;
SequentialSubTasksDone* pst = space->par_seq_tasks(); SequentialSubTasksDone* pst = space->par_seq_tasks();
assert(pst->valid(), "Uninitialized use?");
uint nth_task = 0; uint nth_task = 0;
uint n_tasks = pst->n_tasks(); uint n_tasks = pst->n_tasks();
HeapWord *start, *end; if (n_tasks > 0) {
while (!pst->is_task_claimed(/* reference */ nth_task)) { assert(pst->valid(), "Uninitialized use?");
// We claimed task # nth_task; compute its boundaries. HeapWord *start, *end;
if (chunk_top == 0) { // no samples were taken while (!pst->is_task_claimed(/* reference */ nth_task)) {
assert(nth_task == 0 && n_tasks == 1, "Can have only 1 EdenSpace task"); // We claimed task # nth_task; compute its boundaries.
start = space->bottom(); if (chunk_top == 0) { // no samples were taken
end = space->top(); assert(nth_task == 0 && n_tasks == 1, "Can have only 1 EdenSpace task");
} else if (nth_task == 0) { start = space->bottom();
start = space->bottom(); end = space->top();
end = chunk_array[nth_task]; } else if (nth_task == 0) {
} else if (nth_task < (uint)chunk_top) { start = space->bottom();
assert(nth_task >= 1, "Control point invariant"); end = chunk_array[nth_task];
start = chunk_array[nth_task - 1]; } else if (nth_task < (uint)chunk_top) {
end = chunk_array[nth_task]; assert(nth_task >= 1, "Control point invariant");
} else { start = chunk_array[nth_task - 1];
assert(nth_task == (uint)chunk_top, "Control point invariant"); end = chunk_array[nth_task];
start = chunk_array[chunk_top - 1]; } else {
end = space->top(); assert(nth_task == (uint)chunk_top, "Control point invariant");
} start = chunk_array[chunk_top - 1];
MemRegion mr(start, end); end = space->top();
// Verify that mr is in space }
assert(mr.is_empty() || space->used_region().contains(mr), MemRegion mr(start, end);
"Should be in space"); // Verify that mr is in space
// Verify that "start" is an object boundary assert(mr.is_empty() || space->used_region().contains(mr),
assert(mr.is_empty() || oop(mr.start())->is_oop(), "Should be in space");
"Should be an oop"); // Verify that "start" is an object boundary
space->par_oop_iterate(mr, cl); assert(mr.is_empty() || oop(mr.start())->is_oop(),
"Should be an oop");
space->par_oop_iterate(mr, cl);
}
pst->all_tasks_completed();
} }
pst->all_tasks_completed();
} }
void void
...@@ -5788,7 +5790,7 @@ initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) { ...@@ -5788,7 +5790,7 @@ initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) {
DefNewGeneration* dng = (DefNewGeneration*)_young_gen; DefNewGeneration* dng = (DefNewGeneration*)_young_gen;
// Eden space // Eden space
{ if (!dng->eden()->is_empty()) {
SequentialSubTasksDone* pst = dng->eden()->par_seq_tasks(); SequentialSubTasksDone* pst = dng->eden()->par_seq_tasks();
assert(!pst->valid(), "Clobbering existing data?"); assert(!pst->valid(), "Clobbering existing data?");
// Each valid entry in [0, _eden_chunk_index) represents a task. // Each valid entry in [0, _eden_chunk_index) represents a task.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册