Skip to contentSkip to conversation

drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2

PATCH In review Christian König 3 participants 7 messages Sep 24, 2018 6 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2

From: Andrey Grodzovsky <[email protected]>

Deactivate SW interrupt fallback when all emited fences are completed. Also switch interrupt SW fallback message from INFO to WARN.

v2: shorten the warnign message a bit and only re-activate the timer during processing if it was already activated before.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +3 -2
index 1ae25835cad1..4e6e9c9654dd 100644
@@ -229,7 +229,8 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)
 
 	} while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq);
 
-	if (seq != ring->fence_drv.sync_seq)
+	if (del_timer(&ring->fence_drv.fallback_timer) &&
+	    seq != ring->fence_drv.sync_seq)
 		amdgpu_fence_schedule_fallback(ring);
 
 	if (unlikely(seq == last_seq))
@@ -274,7 +275,7 @@ static void amdgpu_fence_fallback(struct timer_list *t)
 	struct amdgpu_ring *ring = from_timer(ring, t,
 					      fence_drv.fallback_timer);
 
-	DRM_INFO("Fallback to SW interrupt on ring %s due to HW interrupt time out", ring->name);
+	DRM_WARN("Fence fallback timer expired on ring %s\n", ring->name);
 	amdgpu_fence_process(ring);
 }
 
Signature · 6 lines
2.14.1

_______________________________________________
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): 20180924121022.2071-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]>
Sent: Monday, September 24, 2018 8:10:22 AM
To: [email protected]
Subject: [PATCH] drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2

From: Andrey Grodzovsky <[email protected]>

Deactivate SW interrupt fallback when all emited fences are completed. Also switch interrupt SW fallback message from INFO to WARN.

v2: shorten the warnign message a bit and only re-activate the timer during processing if it was already activated before.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +3 -2
index 1ae25835cad1..4e6e9c9654dd 100644
@@ -229,7 +229,8 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)
 
         } while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq);
 
-       if (seq != ring->fence_drv.sync_seq)
+       if (del_timer(&ring->fence_drv.fallback_timer) &&
+           seq != ring->fence_drv.sync_seq)
                 amdgpu_fence_schedule_fallback(ring);
 
         if (unlikely(seq == last_seq))
@@ -274,7 +275,7 @@ static void amdgpu_fence_fallback(struct timer_list *t)
         struct amdgpu_ring *ring = from_timer(ring, t,
                                               fence_drv.fallback_timer);
 
-       DRM_INFO("Fallback to SW interrupt on ring %s due to HW interrupt time out", ring->name);
+       DRM_WARN("Fence fallback timer expired on ring %s\n", ring->name);
         amdgpu_fence_process(ring);
 }
 

--
2.14.1

_______________________________________________
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): BN6PR12MB18097AA77D7E8948DE462823F7170-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw

Andrey

Quoted 45 lines · Alexander

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]> *Sent:* Monday, September 24, 2018 8:10:22 AM
*To:* [email protected]
*Subject:* [PATCH] drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2
From: Andrey Grodzovsky <[email protected]>

Deactivate SW interrupt fallback when all emited fences are completed. Also switch interrupt SW fallback message from INFO to WARN.

v2: shorten the warnign message a bit and only re-activate the timer during processing if it was already activated before.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +3 -2
index 1ae25835cad1..4e6e9c9654dd 100644
@@ -229,7 +229,8 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)
 
          } while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq);
 
-       if (seq != ring->fence_drv.sync_seq)
+       if (del_timer(&ring->fence_drv.fallback_timer) &&
+           seq != ring->fence_drv.sync_seq)
                  amdgpu_fence_schedule_fallback(ring);
 
          if (unlikely(seq == last_seq))
@@ -274,7 +275,7 @@ static void amdgpu_fence_fallback(struct 
 timer_list *t)
          struct amdgpu_ring *ring = from_timer(ring, t,
 fence_drv.fallback_timer);
 
-       DRM_INFO("Fallback to SW interrupt on ring %s due to HW 
 interrupt time out", ring->name);
+       DRM_WARN("Fence fallback timer expired on ring %s\n", ring->name);
          amdgpu_fence_process(ring);
Quoted 15 lines

 }

