RFR: 8191786: Thread-SMR hash table size should be dynamic [v2]

Coleen Phillimore coleenp at openjdk.java.net
Tue May 25 21:22:35 UTC 2021


On Tue, 25 May 2021 21:18:33 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   rehn CR
>
> 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");
> }

This should be added to KVHashtable because it would be nice to migrate the other hashtables to this nicer API.

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

PR: https://git.openjdk.java.net/jdk/pull/4168


More information about the hotspot-runtime-dev mailing list