On Tue, 10 Nov 2020 23:27:52 GMT, Daniel D. Daugherty <dcu...@openjdk.org> wrote:
>> Well since it controls async deflation, it should probably get a mention >> since this comment on its own is not true: >> >> // Keep track of contention for JVM/TI and M&M queries and control async >> deflation. >> >> The field _contentions has a good comment. > > The comment for **that** location is correct. That's the location > where we keep track of contended monitors for JVM/TI and M&M. > The comments at the other locations are also correct (very verbose > for two of them, but correct). Look at the entire context of that location: // Keep track of contention for JVM/TI and M&M queries. add_to_contentions(1); if (is_being_async_deflated()) { // Async deflation is in progress and our contentions increment // above lost the race to async deflation. Undo the work and // force the caller to retry. const oop l_object = object(); if (l_object != NULL) { // Attempt to restore the header/dmw to the object's header so that // we only retry once if the deflater thread happens to be slow. install_displaced_markword_in_object(l_object); } Self->_Stalled = 0; add_to_contentions(-1); return false; } We do the increment for JVM/TI and M&M purposes and then we check to see if async deflation beat us... ------------- PR: https://git.openjdk.java.net/jdk/pull/642