From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH] drm/amdgpu: Deactivate SW interrupt fallback in amdgpu_fence_process v2 Date: Mon, 24 Sep 2018 19:44:49 +0200 Message-ID: References: <20180924121022.2071-1-christian.koenig@amd.com> <4ca8e57b-6927-e6a0-b063-9dc5a4d26952@amd.com> <8971d575-3279-9974-04be-45bb62cb42a3@amd.com> <3f12ea59-0db9-85ca-1374-7678674859f6@amd.com> Reply-To: christian.koenig-5C7GfCeVMHo@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1744632489==" Return-path: In-Reply-To: <3f12ea59-0db9-85ca-1374-7678674859f6-5C7GfCeVMHo@public.gmane.org> Content-Language: en-US List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: Andrey Grodzovsky , christian.koenig-5C7GfCeVMHo@public.gmane.org, "Deucher, Alexander" , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" This is a multi-part message in MIME format. --===============1744632489== Content-Type: multipart/alternative; boundary="------------6D0C19749EF0216871A56733" Content-Language: en-US This is a multi-part message in MIME format. --------------6D0C19749EF0216871A56733 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Am 24.09.2018 um 17:32 schrieb Andrey Grodzovsky: > > > > On 09/24/2018 11:19 AM, Christian König wrote: >> 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. > > Andrey > >> >> Christian. >> >> Am 24.09.2018 um 17:14 schrieb Andrey Grodzovsky: >>> >>> P.S I pushed it. >>> >>> >>> Thanks, >>> >>> Andrey >>> >>> >>> On 09/24/2018 11:13 AM, Andrey Grodzovsky wrote: >>>> >>>> Reviewed-and-Tested-by: Andrey Grodzovsky >>>> >>>> >>>> Andrey >>>> >>>> >>>> On 09/24/2018 10:31 AM, Deucher, Alexander wrote: >>>>> >>>>> Acked-by: Alex Deucher >>>>> >>>>> ------------------------------------------------------------------------ >>>>> *From:* amd-gfx on behalf >>>>> of Christian König >>>>> *Sent:* Monday, September 24, 2018 8:10:22 AM >>>>> *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org >>>>> *Subject:* [PATCH] drm/amdgpu: Deactivate SW interrupt fallback in >>>>> amdgpu_fence_process v2 >>>>> From: Andrey Grodzovsky >>>>> >>>>> 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. >>>>> >>>>> Signed-off-by: Andrey Grodzovsky >>>>> Suggested-by: Christian Konig >>>>> --- >>>>>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++-- >>>>>  1 file changed, 3 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c >>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c >>>>> index 1ae25835cad1..4e6e9c9654dd 100644 >>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c >>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c >>>>> @@ -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 >>>>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org >>>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx >>>>> >>>>> >>>>> _______________________________________________ >>>>> amd-gfx mailing list >>>>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org >>>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx >>>> >>>> >>>> >>>> _______________________________________________ >>>> amd-gfx mailing list >>>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org >>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx >>> >> > > > > _______________________________________________ > amd-gfx mailing list > amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx --------------6D0C19749EF0216871A56733 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit
Am 24.09.2018 um 17:32 schrieb Andrey Grodzovsky:



On 09/24/2018 11:19 AM, Christian König wrote:
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.


Andrey


Christian.

Am 24.09.2018 um 17:14 schrieb Andrey Grodzovsky:

P.S I pushed it.


Thanks,

Andrey


On 09/24/2018 11:13 AM, Andrey Grodzovsky wrote:

Reviewed-and-Tested-by: Andrey Grodzovsky <andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>


Andrey


On 09/24/2018 10:31 AM, Deucher, Alexander wrote:

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

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.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
Suggested-by: Christian Konig <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index 1ae25835cad1..4e6e9c9654dd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -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
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx





_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

--------------6D0C19749EF0216871A56733-- --===============1744632489== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============1744632489==--