RFR: 8191786: Thread-SMR hash table size should be dynamic [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Tue May 25 21:22:34 UTC 2021
On Tue, 25 May 2021 20:39:56 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> Small change to switch Thread-SMR's hash table from ResourceHashtable to KVHashtable
>> so that a variable sized hash table is used instead of a fixed size hash table (1031 elements).
>> Also refactor common hash table size calculation code into static hash_table_size()
>> function and call it from both places.
>>
>> Test with Mach5 Tier[1-7] testing.
>
> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
>
> rehn CR
Changes requested by coleenp (Reviewer).
src/hotspot/share/runtime/threadSMR.cpp line 205:
> 203:
> 204: ~ThreadScanHashtable() {
> 205: log_trace(thread, smr)("tid=" UINTX_FORMAT ": deallocate ThreadScanHashtable(%d) at " INTPTR_FORMAT, os::current_thread_id(), _table_size, p2i(this));
For a CHeap hashtable, I believe this should do this (or have KVHash have an API to delete all the entries).
Dictionary::~Dictionary() {
DictionaryEntry* probe = NULL;
for (int index = 0; index < table_size(); index++) {
for (DictionaryEntry** p = bucket_addr(index); *p != NULL; ) {
probe = *p;
*p = probe->next();
free_entry(probe);
}
}
assert(number_of_entries() == 0, "should have removed all entries");
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/4168
More information about the hotspot-runtime-dev
mailing list