HPC : Intermittent hangs are observed while running Gromacs benchmarks
SWDEV-235579 Move the lock before destroying the queue as there's a multithreaded race condition if the queue is being destroy and right after we set queue_ to nullptr, another thread can call ihipWaitStreams which will then call create on that same stream because queue is now nullptr. Moving the lock on streamSet prevents this from happening because we would remove the stream from that list and therefore ihipWait will not try to call asHostQueue which tries to create the queue if not created yet since the stream won't be in the list anymore Change-Id: I3108657ab403d39d4123e83294fcf1f0880e5563
이 커밋은 다음에 포함됨:
1 부모
b0900de0fb
커밋
163fdd6b74
1 파일이 변경됨
+4
-4
@@ -23,7 +23,7 @@
|
||||
#include "hip_event.hpp"
|
||||
#include "thread/monitor.hpp"
|
||||
|
||||
static amd::Monitor streamSetLock("Guards global stream set");
|
||||
static amd::Monitor streamSetLock{"Guards global stream set"};
|
||||
static std::unordered_set<hip::Stream*> streamSet;
|
||||
|
||||
// Internal structure for stream callback handler
|
||||
@@ -83,11 +83,11 @@ amd::HostQueue* Stream::asHostQueue(bool skip_alloc) {
|
||||
// ================================================================================================
|
||||
void Stream::Destroy() {
|
||||
if (queue_ != nullptr) {
|
||||
queue_->release();
|
||||
queue_ = nullptr;
|
||||
|
||||
amd::ScopedLock lock(streamSetLock);
|
||||
streamSet.erase(this);
|
||||
|
||||
queue_->release();
|
||||
queue_ = nullptr;
|
||||
}
|
||||
delete this;
|
||||
}
|
||||
|
||||
새 이슈에서 참조
사용자 차단