[SWDEV-474450] Removed DEVICE_MUTEX from gpu_reset
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I706fb47288738bfbde94b56fee66bbf807b3c0cb
[ROCm/amdsmi commit: 8bc8307c60]
Этот коммит содержится в:
@@ -3435,7 +3435,8 @@ rsmi_dev_gpu_reset(uint32_t dv_ind) {
|
|||||||
ss << __PRETTY_FUNCTION__ << "| ======= start =======";
|
ss << __PRETTY_FUNCTION__ << "| ======= start =======";
|
||||||
LOG_TRACE(ss);
|
LOG_TRACE(ss);
|
||||||
REQUIRE_ROOT_ACCESS
|
REQUIRE_ROOT_ACCESS
|
||||||
DEVICE_MUTEX
|
// No longer using DEVICE_MUTEX as it blocks long running processes
|
||||||
|
// DEVICE_MUTEX
|
||||||
|
|
||||||
rsmi_status_t ret;
|
rsmi_status_t ret;
|
||||||
uint64_t status_code = 0;
|
uint64_t status_code = 0;
|
||||||
|
|||||||
+3
-2
@@ -255,10 +255,11 @@ shared_mutex_t shared_mutex_init(const char *name, mode_t mode, bool retried) {
|
|||||||
// When process crash before unlock the mutex, the mutex is in bad status.
|
// When process crash before unlock the mutex, the mutex is in bad status.
|
||||||
// reset the mutex if no process is using it, and then retry lock
|
// reset the mutex if no process is using it, and then retry lock
|
||||||
if (!retried) {
|
if (!retried) {
|
||||||
std::vector<std::string> ids = lsof(name);
|
std::string shared_mutex_filename = "/dev/shm" + std::string(name);
|
||||||
|
std::vector<std::string> ids = lsof(shared_mutex_filename.c_str());
|
||||||
if (ids.size() == 0) { // no process is using it
|
if (ids.size() == 0) { // no process is using it
|
||||||
fprintf(stderr, "%d re-init the mutex %s since no one use it. ret:%d ptr:%p\n",
|
fprintf(stderr, "%d re-init the mutex %s since no one use it. ret:%d ptr:%p\n",
|
||||||
cur_pid, name, ret, reinterpret_cast<shared_mutex_t *>(addr)->ptr);
|
cur_pid, shared_mutex_filename, ret, reinterpret_cast<shared_mutex_t *>(addr)->ptr);
|
||||||
memset(mutex_ptr, 0, sizeof(pthread_mutex_t));
|
memset(mutex_ptr, 0, sizeof(pthread_mutex_t));
|
||||||
// Set mutex.created == 1 so that it can be initialized latter.
|
// Set mutex.created == 1 so that it can be initialized latter.
|
||||||
mutex.created = 1;
|
mutex.created = 1;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user