Signature · 12 lines
2.14.1

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): 4ca8e57b-6927-e6a0-b063-9dc5a4d26952-5C7GfCeVMHo@public.gmane.org

#6 lore raw

P.S I pushed it.

Thanks,

Andrey

Quoted 65 lines · Andrey Grodzovsky

Andrey

Quoted 57 lines · Alexander

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]> *Sent:* Monday, September 24, 2018 8:10:22 AM
*To:* [email protected]
*Subject:* [PATCH] drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2
From: Andrey Grodzovsky <[email protected]>

Deactivate SW interrupt fallback when all emited fences are completed. Also switch interrupt SW fallback message from INFO to WARN.

v2: shorten the warnign message a bit and only re-activate the timer during processing if it was already activated before.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +3 -2
index 1ae25835cad1..4e6e9c9654dd 100644
@@ -229,7 +229,8 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)
 
          } while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq);
 
-       if (seq != ring->fence_drv.sync_seq)
+       if (del_timer(&ring->fence_drv.fallback_timer) &&
+           seq != ring->fence_drv.sync_seq)
                  amdgpu_fence_schedule_fallback(ring);
 
          if (unlikely(seq == last_seq))
@@ -274,7 +275,7 @@ static void amdgpu_fence_fallback(struct 
 timer_list *t)
          struct amdgpu_ring *ring = from_timer(ring, t,
 fence_drv.fallback_timer);
 
-       DRM_INFO("Fallback to SW interrupt on ring %s due to HW 
 interrupt time out", ring->name);
+       DRM_WARN("Fence fallback timer expired on ring %s\n", 
 ring->name);

         amdgpu_fence_process(ring);
 }

Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 11 lines
Quoted 4 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

A message that is not in the archive (sent off-list or not yet received): 8971d575-3279-9974-04be-45bb62cb42a3-5C7GfCeVMHo@public.gmane.org

#8 lore raw

Thanks.

One more thing which came to my mind is that we might want to print the warning only when amdgpu_fence_process has actually done some processing.

Otherwise we could get warnings for long running jobs.

Christian.

Am 24.09.2018 um 17:14 schrieb Andrey Grodzovsky:

Quoted 4 lines

P.S I pushed it.

Quoted 83 lines

Thanks,

Andrey

Quoted 76 lines · Andrey Grodzovsky

Andrey

Quoted 45 lines · Alexander

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]> *Sent:* Monday, September 24, 2018 8:10:22 AM
*To:* [email protected]
*Subject:* [PATCH] drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2
From: Andrey Grodzovsky <[email protected]>

Deactivate SW interrupt fallback when all emited fences are completed. Also switch interrupt SW fallback message from INFO to WARN.

v2: shorten the warnign message a bit and only re-activate the timer during processing if it was already activated before.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +3 -2
index 1ae25835cad1..4e6e9c9654dd 100644
@@ -229,7 +229,8 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)
 
          } while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq);
 
-       if (seq != ring->fence_drv.sync_seq)
+       if (del_timer(&ring->fence_drv.fallback_timer) &&
+           seq != ring->fence_drv.sync_seq)
                  amdgpu_fence_schedule_fallback(ring);
 
          if (unlikely(seq == last_seq))
@@ -274,7 +275,7 @@ static void amdgpu_fence_fallback(struct 
 timer_list *t)
          struct amdgpu_ring *ring = from_timer(ring, t,
 fence_drv.fallback_timer);
 
-       DRM_INFO("Fallback to SW interrupt on ring %s due to HW 
 interrupt time out", ring->name);
+       DRM_WARN("Fence fallback timer expired on ring %s\n", 
 ring->name);
Quoted 16 lines

         amdgpu_fence_process(ring);
 }

Signature · 12 lines
2.14.1

_______________________________________________
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

_______________________________________________
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): b94f9fe1-e351-79e1-0f31-6400197cf64b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#10 lore raw
Quoted 5 lines · Christian König

Thanks.

One more thing which came to my mind is that we might want to print the warning only when amdgpu_fence_process has actually done some processing.

Otherwise we could get warnings for long running jobs.

Do you mean that you want to know that amdgpu_fence_process was called from the SW fallback timer and print warning only if last_seq != seq and the while loop actually signaled something ?

Andrey

Quoted 92 lines

Christian.

