RFR (S): 8067469: G1 ignores AlwaysPreTouch
thomas.schatzl at oracle.com
Wed Dec 17 13:42:52 UTC 2014
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
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
I also changed the actual access to what Erik suggested to be easier
More information about the hotspot-runtime-dev