Skip to contentSkip to conversation

drm/amdgpu: fix scheduler timeout calc

PATCH In review Cui, Flora 3 participants 5 messages Jul 1, 2019 – Jul 14, 2019 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Cui, Flora

author
#0 lore raw

PATCH v4 1/1 drm/amdgpu: fix scheduler timeout calc

scheduler timeout is in jiffies
v2: move timeout check to amdgpu_device_get_job_timeout_settings after parsing the value
v3: add lockup_timeout param check. 0: keep default value. negative:
infinity timeout.
v4: refactor codes.

Change-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +9 -4
index e74a175..e448f8e 100644
@@ -245,7 +245,8 @@ module_param_named(msi, amdgpu_msi, int, 0444);
  * 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.
  */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and no timeout for compute jobs), "
+MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and infinity timeout for compute jobs."
+		" 0: keep default value. negative: infinity timeout), "
 		"format is [Non-Compute] or [GFX,Compute,SDMA,Video]");
 module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
 
@@ -1300,7 +1301,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	 * By default timeout for non compute jobs is 10000.
 	 * And there is no timeout enforced on compute jobs.
 	 */
-	adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;
+	adev->gfx_timeout = msecs_to_jiffies(10000);
+	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
 	adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
 
 	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) {
@@ -1310,10 +1312,13 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 			if (ret)
 				return ret;
 
-			/* Invalidate 0 and negative values */
-			if (timeout <= 0) {
+			if (timeout == 0) {
 				index++;
 				continue;
+			} else if (timeout < 0) {
+				timeout = MAX_SCHEDULE_TIMEOUT;
+			} else {
+				timeout = msecs_to_jiffies(timeout);
 			}
 
 			switch (index++) {
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1561952220-5526-1-git-send-email-flora.cui-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

Ping...

-----Original Message-----
From: Cui, Flora <[email protected]>
Sent: Monday, July 1, 2019 11:37 AM
To: [email protected]
Cc: Cui, Flora <[email protected]>
Subject: [PATCH v4] drm/amdgpu: fix scheduler timeout calc

scheduler timeout is in jiffies
v2: move timeout check to amdgpu_device_get_job_timeout_settings after parsing the value
v3: add lockup_timeout param check. 0: keep default value. negative:
infinity timeout.
v4: refactor codes.

Change-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -2
index e74a175..e448f8e 100644
@@ -245,7 +245,8 @@ module_param_named(msi, amdgpu_msi, int, 0444);
  * 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.
  */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and no timeout for compute jobs), "
+MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and infinity timeout for compute jobs."
+		" 0: keep default value. negative: infinity timeout), "
 		"format is [Non-Compute] or [GFX,Compute,SDMA,Video]");  module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
 
@@ -1300,7 +1301,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	 * By default timeout for non compute jobs is 10000.
 	 * And there is no timeout enforced on compute jobs.
 	 */
-	adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;
+	adev->gfx_timeout = msecs_to_jiffies(10000);
+	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
 	adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
 
 	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) { @@ -1310,10 +1312,13 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)

if (ret)
return ret;

- /* Invalidate 0 and negative values */
- if (timeout <= 0) {
+ if (timeout == 0) {
index++; continue;
+ } else if (timeout < 0) {
+ timeout = MAX_SCHEDULE_TIMEOUT;
+ } else {
+ timeout = msecs_to_jiffies(timeout);
}

switch (index++) {
--
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): MN2PR12MB331205B8AD6A1389A7519A04FAFA0-rweVpJHSKToE250A+C2e2AdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

author
#4 lore raw

Ping...
Could anyone give me a rb?

-----Original Message-----
From: Cui, Flora
Sent: Thursday, July 4, 2019 11:09 AM
To: [email protected]
Subject: RE: [PATCH v4] drm/amdgpu: fix scheduler timeout calc

Ping...

-----Original Message-----
From: Cui, Flora <[email protected]>
Sent: Monday, July 1, 2019 11:37 AM
To: [email protected]
Cc: Cui, Flora <[email protected]>
Subject: [PATCH v4] drm/amdgpu: fix scheduler timeout calc

scheduler timeout is in jiffies
v2: move timeout check to amdgpu_device_get_job_timeout_settings after parsing the value
v3: add lockup_timeout param check. 0: keep default value. negative:
infinity timeout.
v4: refactor codes.

Change-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -2
index e74a175..e448f8e 100644
@@ -245,7 +245,8 @@ module_param_named(msi, amdgpu_msi, int, 0444);
  * 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.
  */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and no timeout for compute jobs), "
+MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and infinity timeout for compute jobs."
+		" 0: keep default value. negative: infinity timeout), "
 		"format is [Non-Compute] or [GFX,Compute,SDMA,Video]");  module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
 
@@ -1300,7 +1301,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	 * By default timeout for non compute jobs is 10000.
 	 * And there is no timeout enforced on compute jobs.
 	 */
-	adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;
+	adev->gfx_timeout = msecs_to_jiffies(10000);
+	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
 	adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
 
 	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) { @@ -1310,10 +1312,13 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)

if (ret)
return ret;

- /* Invalidate 0 and negative values */
- if (timeout <= 0) {
+ if (timeout == 0) {
index++; continue;
+ } else if (timeout < 0) {
+ timeout = MAX_SCHEDULE_TIMEOUT;
+ } else {
+ timeout = msecs_to_jiffies(timeout);
}

switch (index++) {
--
2.7.4

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

#5 lore raw
In reply to a message not in the archive
Reviewed-by [email protected]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Cui, Flora
Sent: Monday, July 1, 2019 11:37 AM
To: [email protected]
Cc: Cui, Flora <[email protected]>
Subject: [PATCH v4] drm/amdgpu: fix scheduler timeout calc

scheduler timeout is in jiffies
v2: move timeout check to amdgpu_device_get_job_timeout_settings after parsing the value
v3: add lockup_timeout param check. 0: keep default value. negative:
infinity timeout.
v4: refactor codes.

Change-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -2
index e74a175..e448f8e 100644
@@ -245,7 +245,8 @@ module_param_named(msi, amdgpu_msi, int, 0444);
  * 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.
  */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and no timeout for compute jobs), "
+MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and infinity timeout for compute jobs."
+		" 0: keep default value. negative: infinity timeout), "
 		"format is [Non-Compute] or [GFX,Compute,SDMA,Video]");  module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
 
@@ -1300,7 +1301,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	 * By default timeout for non compute jobs is 10000.
 	 * And there is no timeout enforced on compute jobs.
 	 */
-	adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;
+	adev->gfx_timeout = msecs_to_jiffies(10000);
+	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
 	adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
 
 	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) { @@ -1310,10 +1312,13 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)

if (ret)
return ret;

- /* Invalidate 0 and negative values */
- if (timeout <= 0) {
+ if (timeout == 0) {
index++;
continue;
+ } else if (timeout < 0) {
+ timeout = MAX_SCHEDULE_TIMEOUT;
+ } else {
+ timeout = msecs_to_jiffies(timeout);
}

switch (index++) {
--
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): CH2PR12MB3767D1E71B22B99D41ECAB20FEF50-rV3HgkLYx2Vb0rI3ZRjBIAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by
#7 lore raw

Sorry for the delay, I've been on vacation for two weeks.

Christian.

Am 05.07.19 um 07:37 schrieb Xu, Feifei:

Quoted 62 lines
Reviewed-by [email protected]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Cui, Flora
Sent: Monday, July 1, 2019 11:37 AM
To: [email protected]
Cc: Cui, Flora <[email protected]>
Subject: [PATCH v4] drm/amdgpu: fix scheduler timeout calc

scheduler timeout is in jiffies
v2: move timeout check to amdgpu_device_get_job_timeout_settings after parsing the value
v3: add lockup_timeout param check. 0: keep default value. negative:
infinity timeout.
v4: refactor codes.

Change-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++----
  1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -2
index e74a175..e448f8e 100644
@@ -245,7 +245,8 @@ module_param_named(msi, amdgpu_msi, int, 0444);
   * 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.
   */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and no timeout for compute jobs), "
+MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and infinity timeout for compute jobs."
+		" 0: keep default value. negative: infinity timeout), "
  		"format is [Non-Compute] or [GFX,Compute,SDMA,Video]");  module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
 
@@ -1300,7 +1301,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
  	 * By default timeout for non compute jobs is 10000.
  	 * And there is no timeout enforced on compute jobs.
  	 */
-	adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;
+	adev->gfx_timeout = msecs_to_jiffies(10000);
+	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
  	adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
 
  	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) { @@ -1310,10 +1312,13 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)

if (ret)
return ret;

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -3
-			/* Invalidate 0 and negative values */
-			if (timeout <= 0) {
+			if (timeout == 0) {
  				index++;
  				continue;
+			} else if (timeout < 0) {
+				timeout = MAX_SCHEDULE_TIMEOUT;
+			} else {
+				timeout = msecs_to_jiffies(timeout);
  			}
 
  			switch (index++) {
--

2.7.4

Quoted 8 lines

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

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