RFR: 8016074 NMT: assertion failed: assert(thread->thread_state() == from) failed: coming from wrong thread state

David Holmes david.holmes at oracle.com
Thu Jul 4 23:56:57 PDT 2013


It might be a little clearer to check for solaris and use NakedYield 
only on solaris.

Also the commentary is somewhat verbose.

David

On 3/07/2013 9:32 PM, Zhengyu Gu wrote:
> Solaris os::yield_all() implementation depends on os::sleep(), which
> requires JavaThread to be in _thread_in_vm state. As NMT tracking call
> can originate from any thread in any state, transits to _thread_in_vm
> can be dangerous, if caller holds any locks, deadlock or lock out of
> order can result, since state transition code may block on Threads_lock.
>
> The solution is to use os::NakedYield() which calls to system thr_yield().
>
> On Linux and BSD, os::yield_all() and os::NakedYield() implementations
> are the same.
>
> On Windows, the implementations are different, based on our QA feedback,
> os::NakedYield() does not perform as well as os::yield_all().
>
>
> External bug:http://bugs.sun.com/view_bug.do?bug_id=8016074
> JBS:https://jbs.oracle.com/bugs/browse/JDK-8016074
> Webrev:http://cr.openjdk.java.net/~zgu/8016074/webrev.00/
>
>
> Tests:
>    - JPRT with -XX:-AutoShutdownNMT flag
>    - Kitchensink on Solaris 11, with -XX:NativeMemoryTracking=detail
> -XX:-AutoShutdownNMT -XX:+SafepointALot
>      over 12 hours now.
>
>
> Thanks,
>
> -Zhengyu
>


More information about the hotspot-runtime-dev mailing list