SWDEV-272496 - Fix multiple timing issues

- Don't notify if the batch is empty, because that means
the current command was processed already.
- Disable pinning optimization to avoid a race condition on stall.
- TS marker submition requires extra AQL barrier
to track the status.

Change-Id: I17eff4ad12ac66cfe1bb44048bebb1891805279d


[ROCm/clr commit: 24299e25bd]
This commit is contained in:
German Andryeyev
2021-02-26 16:17:30 -05:00
committed by Saleel Kudchadker
parent d82e14bf2c
commit f6cc68deac
4 changed files with 43 additions and 29 deletions
+9 -5
View File
@@ -213,13 +213,17 @@ bool Event::awaitCompletion() {
// ================================================================================================
bool Event::notifyCmdQueue() {
HostQueue* queue = command().queue();
if ((status() > CL_COMPLETE) &&
// Don't need to notify any marker with direct dispatch,
// because all markers are blocking
if ((status() > CL_COMPLETE) && (nullptr != queue) &&
(!AMD_DIRECT_DISPATCH ||
// Don't need to notify any marker with direct dispatch,
// because all markers are blocking.
((command().type() != CL_COMMAND_MARKER) &&
(command().type() != 0))) &&
(nullptr != queue) && !notified_.test_and_set()) {
(command().type() != 0)) ||
// Don't need to notify if the current batch is empty,
// because that means the command was processed and extra notification
// will cause a stall on the host.
(queue->GetSubmittionBatch() != nullptr)) &&
!notified_.test_and_set()) {
// Make sure the queue is draining the enqueued commands.
amd::Command* command = new amd::Marker(*queue, false, nullWaitList, this);
if (command == NULL) {