URGENT (XS) RFR: 8149697: Fix for 8145725 is broken
Daniel D. Daugherty
daniel.daugherty at oracle.com
Thu Feb 11 20:46:54 UTC 2016
And sorry that I missed that detail in the review of 8145725.
Dan
On 2/11/16 1:45 PM, Daniel D. Daugherty wrote:
> Thumbs up!
>
> Dan
>
>
> On 2/11/16 1:37 PM, David Holmes wrote:
>> bug: https://bugs.openjdk.java.net/browse/JDK-8149697
>>
>> webrev: http://cr.openjdk.java.net/~dholmes/8149697/webrev/
>>
>> In the refactoring for 8145725 a check of _cur_index was moved
>> outside the mutex block, but this was wrong as the value could be
>> changed by a parking thread. As per the existing comment we needed to
>> check the saved 'index' instead:
>>
>> --- old/src/os/linux/vm/os_linux.cpp 2016-02-11 15:23:59.696802390
>> -0500
>> +++ new/src/os/linux/vm/os_linux.cpp 2016-02-11 15:23:57.440675175
>> -0500
>> @@ -5756,7 +5756,7 @@
>> int index = _cur_index;
>> status = pthread_mutex_unlock(_mutex);
>> assert_status(status == 0, status, "invariant");
>> - if (s < 1 && _cur_index != -1) {
>> + if (s < 1 && index != -1) {
>> // thread is definitely parked
>> status = pthread_cond_signal(&_cond[index]);
>> assert_status(status == 0, status, "invariant");
>>
>> This could introduce spurious wakeups for a parking thread.
>>
>> Thanks,
>> David
>
More information about the hotspot-runtime-dev
mailing list