You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[L0] fix a deadlock in queue sync and event status query
This fixes a possible deadlock in the following scenario:
// Some event that is meant to be signaled by the host
event = urEventCreateWithNativeHandle(...);
Thread A:
urEnqueueEventsWaitWithBarrier(q, waitlist = {event}, ...);
// This will synchronously wait for the event to be signaled
// from thread B. This hold q->Mutex exclusively.
urQueueFinish(q);
Thread B:
// The current implementation of this query waits to aquire
// event->queue->Mutex. This will never happen since thread A
// is holding it.
urEventGetInfo(event, ..., UR_EVENT_INFO_COMMAND_EXECUTION_STATUS);
// This is meant to unblock thread A.
zeEventHostSignal(event);
The fix is simple. The only reason urEventGetInfo needs to acquire
the queue lock is to opportunistically make progress on the event
by submitting a related open command list if one exists. This is
not required. And so the fix is to skip this logic if we fail to
immediately acquire the lock (which indicates that something else
is operating on the queue).
0 commit comments