Skip to contentSkip to conversation

drm/amdgpu: change the default timeout for kernel compute queues

PATCH In review Alex Deucher 2 participants 2 messages May 4, 2021 – May 5, 2021

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: change the default timeout for kernel compute queues

Change to 60s. This matches what we already do in virtualization. Infinite timeout can lead to deadlocks in the kernel.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++-----
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -5
index 357f9405f1aa..1b60f8205f15 100644
@@ -3167,8 +3167,8 @@ static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	int ret = 0;
 
 	/*
-	 * By default timeout for non compute jobs is 10000.
-	 * And there is no timeout enforced on compute jobs.
+	 * By default timeout for non compute jobs is 10000
+	 * and 60000 for compute jobs.
 	 * In SR-IOV or passthrough mode, timeout for compute
 	 * jobs are 60000 by default.
 	 */
@@ -3177,10 +3177,8 @@ static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	if (amdgpu_sriov_vf(adev))
 		adev->compute_timeout = amdgpu_sriov_is_pp_one_vf(adev) ?
 					msecs_to_jiffies(60000) : msecs_to_jiffies(10000);
-	else if (amdgpu_passthrough(adev))
-		adev->compute_timeout =  msecs_to_jiffies(60000);
 	else
-		adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
+		adev->compute_timeout =  msecs_to_jiffies(60000);
 
 	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) {
 		while ((timeout_setting = strsep(&input, ",")) &&
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -2
index ad8a2c391bbd..d3d756585db4 100644
@@ -287,9 +287,9 @@ module_param_named(msi, amdgpu_msi, int, 0444);
  *   for SDMA and Video.
  *
  * By default(with no lockup_timeout settings), the timeout for all non-compute(GFX, SDMA and Video)
- * jobs is 10000. And there is no timeout enforced on compute jobs.
+ * jobs is 10000. The timeout for compute is 60000.
  */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for bare metal 10000 for non-compute jobs and infinity timeout for compute jobs; "
+MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for bare metal 10000 for non-compute jobs and 60000 for compute jobs; "
 		"for passthrough or sriov, 10000 for all jobs."
 		" 0: keep default value. negative: infinity timeout), "
 		"format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "
Signature · 6 lines
2.30.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

Am 04.05.21 um 17:03 schrieb Alex Deucher:

Quoted 4 lines

Change to 60s. This matches what we already do in virtualization. Infinite timeout can lead to deadlocks in the kernel.

Quoted 38 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++-----
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 4 ++--
  2 files changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -5
index 357f9405f1aa..1b60f8205f15 100644
@@ -3167,8 +3167,8 @@ static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
  	int ret = 0;
 
  	/*
-	 * By default timeout for non compute jobs is 10000.
-	 * And there is no timeout enforced on compute jobs.
+	 * By default timeout for non compute jobs is 10000
+	 * and 60000 for compute jobs.
  	 * In SR-IOV or passthrough mode, timeout for compute
  	 * jobs are 60000 by default.
  	 */
@@ -3177,10 +3177,8 @@ static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
  	if (amdgpu_sriov_vf(adev))
  		adev->compute_timeout = amdgpu_sriov_is_pp_one_vf(adev) ?
  					msecs_to_jiffies(60000) : msecs_to_jiffies(10000);
-	else if (amdgpu_passthrough(adev))
-		adev->compute_timeout =  msecs_to_jiffies(60000);
  	else
-		adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
+		adev->compute_timeout =  msecs_to_jiffies(60000);
 
  	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) {
  		while ((timeout_setting = strsep(&input, ",")) &&
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index ad8a2c391bbd..d3d756585db4 100644
@@ -287,9 +287,9 @@ module_param_named(msi, amdgpu_msi, int, 0444);
   *   for SDMA and Video.

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c module_param_named(msi, amdgpu_msi, int, 0444); · line 295

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -2
   *
   * By default(with no lockup_timeout settings), the timeout for all non-compute(GFX, SDMA and Video)
- * jobs is 10000. And there is no timeout enforced on compute jobs.
+ * jobs is 10000. The timeout for compute is 60000.
   */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for bare metal 10000 for non-compute jobs and infinity timeout for compute jobs; "
+MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for bare metal 10000 for non-compute jobs and 60000 for compute jobs; "
  		"for passthrough or sriov, 10000 for all jobs."
  		" 0: keep default value. negative: infinity timeout), "
  		"format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx