<div dir="ltr">Hi Thomas,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 7, 2016 at 8:50 AM, Thomas Schatzl <span dir="ltr"><<a href="mailto:thomas.schatzl@oracle.com" target="_blank">thomas.schatzl@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Vitaly,<br>
<span class=""><br>
On Wed, 2016-09-07 at 10:54 +0000, Vitaly Davidovich wrote:<br>
> Hi Thomas,<br>
><br>
> Why does the G1PretouchTask use an atomic ptr add to advance the<br>
> touch address?<br>
<br>
</span> to make sure that a particular thread gets a unique page to touch. <br>
<br>
Otherwise multiple threads might get the same. While this is not a<br>
correctness issue, it's useless work. Also the OS will likely let all<br>
but the first thread wait until the page has been allocated and cleared<br>
until they can proceed. I.e. the threads will be serialized again.<br></blockquote><div>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? </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Thanks,<br>
Thomas<br>
<br></blockquote><div>Thanks </div></div><br></div></div>