SWDEV-277847 - Move event lock_ to the beginning
For addMarker, assume T1 comes in first and enqueues a command C1. Before T1 grabs the event_::lock_ it gets preempted. At this time, T2 comes in, enqueues C2 and grabs the lock_ and updates event_. Now T1 wakes up and updates a older command C1 for the event. Change-Id: Ia423782b23026302c40976385623cfdede32d70b
Tento commit je obsažen v:
@@ -148,6 +148,9 @@ hipError_t Event::streamWait(amd::HostQueue* hostQueue, uint flags) {
|
||||
}
|
||||
|
||||
void Event::addMarker(amd::HostQueue* queue, amd::Command* command, bool record) {
|
||||
// Keep the lock always at the beginning of this to avoid a race. SWDEV-277847
|
||||
amd::ScopedLock lock(lock_);
|
||||
|
||||
if (command == nullptr) {
|
||||
command = queue->getLastQueuedCommand(true);
|
||||
|
||||
@@ -171,7 +174,6 @@ void Event::addMarker(amd::HostQueue* queue, amd::Command* command, bool record)
|
||||
command->enqueue();
|
||||
}
|
||||
}
|
||||
amd::ScopedLock lock(lock_);
|
||||
|
||||
if (event_ == &command->event()) return;
|
||||
|
||||
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele