RFR (M): 8157952: Parallelize Memory Pretouch

Vitaly Davidovich vitalyd at gmail.com
Wed Sep 7 13:01:12 UTC 2016

Hi Thomas,

On Wed, Sep 7, 2016 at 8:50 AM, Thomas Schatzl <thomas.schatzl at oracle.com>

> Hi Vitaly,
> On Wed, 2016-09-07 at 10:54 +0000, Vitaly Davidovich wrote:
> > Hi Thomas,
> >
> > Why does the G1PretouchTask use an atomic ptr add to advance the
> > touch address?
>   to make sure that a particular thread gets a unique page to touch.
> Otherwise multiple threads might get the same. While this is not a
> correctness issue, it's useless work. Also the OS will likely let all
> but the first thread wait until the page has been allocated and cleared
> until they can proceed. I.e. the threads will be serialized again.
Oh, I thought each pretouch task is assigned a range of memory to pretouch
when its constructed, but apparently they all just "compete" to claim the
next chunk.  Not a big deal, but is there a reason you chose to do it that
way instead of assigning disjoint ranges to the workers before starting the
pretouch? Is it to avoid work imbalance or something?

> Thanks,
>   Thomas
> Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20160907/dc1c7ca9/attachment.html>

More information about the hotspot-gc-dev mailing list