RFR: 8371702: ZGC: NUMA-Affinity for Worker Threads in the Relocation Phase [v8]

Axel Boldt-Christmas aboldtch at openjdk.org
Wed Nov 26 08:30:53 UTC 2025


On Wed, 26 Nov 2025 08:10:40 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

>> Hello,
>> 
>> The main goal of this PR is to solve a performance regression in relatively small environments on a NUMA machine. See the associated issue for a more detailed explanation on regression itself.
>> 
>> I propose we add functionality to set the affinity of worker threads in the Relocation Phase of ZGC so that the worker threads are *always* accessing NUMA-local memory when relocating objects. As soon as a worker threads is about to start relocating a new forwarding entry (or just page), it makes sure that it has the appropriate affinity set. At the most, each worker thread will set its own affinity the same number of times as there are NUMA nodes on the system. When the threads are about to exit the Relocation Phase (i.e. by completing `ZRelocateTask`), they "strip" their affinity so that they are allowed to run on any CPU that they were originally allowed to run on.
>> 
>> I've done significant performance testing, which solves the observed regression and gives an additional performance boost in the same environments. I have not been able to observe similar boosts in performance on much larger environments (>=70 CPUs and >32GB memory) and also no regressions.
>
> Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
> 
>   for(;;) instead of while(true)

Marked as reviewed by aboldtch (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/28262#pullrequestreview-3509649689


More information about the hotspot-gc-dev mailing list