- Timestamp:
- Aug 2, 2021 10:58:26 AM (4 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp
r90449 r90468 172 172 uint64_t const cNsMaxRetry = RT_NS_15SEC; 173 173 uint32_t cMsMaxOne = RT_MS_5SEC; 174 bool fNonInterruptible = false; 174 175 # endif 175 176 for (;;) … … 202 203 RTThreadUnblocked(hThreadSelf, RTTHREADSTATE_CRITSECT); 203 204 # else /* IN_RING0 */ 204 int const rc = SUPSemEventWaitNoResume(pSession, hEvent, cMsMaxOne); 205 int const rc = !fNonInterruptible 206 ? SUPSemEventWaitNoResume(pSession, hEvent, cMsMaxOne) 207 : SUPSemEventWait(pSession, hEvent, cMsMaxOne); 205 208 # endif /* IN_RING0 */ 206 209 … … 248 251 /* Try return get out of here with a non-VINF_SUCCESS status if 249 252 the thread is terminating or if the timeout has been exceeded. */ 253 STAM_REL_COUNTER_INC(&pVM->pdm.s.StatCritSectVerrTimeout); 250 254 if ( rcTerm != VINF_THREAD_IS_TERMINATING 251 255 && cNsElapsed <= cNsMaxTotal) … … 254 258 else 255 259 { 256 /* For interrupt cases, we must return if we can. Only if we */ 260 /* For interrupt cases, we must return if we can. If rcBusy is VINF_SUCCESS, 261 we will try non-interruptible sleep for a while to help resolve the issue 262 w/o guru'ing. */ 263 STAM_REL_COUNTER_INC(&pVM->pdm.s.StatCritSectVerrInterrupted); 257 264 if ( rcTerm != VINF_THREAD_IS_TERMINATING 258 265 && rcBusy == VINF_SUCCESS 259 266 && pVCpu != NULL 260 267 && cNsElapsed <= cNsMaxTotal) 268 { 269 if (!fNonInterruptible) 270 { 271 STAM_REL_COUNTER_INC(&pVM->pdm.s.StatCritSectNonInterruptibleWaits); 272 fNonInterruptible = true; 273 cMsMaxOne = 32; 274 uint64_t cNsLeft = cNsMaxTotal - cNsElapsed; 275 if (cNsLeft > RT_NS_10SEC) 276 cNsMaxTotal = cNsElapsed + RT_NS_10SEC; 277 } 261 278 continue; 279 } 262 280 } 263 281 -
trunk/src/VBox/VMM/VMMR3/PDMCritSect.cpp
r90437 r90468 55 55 { 56 56 RT_NOREF_PV(pVM); 57 STAM_REL_REG(pVM, &pVM->pdm.s.StatQueuedCritSectLeaves, STAMTYPE_COUNTER, "/PDM/ QueuedCritSectLeaves", STAMUNIT_OCCURENCES,57 STAM_REL_REG(pVM, &pVM->pdm.s.StatQueuedCritSectLeaves, STAMTYPE_COUNTER, "/PDM/CritSects/00-QueuedLeaves", STAMUNIT_OCCURENCES, 58 58 "Number of times a critical section leave request needed to be queued for ring-3 execution."); 59 STAM_REL_REG(pVM, &pVM->pdm.s.StatAbortedCritSectEnters, STAMTYPE_COUNTER, "/PDM/ AbortedCritSectEnters", STAMUNIT_OCCURENCES,59 STAM_REL_REG(pVM, &pVM->pdm.s.StatAbortedCritSectEnters, STAMTYPE_COUNTER, "/PDM/CritSects/00-AbortedEnters", STAMUNIT_OCCURENCES, 60 60 "Number of times we've successfully aborted a wait in ring-0."); 61 STAM_REL_REG(pVM, &pVM->pdm.s.StatCritSectEntersWhileAborting, STAMTYPE_COUNTER, "/PDM/CritSect EntersWhileAborting", STAMUNIT_OCCURENCES,61 STAM_REL_REG(pVM, &pVM->pdm.s.StatCritSectEntersWhileAborting, STAMTYPE_COUNTER, "/PDM/CritSects/00-EntersWhileAborting", STAMUNIT_OCCURENCES, 62 62 "Number of times we've got the critical section ownership while trying to abort a wait due to VERR_INTERRUPTED."); 63 STAM_REL_REG(pVM, &pVM->pdm.s.StatCritSectVerrInterrupted, STAMTYPE_COUNTER, "/PDM/CritSects/00-VERR_INTERRUPTED", STAMUNIT_OCCURENCES, 64 "Number of VERR_INTERRUPTED returns."); 65 STAM_REL_REG(pVM, &pVM->pdm.s.StatCritSectVerrTimeout, STAMTYPE_COUNTER, "/PDM/CritSects/00-VERR_TIMEOUT", STAMUNIT_OCCURENCES, 66 "Number of VERR_TIMEOUT returns."); 67 STAM_REL_REG(pVM, &pVM->pdm.s.StatCritSectNonInterruptibleWaits, STAMTYPE_COUNTER, "/PDM/CritSects/00-Non-interruptible-Waits-VINF_SUCCESS", 68 STAMUNIT_OCCURENCES, "Number of non-interruptible waits for rcBusy=VINF_SUCCESS"); 63 69 return VINF_SUCCESS; 64 70 } -
trunk/src/VBox/VMM/include/PDMInternal.h
r90436 r90468 1477 1477 * abort a wait due to VERR_INTERRUPTED. */ 1478 1478 STAMCOUNTER StatCritSectEntersWhileAborting; 1479 STAMCOUNTER StatCritSectVerrTimeout; 1480 STAMCOUNTER StatCritSectVerrInterrupted; 1481 STAMCOUNTER StatCritSectNonInterruptibleWaits; 1479 1482 } PDM; 1480 1483 AssertCompileMemberAlignment(PDM, CritSect, 8);
Note:
See TracChangeset
for help on using the changeset viewer.