RFR: 8331572: Allow using OopMapCache outside of STW GC phases [v2]
Coleen Phillimore
coleenp at openjdk.org
Thu May 16 14:20:03 UTC 2024
On Thu, 16 May 2024 07:55:28 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> As the reproducer in the issue shows, we would also like to use the `OopMapCache` during the concurrent GC phases. Zhengyu mentions there is also a production problem for stack walking that would benefit from letting `OopMapCache` be used without looking at GC at all.
>>
>> This PR unblocks `OopMapCache` uses for everything. Cleanups are nominally done by service thread. But, still appreciating that majority of use cases would be from GCs, we leave the proactive cleanups from the GC ops here as well. It requires the synchronization between readers that might be copying out the entries out of the hashmap and the concurrent reclamation. Handily, `GlobalCounter` can be used for that purpose.
>>
>> After this lands, I think we can go over `OopMapCache::compute_one_oop_map` uses and see if they would instead like to use the cached `lookup` to benefit from this cache too. I think those paths are for OSR and deopts, so their performance is unlikely to be critical. This PR already covers the concurrent GC paths well.
>>
>> Additional testing:
>> - [x] Performance test reproducer from the bug improves significantly
>> - [x] Linux AArch64 server fastdebug, `hotspot_gc_shenandoah` (10x)
>> - [x] Linux AArch64 server fastdebug, `all`
>> - [x] Linux x86_64 server fastdebug, `all`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>
> Notify service thread on first enqueue
This looks good.
src/hotspot/share/interpreter/oopMapCache.cpp line 584:
> 582: MutexLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
> 583: Service_lock->notify_all();
> 584: }
Yes, you don't want to do this too frequently.
-------------
Marked as reviewed by coleenp (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/19229#pullrequestreview-2060914518
PR Review Comment: https://git.openjdk.org/jdk/pull/19229#discussion_r1603439246
More information about the shenandoah-dev
mailing list