Understanding ZGC details

Simone Bordet simone.bordet at gmail.com
Mon Jul 16 14:08:06 UTC 2018


Hi Gil,

keeping this between us since it's not really relevant for ZGC :)

On Fri, Jul 13, 2018 at 7:52 PM Gil Tene <gil at azul.com> wrote:
> Speaking about the C4 mechanism: while C4 does perform various mapping manipulations
> for various reasons, LVB detection does not use SEGVs and does not rely on memory
> protection. Instead, The C4 LVB fast path uses a test & jmp (a single u-op on x86) to verify
> that the loaded reference is not in a "currently invalid" phase, with a slow path that fixes the
> reference to be in a valid phase (doing whatever is needed to achieve that: ensure marking,
> fixup to point to relocated object location, or perform actual object relocation if needed).

Ok. So I'm reading the GC Handbook from Jones et al. 2nd edition, and
they say that Pauless and C4 protects from-pages.
If I read correctly, from-pages are protected so that if a mutator
dereferences a pointer, it will trap, and the trap will "fix" the
pointer, either by copying it to to-space (so the mutator does the
job), or by looking at side metadata for the new address.

I understand that if there is a JIT-injected load barrier always
present, this work of "fixing" the pointer can be done by the slow
path of the load barrier, but then (for what pertains pointers)
protecting pages is not necessary; but then, why the GC handbook
mentions them?

Thanks!

-- 
Simone Bordet
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz


More information about the zgc-dev mailing list