RFR (S): 8067469: G1 ignores AlwaysPreTouch

Stefan Karlsson stefan.karlsson at oracle.com
Wed Dec 17 15:13:41 UTC 2014

On 2014-12-17 15:26, Thomas Schatzl wrote:
> Hi all,
> On Wed, 2014-12-17 at 14:42 +0100, Thomas Schatzl wrote:
>> Hi David,
>> On Wed, 2014-12-17 at 12:18 +1000, David Holmes wrote:
>>> Hi Thomas,
>>> On 16/12/2014 10:23 PM, Thomas Schatzl wrote:
>>>> Hi all,
>>>>     can I have reviews for the following small change?
>>>> It adds pre-touching of allocated memory in G1, which has been forgotten
>>>> to be implemented when changing this code in JDK-8038423.
>>>> This change adds this and refactors the pre-touch code to a single
>>>> method in the os class.
>>>> CC'ed runtime since it changes code in os.hpp/cpp.
>>> Just looking at that, we seem to be assuming/requiring that start and
>>> end are suitably page aligned and/or an integral number of pages apart -
>>> otherwise for an arbitrary pair of addresses it seems we could fail to
>>> touch the page containing end.
>>    this is indeed a problem. And we cannot assert this because code doing
>> the pre-touching and now calling this method, actually pass unaligned
>> (end) addresses.
>> The code to commit memory also may pass unaligned memory sizes (although
>> I guess the OS will round up anyway), so I think we should not align
>> ourselves here either.
>> I filed JDK-8067785 for that.
>> I added a comment about this for now, new webrev at
>> http://cr.openjdk.java.net/~tschatzl/8067469/webrev.1/
>> diff at
>> http://cr.openjdk.java.net/~tschatzl/8067469/webrev.0_to_1/
>> I also changed the actual access to what Erik suggested to be easier
>> understandable.
> After discussion with StefanK I changed the comment for the
> pretouch_memory() method slightly. I reuploaded the webrevs to the same
> locations.

Looks good.

> Thanks,
>    Thomas

More information about the hotspot-gc-dev mailing list