RFR: 8264393: JDK-8258284 introduced dangling TLH race [v2]
Robbin Ehn
rehn at openjdk.java.net
Wed Mar 31 08:07:16 UTC 2021
On Wed, 31 Mar 2021 01:53:52 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> Hi Dan,
>>
>> So in a nutshell, when clearing a nested TLH you can't simply install the previous TLH as the threads_hazard_ptr, but instead set to NULL so that it is properly set by acquire_stable_list.
>>
>> This seems reasonable to me.
>>
>> Thanks,
>> David
>
> @dholmes-ora - your nutshell summary is spot on. Thanks for the review.
Hi Dan,
As you describe it and how it look to me, isn't the issue just that we decrement before before reinstating the old list?
So if we do first publish the previous list as current list and then decrement the nested handle count it should be okay?
E.g.:
_thread->set_threads_hazard_ptr(_previous->_list);
_list->dec_nested_handle_cnt();
So you just need to move the "if (_has_ref_count) {" piece of code after the potential reinstating of the previous list.
Or am I missing something?
Thanks for finding it!
-------------
PR: https://git.openjdk.java.net/jdk/pull/3272
More information about the hotspot-runtime-dev
mailing list