[PATCH] drm/amdgpu: fix potential VM faults
Christian König
ckoenig.leichtzumerken at gmail.com
Wed Sep 25 14:04:54 UTC 2019
Hi Monk,
this patch doesn't prevents PD/PT eviction.
The intention of the code here was that per VM BOs can evict other per
VM BOs during allocation.
The problem my patch fixes is that this unfortunately also meant that
allocation PDs/PTs could evict other PDs/PTs from the same process.
Regards,
Christian.
Am 25.09.19 um 15:51 schrieb Liu, Monk:
> Hi Christian
>
> Theoretically the vm pt/pd should be allowed to be evicted like other BOs ..
>
> If you encountered page fault and could be avoided by this patch, that means there is bug in the VM/ttm system , and your patch simply
>
> w/a the root cause.
>
> _____________________________________
> Monk Liu|GPU Virtualization Team |AMD
>
>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Christian K?nig
> Sent: Thursday, September 19, 2019 4:42 PM
> To: amd-gfx at lists.freedesktop.org
> Subject: [PATCH] drm/amdgpu: fix potential VM faults
>
> When we allocate new page tables under memory pressure we should not evict old ones.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 70d45d48907a..8e44ecaada35 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -514,7 +514,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
> .interruptible = (bp->type != ttm_bo_type_kernel),
> .no_wait_gpu = bp->no_wait_gpu,
> .resv = bp->resv,
> - .flags = TTM_OPT_FLAG_ALLOW_RES_EVICT
> + .flags = bp->type != ttm_bo_type_kernel ?
> + TTM_OPT_FLAG_ALLOW_RES_EVICT : 0
> };
> struct amdgpu_bo *bo;
> unsigned long page_align, size = bp->size;
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list