<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div class="h5">
> >>> - in concurrentMarkSweepGeneration.cpp in<br>
> >>> CMSCollector::checkpointRootsInitialWork() the new code seems a little<br>
> >>> strange to me. I.e. roughly it does the following:<br>
> >>><br>
> >>> [...]<br>
> >>> if (CMSParallelInitialMarkEnabled) {<br>
> >>> [ set up parallel stuff ]<br>
> >>> if (n_workers > 1) {<br>
> >>> // do parallel thread<br>
> >>> } else {<br>
> >>> // do serial work using the current thread<br>
> >>> }<br>
> >>> } else {<br>
> >>> // do serial work<br>
> >>> }<br>
> >>><br>
> >>> it does not feel good to have two serial paths here; maybe use the<br>
> >>> serial/original code if n_workers == 1 and guarantee(n_workers > 1, ) in<br>
> >>> the first part of the if? Or look if the old serial path could be<br>
> >>> removed? (or the new one).<br>
> >> Is the inner serial path one thread executing a single chunk that<br>
> >> does all the work (i.e., executes the parallel code but by only<br>
> >> one thread)?<br>
> > Yes, that is in my opinion a little awkward. It would be nice if we had<br>
> > only one serial initial marking code path to simplify<br>
> > debugging/maintenance if there are issues. Removal of one or the other<br>
> > (if so) probably depends on how different the performance between the<br>
> > two paths is.<br>
><br>
> I would prefer not to remove the path that executes the parallel code<br>
> with a single thread. It is a tool for looking for performance anomalies<br>
> in the parallel code. I've used code like it (i.e., executes parallel<br>
> code in<br>
> one thread in UseParallelGC and UseParNewGC) this week while looking<br>
> for a performance problem.<br>
><br>
> The strictly serial path (which is the code we have today) would be nice<br>
> to have for a while as a workaround for any problems.<br>
<br>
</div></div>Okay, fair enough.<br>
<div class="im"><br></div></blockquote><div><br></div><div style>I'll keep the code as is, keeping the two serial code paths. To add my 2 cents, I think a similar pattern existed in the CMS code (eg. CMSCollector::do_remark_parallel()), and that's probably why I followed the same pattern there.</div>
<div style><br></div></div></div></div>