RFR: 8317466: Enable interpreter oopMapCache for concurrent GCs [v2]
Leela Mohan Venati
duke at openjdk.org
Mon Oct 16 20:12:25 UTC 2023
On Wed, 11 Oct 2023 18:50:14 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
>> Interpreter oop maps are computed lazily during GC root scan and they are expensive to compute.
>>
>> GCs uses a small hash table per instance class to cache computed oop maps during STW root scan, but not for concurrent root scan.
>>
>> This patch is intended to enable `OopMapCache` for concurrent GCs.
>>
>> Test:
>> tier1 and tier2 fastdebug and release on MacOSX, Linux 86_84 and Linux 86_32.
>
> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
>
> Cleanup old oop map cache entry after class redefinition
Changes requested by leelamv at github.com (no known OpenJDK username).
src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp line 64:
> 62: OopMapCache::cleanup_old_entries();
> 63: }
> 64:
Do you think, VM_ShenandoahFinalMarkStartEvac walks the stack roots. If yes, i recommend adding OopMapCache::cleanup_old_entries() in VM_ShenandoahOperation::doit_epilogue(). And this would make the change simple and also revert the change in this [PR](https://github.com/openjdk/jdk/pull/15921)
src/hotspot/share/oops/method.cpp line 311:
> 309: void Method::mask_for(int bci, InterpreterOopMap* mask) {
> 310: methodHandle h_this(Thread::current(), this);
> 311: method_holder()->mask_for(h_this, bci, mask);
Removing this condition allows all the threads including java threads to use/mutate oopMapCache.
For ex: Java threads calls [JVM_CallStackWalk](https://github.com/openjdk/jdk/blob/741ae06c55de65dcdfe38e328022bd8dde4fa007/src/hotspot/share/prims/jvm.cpp#L586) which walks the stack and calls locals() and expressions [here](https://github.com/openjdk/jdk/blob/741ae06c55de65dcdfe38e328022bd8dde4fa007/src/hotspot/share/prims/stackwalk.cpp#L345) which access oopMapCache.
-------------
PR Review: https://git.openjdk.org/jdk/pull/16074#pullrequestreview-1680858067
PR Review Comment: https://git.openjdk.org/jdk/pull/16074#discussion_r1361210493
PR Review Comment: https://git.openjdk.org/jdk/pull/16074#discussion_r1361202988
More information about the hotspot-runtime-dev
mailing list