[15] RFR 8236878: Use atomic instruction to update StringDedupTable's entries and entries_removed counters

Aleksey Shipilev shade at redhat.com
Wed Jan 15 19:17:24 UTC 2020


On 1/14/20 6:19 PM, Zhengyu Gu wrote:
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8236878
>>> Webrev: http://cr.openjdk.java.net/~zgu/JDK-8236878/webrev.00/index.html

It is odd to mix the atomic update and locked update. We can lose locked updates that do not expect
anyone to modify the field when lock is held. It is probably fine for _entries_removed, as it is
used for statistics. It seems riskier to do for _table->_entries: are we sure nothing in the String
dedup table relies on that being very accurate?

Can you explain a little bit why we cannot block on StringDedupTable_lock here? Is this a reentrancy
issue?

-- 
Thanks,
-Aleksey




More information about the hotspot-gc-dev mailing list