Integrated: 8366223: ZGC: ZPageAllocator::cleanup_failed_commit_multi_partition is broken
Axel Boldt-Christmas
aboldtch at openjdk.org
Thu Aug 28 05:05:53 UTC 2025
On Wed, 27 Aug 2025 09:37:46 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> While investigating [JDK-8366147](https://bugs.openjdk.org/browse/JDK-8366147) we also found that ZPageAllocator::cleanup_failed_commit_multi_partition is broken.
>
> The implementation is intended to work by going over each partitions part of the allocation one by one and returning any harvested or committed and mapped memory to to cache and returning any failed to be committed physical associations back to our internal free lists.
>
> But when deriving what part of the memory is associated with which partition it uses the wrong variable and ends up working with the wrong memory. And multiple partitions will end up working on the same supposedly mutually exclusive memory.
>
> This fix is to use the correct `partial_vmem` rather than `vmem` which holds the whole allocation.
>
> The new test reproduces this error. The test is tightly coupled to the current ZPageAllocator implementation and its policies. We might want to enhance this test in the future to ensure that we are actually provoking commit failures with harvesting and get notified if this changes. Currently there is no none intrusive way to do this. The best option might be our JFR events which contain all the information.
>
> * Testing (In progress)
> * Oracle supported platforms tier1 + ZGC tier1-8
This pull request has now been integrated.
Changeset: 501e6aed
Author: Axel Boldt-Christmas <aboldtch at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/501e6aed4407d63b000320168dc5d0553ce8a23b
Stats: 122 lines in 4 files changed: 120 ins; 0 del; 2 mod
8366223: ZGC: ZPageAllocator::cleanup_failed_commit_multi_partition is broken
Reviewed-by: stefank, jsikstro
-------------
PR: https://git.openjdk.org/jdk/pull/26953
More information about the hotspot-gc-dev
mailing list