RFR: 8315559: Delay TempSymbol cleanup to avoid symbol table churn [v6]

Oli Gillespie ogillespie at openjdk.org
Thu Nov 9 16:36:25 UTC 2023


On Thu, 9 Nov 2023 15:23:56 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/oops/symbolHandle.hpp line 99:
>> 
>>> 97:     if (!_cleanup_delay_enabled) return;
>>> 98:     sym->increment_refcount();
>>> 99:     uint i = Atomic::add(&_cleanup_delay_index, 1u) % CLEANUP_DELAY_MAX_ENTRIES;
>> 
>> When this wraps around, it will skip a few values - but I don't see a problem with that.
>> 
>> 
>> x = 4294967293, x % 100 = 93
>> x = 4294967294, x % 100 = 94
>> x = 4294967295, x % 100 = 95
>> x = 0, x % 100 = 0
>> x = 1, x % 100 = 1
>> x = 2, x % 100 = 2
>
> I don't see a problem either.  I wish I were better with integers.  I was wondering if the max entries should be a power of two to make the % operation faster.

Good idea, changed to 128. I'm no expert but the code looks better for it here: https://godbolt.org/z/7cYv9Pzz7.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16398#discussion_r1388262435


More information about the hotspot-dev mailing list