RFR: 8272093: Extract evacuation failure injection from G1CollectedHeap

Thomas Schatzl tschatzl at openjdk.java.net
Mon Aug 30 12:34:27 UTC 2021


On Mon, 30 Aug 2021 12:21:59 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Hi all,
>> 
>>   can I have reviews for this change that extracts out the evacuation failure injection mechanism from `G1CollectedHeap` into its own class?
>> This reduces the amount of code in `G1CollectedHeap` a bit, moving somewhat uninteresting but somewhat important (testing) code out from there. Also documented it a bit. The other reason was that imho it stuck out a bit due to the ifdef's in `G1CollectedHeap`.
>> 
>> I checked that gcc does compile out the call to `evacuation_should_fail()` in `G1ParScanThreadState` in product mode.
>> 
>> Testing: tier1, local testing
>> 
>> Thanks,
>>   Thomas
>
> src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp line 49:
> 
>> 47: 
>> 48:   // The number of evacuations between induced failures.
>> 49:   volatile size_t _evacuation_failure_object_count;
> 
> Any reason to not guard these with `#ifndef PRODUCT`?

Will do. I need to merge with master anyway.

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

PR: https://git.openjdk.java.net/jdk/pull/5047



More information about the hotspot-gc-dev mailing list