RFR: Scan remembered [v2]
Roman Kennke
rkennke at openjdk.java.net
Wed Jan 13 12:27:17 UTC 2021
On Wed, 13 Jan 2021 02:44:45 GMT, Kelvin Nilsen <github.com+51720475+kdnilsen at openjdk.org> wrote:
>> Add support for scanning remembered set
>>
>> The code has support for two alternative implementations of the remembered set. The current remembered set implementation uses traditional card marking, where the post writer barrier for pointer write operations sets the mark for every overwritten card.
>>
>> A contemplated future remembered set implementation is represented in skeleton form within the shenandoahBufferWithSATBRememberedSet.hpp and shenandoahBufferWithSATBRememberedSet.inline.hpp files. The idea of this alternative remembered set implementation is that the existing SATB buffers will be augmented to additionally remember the address of each overwritten reference field. Subsequent processing of the SATB buffer contents by background GC threads will update the TBD remembered set representation.
>>
>> There are known bugs and performance improvements in the remembered set scanning implementation that have been addressed in certain Amazon-internal commits. These commits will be upstreamed at a later time after other commits not directly related to remembered set scanning are upstreamed.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
>
> Improvements requested during initial review
>
> These changes are cosmetic and/or related to comments.
The copyright stuff needs to be sorted out, but other than that it looks good to me now. Please notice my other few comments too. Good work!
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 76:
> 74: #include "gc/shenandoah/mode/shenandoahPassiveMode.hpp"
> 75: #include "gc/shenandoah/mode/shenandoahSATBMode.hpp"
> 76: #include "gc/shenandoah/shenandoahScanRemembered.inline.hpp"
I noticed now, that you also include shenandoahScanRemembered.hpp above. You only need to include the .inline.hpp, and bonus points for keeping it in alphabethical order... ;-)
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 2755:
> 2753: // ShenandoahHeap::marked_object_iterate(), which is called by _heap->marked_object_oop_iterate().
> 2754: objs.do_object(obj);
> 2755: p += obj->size();
As noted before, this might crash, if the Klass* that an unreachable object points to has been unloaded. The problem, as far as I can tell, arises because we don't have up-to-date marking information anymore, because we clean the whole bitmap, and subsequent young-gen collection doesn't establish old-gen reachability. Could we solve this by preserving the most-recent old-gen marking in the bitmap, and only clean the young-gen-parts? For now, it can probably be worked around by turning off ClassUnloading altogether.
src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp line 31:
> 29: // #include "gc/shared/referenceDiscoverer.hpp"
> 30: // #include "gc/shared/referencePolicy.hpp"
> 31: #include "memory/allocation.hpp"
Please fix that properly in an upstream change. I leave it up to you to keep the parts here, next merge should override it.
-------------
PR: https://git.openjdk.java.net/shenandoah/pull/12
More information about the shenandoah-dev
mailing list