Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 8006:4700e77d44c1
8006894: G1: Number of marking threads missing from PrintFlagsFinal output
Summary: Set ConcGCThreads to the calculated number of marking threads.
Reviewed-by: jmasa, ysr
author | johnc |
---|---|
date | Fri, 01 Feb 2013 13:17:04 -0800 |
parents | d275c3dc73e6 |
children | 256d3f43c177 |
comparison
equal
deleted
inserted
replaced
8005:ec0c4951286c | 8006:4700e77d44c1 |
---|---|
569 _parallel_marking_threads = 0; | 569 _parallel_marking_threads = 0; |
570 _max_parallel_marking_threads = 0; | 570 _max_parallel_marking_threads = 0; |
571 _sleep_factor = 0.0; | 571 _sleep_factor = 0.0; |
572 _marking_task_overhead = 1.0; | 572 _marking_task_overhead = 1.0; |
573 } else { | 573 } else { |
574 if (ConcGCThreads > 0) { | 574 if (!FLAG_IS_DEFAULT(ConcGCThreads) && ConcGCThreads > 0) { |
575 // notice that ConcGCThreads overwrites G1MarkingOverheadPercent | 575 // Note: ConcGCThreads has precedence over G1MarkingOverheadPercent |
576 // if both are set | 576 // if both are set |
577 | |
578 _parallel_marking_threads = (uint) ConcGCThreads; | |
579 _max_parallel_marking_threads = _parallel_marking_threads; | |
580 _sleep_factor = 0.0; | 577 _sleep_factor = 0.0; |
581 _marking_task_overhead = 1.0; | 578 _marking_task_overhead = 1.0; |
582 } else if (G1MarkingOverheadPercent > 0) { | 579 } else if (G1MarkingOverheadPercent > 0) { |
583 // we will calculate the number of parallel marking threads | 580 // We will calculate the number of parallel marking threads based |
584 // based on a target overhead with respect to the soft real-time | 581 // on a target overhead with respect to the soft real-time goal |
585 // goal | |
586 | |
587 double marking_overhead = (double) G1MarkingOverheadPercent / 100.0; | 582 double marking_overhead = (double) G1MarkingOverheadPercent / 100.0; |
588 double overall_cm_overhead = | 583 double overall_cm_overhead = |
589 (double) MaxGCPauseMillis * marking_overhead / | 584 (double) MaxGCPauseMillis * marking_overhead / |
590 (double) GCPauseIntervalMillis; | 585 (double) GCPauseIntervalMillis; |
591 double cpu_ratio = 1.0 / (double) os::processor_count(); | 586 double cpu_ratio = 1.0 / (double) os::processor_count(); |
594 overall_cm_overhead / marking_thread_num * | 589 overall_cm_overhead / marking_thread_num * |
595 (double) os::processor_count(); | 590 (double) os::processor_count(); |
596 double sleep_factor = | 591 double sleep_factor = |
597 (1.0 - marking_task_overhead) / marking_task_overhead; | 592 (1.0 - marking_task_overhead) / marking_task_overhead; |
598 | 593 |
599 _parallel_marking_threads = (uint) marking_thread_num; | 594 FLAG_SET_ERGO(uintx, ConcGCThreads, (uint) marking_thread_num); |
600 _max_parallel_marking_threads = _parallel_marking_threads; | |
601 _sleep_factor = sleep_factor; | 595 _sleep_factor = sleep_factor; |
602 _marking_task_overhead = marking_task_overhead; | 596 _marking_task_overhead = marking_task_overhead; |
603 } else { | 597 } else { |
604 _parallel_marking_threads = scale_parallel_threads((uint)ParallelGCThreads); | 598 // Calculate the number of parallel marking threads by scaling |
605 _max_parallel_marking_threads = _parallel_marking_threads; | 599 // the number of parallel GC threads. |
600 uint marking_thread_num = scale_parallel_threads((uint) ParallelGCThreads); | |
601 FLAG_SET_ERGO(uintx, ConcGCThreads, marking_thread_num); | |
606 _sleep_factor = 0.0; | 602 _sleep_factor = 0.0; |
607 _marking_task_overhead = 1.0; | 603 _marking_task_overhead = 1.0; |
608 } | 604 } |
605 | |
606 assert(ConcGCThreads > 0, "Should have been set"); | |
607 _parallel_marking_threads = (uint) ConcGCThreads; | |
608 _max_parallel_marking_threads = _parallel_marking_threads; | |
609 | 609 |
610 if (parallel_marking_threads() > 1) { | 610 if (parallel_marking_threads() > 1) { |
611 _cleanup_task_overhead = 1.0; | 611 _cleanup_task_overhead = 1.0; |
612 } else { | 612 } else { |
613 _cleanup_task_overhead = marking_task_overhead(); | 613 _cleanup_task_overhead = marking_task_overhead(); |