RFR: 8237363 remove oop iterate verification
Stefan Karlsson
stefank at openjdk.java.net
Thu Oct 22 07:35:21 UTC 2020
On Thu, 22 Oct 2020 07:30:16 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
> There's verification code in the "oop iterate" framework that asserts that a pointer is "is in the heap". This works for most GCs, but ZGC *can* eagerly decommit the old relocation set pages, which means that pointers to the old / from copy of the object could point to memory that is currently not a part of the current heap.
>
> To combat this in the past I've added a way for oop iterate closures to turn off this verification. However, every single time we add a new closure we have to consider if we can allow this verification check or if we have to remove it. Personally, I think this is a false abstraction and also widens the oop iterate closure interface. I previously proposed a patch that moved the verification code down into the oop iterate closures. It wasn't a huge patch, but I got push-back that it was convenient for other GCs to get this automatic verification, and the review stalled.
>
> In this new patch I propose a different way to retain the verification. The realization is that most oop iterate closures have to deal with both compressed and non-compressed oops, so the code typically looks like this:
>
> template <class T>
> inline void G1ScanCardClosure::do_oop_work(T* p) {
> T o = RawAccess<>::oop_load(p);
> if (CompressedOops::is_null(o)) {
> return;
> }
> oop obj = CompressedOops::decode_not_null(o);
>
> Therefore the suggest new place to put the is_in verification is in the CompressedOops::decode*. This injects the assert into almost all non-ZGC closures, and also to places that don't use the oop iterate closure framework. I think this is a neat workaround, and hope this patch is accepted this time.
>
> I've tested this patch a few weeks ago, but will rerun the relevant tiers.
This is mostly of concerns for the hotspot-gc, but touches compressed oops so I'll move this to hotspot instead.
-------------
PR: https://git.openjdk.java.net/jdk/pull/797
More information about the hotspot-dev
mailing list