mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-25 01:30:10 +00:00
8204618: The parallel GC reference processing task executor enqueues a wrong number of tasks into the queue
Reviewed-by: sangheki, kbarrett
This commit is contained in:
parent
9455a89d47
commit
b06d2b3ac3
@ -149,19 +149,16 @@ void RefProcTaskProxy::do_it(GCTaskManager* manager, uint which)
|
||||
void RefProcTaskExecutor::execute(ProcessTask& task)
|
||||
{
|
||||
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
|
||||
uint parallel_gc_threads = heap->gc_task_manager()->workers();
|
||||
uint active_gc_threads = heap->gc_task_manager()->active_workers();
|
||||
OopTaskQueueSet* qset = ParCompactionManager::stack_array();
|
||||
ParallelTaskTerminator terminator(active_gc_threads, qset);
|
||||
GCTaskQueue* q = GCTaskQueue::create();
|
||||
for(uint i=0; i<parallel_gc_threads; i++) {
|
||||
for(uint i=0; i<active_gc_threads; i++) {
|
||||
q->enqueue(new RefProcTaskProxy(task, i));
|
||||
}
|
||||
if (task.marks_oops_alive()) {
|
||||
if (parallel_gc_threads>1) {
|
||||
for (uint j=0; j<active_gc_threads; j++) {
|
||||
q->enqueue(new StealMarkingTask(&terminator));
|
||||
}
|
||||
if (task.marks_oops_alive() && (active_gc_threads>1)) {
|
||||
for (uint j=0; j<active_gc_threads; j++) {
|
||||
q->enqueue(new StealMarkingTask(&terminator));
|
||||
}
|
||||
}
|
||||
PSParallelCompact::gc_task_manager()->execute_and_wait(q);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user