RFR(S): 8215893: Add better abstraction for pinning G1 concurrent marking bitmaps.
Stefan Johansson
stefan.johansson at oracle.com
Mon Oct 7 13:41:21 UTC 2019
Hi Kishor,
On 2019-10-04 03:00, Kharbas, Kishor wrote:
> Hi,
>
> When I worked on JDK-8211425
> <https://bugs.openjdk.java.net/browse/JDK-8211425>, there was a request
> for better abstraction for pinning G1’s CM bitmaps. RFE for the request
> is here - JDK-8215893 <https://bugs.openjdk.java.net/browse/JDK-8215893>.
>
> Here is a proposal : http://cr.openjdk.java.net/~kkharbas/8215893/webrev.00/
>
> Here G1PageBasedVirtualSpace pins the entire reserved memory to memory
> during construction. The constructor takes an additional bool flag which
> says “does it need to pin the memory”.
>
> If the memory is pinned, ‘_special’ flag is set to true. I piggy back on
> _special flag’s behavior which is to not do actual OS (un-)commits on
> calls to (un)commit().
>
> Rest of the changes is the mechanism to pass this flag from CM bitmaps
> creation in G1CollectedHeap all the way to G1PageBasedVirtualSpace.
>
> Let me know if this is a good abstraction and if there is any better way.
>
I'm not sure I like this approach better, and even though I'm not super
fond of the commit_and_set_special function either, at least the old way
kept the pinning code quite isolated. Moving the commit_internal() call
into initialize_with_page_size() feels like a move in the wrong
direction. I'm not sure I have a much better idea, but one thing to try
would be to tell the underlying ReservedSpace that it should be
special/pinned even if it is not mapped with large pages. That way the
upper layers should just work.
Another thing, can you remind me why we need the bitmaps to be pinned
but not other structures such as the card table?
Thanks,
Stefan
> Thanks
>
> Kishor
>
More information about the hotspot-gc-dev
mailing list