Am 24.09.2018 um 17:14 schrieb Andrey Grodzovsky:

Quoted 87 lines

P.S I pushed it.

Thanks,

Andrey

Quoted 76 lines · Andrey Grodzovsky

Andrey

Quoted 45 lines · Alexander

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]> *Sent:* Monday, September 24, 2018 8:10:22 AM
*To:* [email protected]
*Subject:* [PATCH] drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2
From: Andrey Grodzovsky <[email protected]>

Deactivate SW interrupt fallback when all emited fences are completed. Also switch interrupt SW fallback message from INFO to WARN.

v2: shorten the warnign message a bit and only re-activate the timer during processing if it was already activated before.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +3 -2
index 1ae25835cad1..4e6e9c9654dd 100644
@@ -229,7 +229,8 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)
 
          } while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq);
 
-       if (seq != ring->fence_drv.sync_seq)
+       if (del_timer(&ring->fence_drv.fallback_timer) &&
+           seq != ring->fence_drv.sync_seq)
 amdgpu_fence_schedule_fallback(ring);
 
          if (unlikely(seq == last_seq))
@@ -274,7 +275,7 @@ static void amdgpu_fence_fallback(struct 
 timer_list *t)
          struct amdgpu_ring *ring = from_timer(ring, t,
 fence_drv.fallback_timer);
 
-       DRM_INFO("Fallback to SW interrupt on ring %s due to HW 
 interrupt time out", ring->name);
+       DRM_WARN("Fence fallback timer expired on ring %s\n", 
 ring->name);
Quoted 16 lines

         amdgpu_fence_process(ring);
 }

Signature · 12 lines
2.14.1

_______________________________________________
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

_______________________________________________
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): 3f12ea59-0db9-85ca-1374-7678674859f6-5C7GfCeVMHo@public.gmane.org

#12 lore raw

Am 24.09.2018 um 17:32 schrieb Andrey Grodzovsky:

Quoted 11 lines · Christian König
Quoted 5 lines

Thanks.

One more thing which came to my mind is that we might want to print the warning only when amdgpu_fence_process has actually done some processing.

Otherwise we could get warnings for long running jobs.

Do you mean that you want to know that amdgpu_fence_process was called from the SW fallback timer and print warning only if last_seq != seq and the while loop actually signaled something ?

Yeah, something like that.

Christian.

Quoted 99 lines

Andrey

Quoted 93 lines

Christian.

Am 24.09.2018 um 17:14 schrieb Andrey Grodzovsky:

Quoted 88 lines

P.S I pushed it.

Thanks,

Andrey

Quoted 77 lines · Andrey Grodzovsky

Andrey

Quoted 46 lines · Alexander

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]> *Sent:* Monday, September 24, 2018 8:10:22 AM
*To:* [email protected]
*Subject:* [PATCH] drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2
From: Andrey Grodzovsky <[email protected]>

Deactivate SW interrupt fallback when all emited fences are completed. Also switch interrupt SW fallback message from INFO to WARN.

v2: shorten the warnign message a bit and only re-activate the timer during processing if it was already activated before.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +2 -1
index 1ae25835cad1..4e6e9c9654dd 100644
@@ -229,7 +229,8 @@ void amdgpu_fence_process(struct amdgpu_ring 
 *ring)
 
          } while (atomic_cmpxchg(&drv->last_seq, last_seq, seq) != last_seq);
 
-       if (seq != ring->fence_drv.sync_seq)
+       if (del_timer(&ring->fence_drv.fallback_timer) &&
+           seq != ring->fence_drv.sync_seq)
 amdgpu_fence_schedule_fallback(ring);
 

         if (unlikely(seq == last_seq))

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 -1
@@ -274,7 +275,7 @@ static void amdgpu_fence_fallback(struct 
 timer_list *t)
          struct amdgpu_ring *ring = from_timer(ring, t,
 fence_drv.fallback_timer);
 
-       DRM_INFO("Fallback to SW interrupt on ring %s due to HW 
 interrupt time out", ring->name);
+       DRM_WARN("Fence fallback timer expired on ring %s\n", 
 ring->name);
Quoted 16 lines

         amdgpu_fence_process(ring);
 }

Signature · 12 lines
2.14.1

_______________________________________________
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

Quoted 4 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