RFR: 8267186: Add string deduplication support to ZGC [v3]

Stefan Karlsson stefank at openjdk.java.net
Tue Aug 10 11:43:30 UTC 2021


On Tue, 10 Aug 2021 08:32:02 GMT, Per Liden <pliden at openjdk.org> wrote:

>> This change adds support for string deduplication to ZGC. It's a pretty straight forward change, but to make reviewing even easier it is broken up into two commits:
>> 
>> __ZGC: Introduce ZMarkContext__
>> This commit just moves the `ZMarkCache` into the new `ZMarkContext` class, and we now pass a `ZMarkContext*` around instead of a `ZMarkCache*`. The `ZMarkContext` class is a more general container for worker-local data, which in the next commit will be extended to also include the `StringDedup::Requests` queue.
>> 
>> __8267186: Add string deduplication support to ZGC__
>> This commits adds the actual string dedup functionality and enables relevant tests. We use the `deduplication_requested` bit in the `String` object to filter out `Strings` we've already attempted to deduplicate.
>> 
>> Testing:
>> - Passes all string dedup tests.
>> - Passes Tier1-7 with ZGC on Linux/x86_64 (with -XX:+UseStringDeduplication enabled by default to get better exposure).
>
> Per Liden has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix include order

Looks good.

ZMarkContext serves multiple purposes in the marking code, and if we (maybe in the future) add code for those purposes then it risk being a class of multiple responsibilities. Therefore, I think it would be good to let this class be a simpler data carrier, and move the extra code/logic in ZMarkContext::try_deduplicate out to ZMark, or maybe even a new ZStringDedup class.

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

Marked as reviewed by stefank (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5029



More information about the hotspot-gc-dev mailing list