summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorOded Gabbay <ogabbay@kernel.org>2021-09-30 11:22:32 +0300
committerOded Gabbay <ogabbay@kernel.org>2021-10-18 12:05:46 +0300
commitc1904127ce8d1b37154c1a1d1fc5836a0ef6c830 (patch)
treec3b39768995502fa7d7ae62724a600afeefe161f /tools/perf/scripts/python/export-to-postgresql.py
parent1282dbbd292e9525cc5659ae1409188b76869c4c (diff)
habanalabs: prevent race between fd close/open
The driver allows only a single process to open a device's FD at any single time. This is done by checking "hdev->compute_ctx" under mutex. Therefore, to prevent a race between the moment a user closes it's FD and when another user tries to open the device, we need to make sure that clearing this variable is the very last thing that is done in the code of the FD's release. I'm moving the idle check before clearing this variable and the "reset on device release". btw, if the reset happens it will prevent any other user from opening the device until the reset is finished. An important thing to note is that we need to remove the user process that is closing the device from the process list BEFORE calling the reset function. That is to prevent a case where the reset code will try to kill that user process and it is unnecessary as the process doesn't hold any device/driver resources anymore. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions