Skip to contentSkip to conversation

drm/amdgpu: For sriov multiple VF, set compute timeout to 10s

PATCH In review Emily.Deng 2 participants 3 messages Jan 6, 2021 – Jan 7, 2021

Subsystems (2)
lore
Share & tools
lore

Emily.Deng

author
#0 lore raw

PATCH 1/1 drm/amdgpu: For sriov multiple VF, set compute timeout to 10s

For multiple VF, after engine hang,as host driver will first encounter FLR, so has no meanning to set compute to 60s.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -1
index b69c34074d8d..ed36bf97df29 100644
@@ -3117,8 +3117,10 @@ static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	 */
 	adev->gfx_timeout = msecs_to_jiffies(10000);
 	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
-	if (amdgpu_sriov_vf(adev) || amdgpu_passthrough(adev))
+	if ((amdgpu_sriov_vf(adev) && amdgpu_sriov_is_pp_one_vf(adev)) || amdgpu_passthrough(adev))
 		adev->compute_timeout =  msecs_to_jiffies(60000);
+	else if (amdgpu_sriov_vf(adev))
+		adev->compute_timeout =  msecs_to_jiffies(10000);
 	else
 		adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
 
Signature · 6 lines
2.25.1

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

Dear Emily,

Am 06.01.21 um 12:41 schrieb Emily.Deng:

Could you please remove the dot your name in your git configuration?

    git config --global user.name "Emily Deng"

For the summary, maybe amend it to:

Decrease compute timeout to 10 s for sriov multiple VF

Quoted 1 line

For multiple VF, after engine hang,as host driver will first

Nit: Please add a space after the comma.

Quoted 1 line

encounter FLR, so has no meanning to set compute to 60s.

meaning

How can this be tested?

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index b69c34074d8d..ed36bf97df29 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 3123

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -1
@@ -3117,8 +3117,10 @@ static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
  	 */
  	adev->gfx_timeout = msecs_to_jiffies(10000);
  	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
-	if (amdgpu_sriov_vf(adev) || amdgpu_passthrough(adev))
+	if ((amdgpu_sriov_vf(adev) && amdgpu_sriov_is_pp_one_vf(adev)) || amdgpu_passthrough(adev))
  		adev->compute_timeout =  msecs_to_jiffies(60000);
+	else if (amdgpu_sriov_vf(adev))
+		adev->compute_timeout =  msecs_to_jiffies(10000);

Maybe split up the first if condition to group the condition and not he timeout values. At least for me that would be less confusing:

    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);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 3125

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
  	else
  		adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;

Kind regards,

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

#2 lore raw

[AMD Official Use Only - Internal Distribution Only]

Quoted 8 lines

-----Original Message-----
From: Paul Menzel <[email protected]>
Sent: Wednesday, January 6, 2021 8:54 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: For sriov multiple VF, set compute timeout to 10s

Quoted 8 lines

Dear Emily,

Am 06.01.21 um 12:41 schrieb Emily.Deng:

Could you please remove the dot your name in your git configuration?

    git config --global user.name "Emily Deng"

Ok, will do this.

Quoted 4 lines

For the summary, maybe amend it to:

Decrease compute timeout to 10 s for sriov multiple VF

Ok, thanks, good suggestion.

Quoted 10 lines
Quoted 2 lines

For multiple VF, after engine hang,as host driver will first

Nit: Please add a space after the comma.

Quoted 1 line

encounter FLR, so has no meanning to set compute to 60s.

meaning

How can this be tested?

Setup the environment for sriov.

Quoted 26 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int

Quoted 12 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index b69c34074d8d..ed36bf97df29 100644
@@ -3117,8 +3117,10 @@ static int

amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 3123

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -1
   */
  adev->gfx_timeout = msecs_to_jiffies(10000);
  adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
-if (amdgpu_sriov_vf(adev) || amdgpu_passthrough(adev))
+if ((amdgpu_sriov_vf(adev) && amdgpu_sriov_is_pp_one_vf(adev)) ||
+amdgpu_passthrough(adev))
  adev->compute_timeout =  msecs_to_jiffies(60000);
+else if (amdgpu_sriov_vf(adev))
+adev->compute_timeout =  msecs_to_jiffies(10000);

Maybe split up the first if condition to group the condition and not he timeout values. At least for me that would be less confusing:

Quoted 9 lines
    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);

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
  else
  adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;

Good suggestion, will send out v2 patch

Quoted 4 lines

Kind regards,

Paul

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