Qutex: Add gridlock detection wireframing
This is the basic wireframing required to enable us to detect gridlocks among requests.
This commit is contained in:
@@ -99,13 +99,16 @@ public:
|
||||
|
||||
Qutex *firstFailedQutexPtr = nullptr;
|
||||
bool deadlockLikely = isDeadlockLikely();
|
||||
bool gridlockLikely = isGridlockLikely();
|
||||
|
||||
if (!serializedContinuation.requiredLocks.tryAcquireOrBackOff(
|
||||
*this, (deadlockLikely ? &firstFailedQutexPtr : nullptr)))
|
||||
*this,
|
||||
((deadlockLikely || gridlockLikely)
|
||||
? &firstFailedQutexPtr : nullptr)))
|
||||
{
|
||||
// Just allow this lockvoker to be dropped from its io_service.
|
||||
allowAwakening();
|
||||
if (!deadlockLikely)
|
||||
if (!deadlockLikely && !gridlockLikely)
|
||||
{ return; }
|
||||
|
||||
#ifdef CONFIG_ENABLE_DEBUG_LOCKS
|
||||
@@ -113,7 +116,10 @@ public:
|
||||
bool isDeadlock = traceContinuationHistoryForDeadlockOn(
|
||||
firstFailedQutex);
|
||||
|
||||
if (!isDeadlock)
|
||||
bool isGridlock = traceContinuationHistoryForGridlockOn(
|
||||
firstFailedQutex);
|
||||
|
||||
if (!isDeadlock && !isGridlock)
|
||||
{ return; }
|
||||
|
||||
handleDeadlock(firstFailedQutex);
|
||||
@@ -202,8 +208,13 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
// Wrapper around isDeadlockLikely for gridlock detection
|
||||
bool isGridlockLikely() const
|
||||
{ return isDeadlockLikely(); }
|
||||
|
||||
#ifdef CONFIG_ENABLE_DEBUG_LOCKS
|
||||
bool traceContinuationHistoryForDeadlockOn(Qutex &firstFailedQutex);
|
||||
bool traceContinuationHistoryForGridlockOn(Qutex &firstFailedQutex);
|
||||
bool traceContinuationHistoryForDeadlock(void)
|
||||
{
|
||||
for (auto& lockUsageDesc
|
||||
|
||||
Reference in New Issue
Block a user