G1GC: The design choice of prefetching

Mingyu Wu timberonce at gmail.com
Tue Oct 15 01:33:44 UTC 2019


Hi all,
I find that G1GC (in OpenJDK12) implements a method named
*prefetch_and_push*, which prefetches the header and the first field of an
object referenced by a pointer *p *while *p* is about to be enqueued.
However, the effect of this prefetch instruction can be unstable as the
time when the object is processed is unknown. It is possible that many
references are enqueued before *p *(the data structure is actually
First-In-Last-Out) and finally evict the cache line storing the object,
making the prefetch useless. Therefore, what is the design choice of those
prefetch instructions? Do they stand for some tradeoffs related to the
overhead of prefetching?

Thanks,
Mingyu



More information about the hotspot-gc-dev mailing list