From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH 12/12] drm/amdgpu/sriov:no shadow buffer recovery Date: Wed, 4 Oct 2017 12:56:18 +0200 Message-ID: <9b08e030-1a47-39ef-8010-64c51d4560e8@amd.com> References: <1506751432-21789-1-git-send-email-Monk.Liu@amd.com> <1506751432-21789-13-git-send-email-Monk.Liu@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0726371900==" Return-path: In-Reply-To: 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: "Liu, Monk" , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" This is a multi-part message in MIME format. --===============0726371900== Content-Type: multipart/alternative; boundary="------------04B0D2884067CF563F0B039E" Content-Language: en-US This is a multi-part message in MIME format. --------------04B0D2884067CF563F0B039E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Ah! Sorry, my fault. I've missed the "no" and thought you wanted to abandon all processing because VRAM is always lost. Going to review the remaining patches today. Christian. Am 04.10.2017 um 11:41 schrieb Liu, Monk: > > Why ? the page tables are resided in VRAM, no need to recovery if no > VRAM lost > > Sent from Mail for > Windows 10 > > *From: *Christian König > *Sent: *2017年10月1日17:36 > *To: *Liu, Monk ; > amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > *Subject: *Re: [PATCH 12/12] drm/amdgpu/sriov:no shadow buffer recovery > > Am 30.09.2017 um 08:03 schrieb Monk Liu: > > 1, we have deadlock unresloved between shadow bo recovery > > and ctx_do_release, > > > > 2, for loose mode gpu reset we always assume VRAM not lost > > so there is no need to do that from begining > > > > Change-Id: I5259f9d943239bd1fa2e45eb446ef053299fbfb1 > > Signed-off-by: Monk Liu > > NAK, even when VRAM ist lost we must restore the page tables or > otherwise no process would be able to proceed. > > Regards, > Christian. > > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 29 > ----------------------------- > > 1 file changed, 29 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > index c3f10b5..8ae7a2c 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > @@ -2840,9 +2840,7 @@ int amdgpu_sriov_gpu_reset(struct > amdgpu_device *adev, struct amdgpu_job *job) > > { > > int i, j, r = 0; > > int resched; > > - struct amdgpu_bo *bo, *tmp; > > struct amdgpu_ring *ring; > > - struct dma_fence *fence = NULL, *next = NULL; > > > > /* other thread is already into the gpu reset so just quit > and come later */ > > if (!atomic_add_unless(&adev->in_sriov_reset, 1, 1)) > > @@ -2909,33 +2907,6 @@ int amdgpu_sriov_gpu_reset(struct > amdgpu_device *adev, struct amdgpu_job *job) > > /* release full control of GPU after ib test */ > > amdgpu_virt_release_full_gpu(adev, true); > > > > - DRM_INFO("recover vram bo from shadow\n"); > > - > > - ring = adev->mman.buffer_funcs_ring; > > - mutex_lock(&adev->shadow_list_lock); > > - list_for_each_entry_safe(bo, tmp, &adev->shadow_list, > shadow_list) { > > - next = NULL; > > - amdgpu_recover_vram_from_shadow(adev, ring, bo, &next); > > - if (fence) { > > - r = dma_fence_wait(fence, false); > > - if (r) { > > - WARN(r, "recovery from shadow isn't > completed\n"); > > - break; > > - } > > - } > > - > > - dma_fence_put(fence); > > - fence = next; > > - } > > - mutex_unlock(&adev->shadow_list_lock); > > - > > - if (fence) { > > - r = dma_fence_wait(fence, false); > > - if (r) > > - WARN(r, "recovery from shadow isn't completed\n"); > > - } > > - dma_fence_put(fence); > > - > > for (i = j; i < j + AMDGPU_MAX_RINGS; ++i) { > > ring = adev->rings[i % AMDGPU_MAX_RINGS]; > > if (!ring || !ring->sched.thread) > > --------------04B0D2884067CF563F0B039E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Ah! Sorry, my fault.

I've missed the "no" and thought you wanted to abandon all processing because VRAM is always lost.

Going to review the remaining patches today.

Christian.

Am 04.10.2017 um 11:41 schrieb Liu, Monk:

Why ? the page tables are resided in VRAM, no need to recovery if no VRAM lost

 

Sent from Mail for Windows 10

 

From: Christian König
Sent: 2017
年10月1日 17:36
To: Liu, Monk; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 12/12] drm/amdgpu/sriov:no shadow buffer recovery

 

Am 30.09.2017 um 08:03 schrieb Monk Liu:
> 1, we have deadlock unresloved between shadow bo recovery
> and ctx_do_release,
>
> 2, for loose mode gpu reset we always assume VRAM not lost
> so there is no need to do that from begining
>
> Change-Id: I5259f9d943239bd1fa2e45eb446ef053299fbfb1
> Signed-off-by: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>

NAK, even when VRAM ist lost we must restore the page tables or
otherwise no process would be able to proceed.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 29 -----------------------------
>   1 file changed, 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index c3f10b5..8ae7a2c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2840,9 +2840,7 @@ int amdgpu_sriov_gpu_reset(struct amdgpu_device *adev, struct amdgpu_job *job)
>   {
>        int i, j, r = 0;
>        int resched;
> -     struct amdgpu_bo *bo, *tmp;
>        struct amdgpu_ring *ring;
> -     struct dma_fence *fence = NULL, *next = NULL;
>  
>        /* other thread is already into the gpu reset so just quit and come later */
>        if (!atomic_add_unless(&adev->in_sriov_reset, 1, 1))
> @@ -2909,33 +2907,6 @@ int amdgpu_sriov_gpu_reset(struct amdgpu_device *adev, struct amdgpu_job *job)
>        /* release full control of GPU after ib test */
>        amdgpu_virt_release_full_gpu(adev, true);
>  
> -     DRM_INFO("recover vram bo from shadow\n");
> -
> -     ring = adev->mman.buffer_funcs_ring;
> -     mutex_lock(&adev->shadow_list_lock);
> -     list_for_each_entry_safe(bo, tmp, &adev->shadow_list, shadow_list) {
> -             next = NULL;
> -             amdgpu_recover_vram_from_shadow(adev, ring, bo, &next);
> -             if (fence) {
> -                     r = dma_fence_wait(fence, false);
> -                     if (r) {
> -                             WARN(r, "recovery from shadow isn't completed\n");
> -                             break;
> -                     }
> -             }
> -
> -             dma_fence_put(fence);
> -             fence = next;
> -     }
> -     mutex_unlock(&adev->shadow_list_lock);
> -
> -     if (fence) {
> -             r = dma_fence_wait(fence, false);
> -             if (r)
> -                     WARN(r, "recovery from shadow isn't completed\n");
> -     }
> -     dma_fence_put(fence);
> -
>        for (i = j; i < j + AMDGPU_MAX_RINGS; ++i) {
>                ring = adev->rings[i % AMDGPU_MAX_RINGS];
>                if (!ring || !ring->sched.thread)



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