RFR: 8245203/8245204/8245208: ZGC: Don't hold the ZPageAllocator lock while committing/uncommitting memory

Per Liden per.liden at oracle.com
Mon Jun 1 05:32:27 UTC 2020


On 5/18/20 11:23 PM, Per Liden wrote:
[...]
> 3) 8245208: ZGC: Don't hold the ZPageAllocator lock while 
> committing/uncommitting memory
> 
> We're currently holding the ZPageAllocator lock while performing a 
> number of expensive operations, such as committing and uncommitting 
> memory. This can have a very negative impact on latency, for example, 
> when a Java thread is trying to allocate a page from the page cache 
> while the ZUncommitter thread is uncommitting a portion of the heap.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8245208
> Webrev: http://cr.openjdk.java.net/~pliden/8245208/webrev.0

Updated webrev based on feedback received so far. I've split the updates 
into many smaller ones for easier reviewing.

---------------

* Misc. smaller adjustments.
http://cr.openjdk.java.net/~pliden/8245208/webrev.1-misc/

* Don't use CollectedHeap::total_collections() in ZPageAllocation.
http://cr.openjdk.java.net/~pliden/8245208/webrev.1-total_collections/

* Don't fiddle with MinHeapSize/InitialHeapSize after initialization.
http://cr.openjdk.java.net/~pliden/8245208/webrev.1-min_initial_heap_size/

* Introduce "claimed" instead of fiddling with "used" when uncommitting.
http://cr.openjdk.java.net/~pliden/8245208/webrev.1-claimed/

* Adjust JFR events.
http://cr.openjdk.java.net/~pliden/8245208/webrev.1-events/

* Introduce ZConditionLock.
http://cr.openjdk.java.net/~pliden/8245208/webrev.1-conditionlock/

* Restructure the ZUncommitter.
http://cr.openjdk.java.net/~pliden/8245208/webrev.1-zuncommitter/

* Introduce ZUnmapper to asynchronous unmap pages (broken out into a 
separate bug, JDK-8246220)
http://cr.openjdk.java.net/~pliden/8246220/webrev.0/

---------------

And finally, here's a combined diff, with all of the above patches:
http://cr.openjdk.java.net/~pliden/8245208/webrev.1

---------------

Testing: Multiple runs of Tier1-6, multiple iterations of gc-test-suite.

cheers,
Per


More information about the hotspot-gc-dev mailing list