RFR: 8080876: Replace unnecessary MAX2(ParallelGCThreads, 1) calls with ParallelGCThreads

Mikael Gerdin mikael.gerdin at oracle.com
Fri May 22 08:47:14 UTC 2015


Stefan,

On May 21, 2015 8:25:17 PM Stefan Karlsson <stefan.karlsson at oracle.com> wrote:

> On 2015-05-21 19:41, Kim Barrett wrote:
> > On May 21, 2015, at 10:20 AM, Stefan Karlsson 
> <stefan.karlsson at oracle.com> wrote:
> >> Hi all,
> >>
> >> Please, review this patch to replace instances of 
> MAX2(ParallelGCThreads, 1) with ParallelGCThreads, in G1 and CMS code.
> >>
> >> The patch also contains a few small cleanups around the setup of the 
> ReferenceProcessors, just to make the code consistent over the collectors.
> >>
> >> http://cr.openjdk.java.net/~stefank/8080876/webrev.00/
> >> https://bugs.openjdk.java.net/browse/JDK-8080876
> >>
> >> Thanks,
> >> StefanK
> > 
> ------------------------------------------------------------------------------
> > src/share/vm/gc/g1/g1CollectedHeap.cpp
> > 2488   uint n_queues = (uint)ParallelGCThreads;
> > 2489   for (uint i = 0; i < n_queues; i++) {
> >
> > Why not just
> >
> >      for (uint i = 0; i < ParallelGCThreads; ++i) {
> >
> > That way, the person who fixes the type of ParallelGCThreads won't
> > need to consider making any changes here.
> >
> > Similarly at line 3847.
>
> Sure.
>
> >
> > 
> ------------------------------------------------------------------------------
> > src/share/vm/gc/g1/g1StringDedupQueue.cpp
> >    45   _nqueues = (size_t)ParallelGCThreads;
> >
> > I think a cast is inappropriate here.
>
> OK.
>
> >
> > 
> ------------------------------------------------------------------------------
> > src/share/vm/gc/g1/g1StringDedupTable.cpp
> >   115   _nlists = (size_t)ParallelGCThreads;
> >
> > I think a cast is inappropriate here.
>
> OK.
> >
> > 
> ------------------------------------------------------------------------------
> >
>
> I'll add your proposed changes.

The change looks good to me.
/Mikael

>
> Thanks for the review,
> StefanK




More information about the hotspot-gc-dev mailing list