RFR: 8080869: FlexibleWorkGang initializes _active_workers to more than _total_workers

Jon Masamitsu jon.masamitsu at oracle.com
Thu May 21 17:43:51 UTC 2015


Change looks good.  Reviewed.

Jon

On 05/21/2015 05:28 AM, Stefan Karlsson wrote:
> Hi all,
>
> Please, review this small patch to fix the initialization of 
> FlexibleWorkGang::_active_workers.
>
> http://cr.openjdk.java.net/~stefank/8080869/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8080869
>
> From the bug report:
> -------------------------------------------------------------------------------- 
>
> This is the FlexibleWorkGang constructor:
>
>   FlexibleWorkGang(const char* name, uint workers,
>                    bool are_GC_task_threads,
>                    bool  are_ConcurrentGC_threads) :
>     WorkGang(name, workers, are_GC_task_threads, 
> are_ConcurrentGC_threads),
>     _active_workers(UseDynamicNumberOfGCThreads ? 1U : 
> ParallelGCThreads) {}
>
> and the WorkGang constructor:
>
> WorkGang::WorkGang(const char* name,
>                    uint        workers,
>                    bool        are_GC_task_threads,
>                    bool        are_ConcurrentGC_threads) :
>   AbstractWorkGang(name, are_GC_task_threads, are_ConcurrentGC_threads) {
>   _total_workers = workers;
> }
>
> If 'workers' are less than ParallelGCThreads, then _active_workers 
> will be set to a value that is greater than _total_workers (unless we 
> run with UseDynamicNumberOfGCThreads). Both G1 and CMS typically sets 
> the number of concurrent workers to a value below ParallelGCThreads.
>
> This is currently a benign bug, since the GCs will later calculate a 
> new value for _active_workers that will never be higher than 
> _total_workers.
>
> However, this bug impedes stricter asserts and should be fixed.
> -------------------------------------------------------------------------------- 
>
>
> Thanks,
> StefanK



More information about the hotspot-gc-dev mailing list