RFR: 8368954: G1: Document why G1 uses TLS storage for the current card table reference [v2]

Thomas Schatzl tschatzl at openjdk.org
Tue Sep 30 16:11:37 UTC 2025


On Tue, 30 Sep 2025 16:07:47 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hi all,
>> 
>>   please review some documentation update why G1 now uses TLS storage to get the current card table base value for the card mark.
>> 
>> TLDR: it's the overall fastest currently available way.
>> 
>> Testing: local compilation, this is just a trivial documentation change.
>> 
>> Thanks,
>>   Thomas
>
> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update src/hotspot/share/gc/g1/g1ThreadLocalData.hpp

src/hotspot/share/gc/g1/g1ThreadLocalData.hpp line 47:

> 45:   // E.g. embedding an address to that value directly into the code stream similar
> 46:   // to Serial/Parallel and then loading from that was found to be slower at least
> 47:   // on non-x64, and increases code size a lot.

Suggestion:

  // Tests showed that embedding this value in the TLS block is the cheapest
  // way for fast access to this value in the barrier.
  // E.g. embedding an address to that value directly into the code stream and
  // then loading from that was found to be slower on non-x64 architectures.
  // Additionally it increases code size a lot.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27573#discussion_r2392134663


More information about the hotspot-gc-dev mailing list