* [PATCH] drm/amdgpu: fix amdgpu_vm_clear_freed
@ 2017-04-19 14:07 Christian König
[not found] ` <1492610826-1874-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2017-04-19 14:07 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Christian König <christian.koenig@amd.com>
Use amdgpu_vm_bo_update_mapping() instead of amdgpu_vm_bo_split_mapping() here.
We don't want any flags set in the cleared areas and splitting
should be unnecessary.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 9017b51..27af436 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1631,8 +1631,9 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
struct amdgpu_bo_va_mapping, list);
list_del(&mapping->list);
- r = amdgpu_vm_bo_split_mapping(adev, NULL, 0, NULL, vm, mapping,
- 0, 0, &f);
+ r = amdgpu_vm_bo_update_mapping(adev, NULL, 0, NULL, vm,
+ mapping->start, mapping->last,
+ 0, 0, &f);
amdgpu_vm_free_mapping(adev, vm, mapping, f);
if (r) {
fence_put(f);
--
2.5.0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] drm/amdgpu: fix amdgpu_vm_clear_freed
[not found] ` <1492610826-1874-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2017-04-19 16:21 ` Deucher, Alexander
2017-04-20 5:49 ` Zhang, Jerry (Junwei)
1 sibling, 0 replies; 4+ messages in thread
From: Deucher, Alexander @ 2017-04-19 16:21 UTC (permalink / raw)
To: 'Christian König', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Christian König
> Sent: Wednesday, April 19, 2017 10:07 AM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH] drm/amdgpu: fix amdgpu_vm_clear_freed
>
> From: Christian König <christian.koenig@amd.com>
>
> Use amdgpu_vm_bo_update_mapping() instead of
> amdgpu_vm_bo_split_mapping() here.
>
> We don't want any flags set in the cleared areas and splitting
> should be unnecessary.
I think you mean "shouldn't"? With that fixed:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 9017b51..27af436 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1631,8 +1631,9 @@ int amdgpu_vm_clear_freed(struct
> amdgpu_device *adev,
> struct amdgpu_bo_va_mapping, list);
> list_del(&mapping->list);
>
> - r = amdgpu_vm_bo_split_mapping(adev, NULL, 0, NULL, vm,
> mapping,
> - 0, 0, &f);
> + r = amdgpu_vm_bo_update_mapping(adev, NULL, 0, NULL,
> vm,
> + mapping->start, mapping-
> >last,
> + 0, 0, &f);
> amdgpu_vm_free_mapping(adev, vm, mapping, f);
> if (r) {
> fence_put(f);
> --
> 2.5.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: fix amdgpu_vm_clear_freed
[not found] ` <1492610826-1874-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-19 16:21 ` Deucher, Alexander
@ 2017-04-20 5:49 ` Zhang, Jerry (Junwei)
[not found] ` <58F84BD5.5020208-5C7GfCeVMHo@public.gmane.org>
1 sibling, 1 reply; 4+ messages in thread
From: Zhang, Jerry (Junwei) @ 2017-04-20 5:49 UTC (permalink / raw)
To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 04/19/2017 10:07 PM, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> Use amdgpu_vm_bo_update_mapping() instead of amdgpu_vm_bo_split_mapping() here.
>
> We don't want any flags set in the cleared areas and splitting
> should be unnecessary.
Yeah, the mappings in the freed list are split already, I think.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 9017b51..27af436 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1631,8 +1631,9 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
> struct amdgpu_bo_va_mapping, list);
> list_del(&mapping->list);
>
> - r = amdgpu_vm_bo_split_mapping(adev, NULL, 0, NULL, vm, mapping,
> - 0, 0, &f);
> + r = amdgpu_vm_bo_update_mapping(adev, NULL, 0, NULL, vm,
> + mapping->start, mapping->last,
> + 0, 0, &f);
We may also pass the offset for updating.
+ r = amdgpu_vm_bo_update_mapping(adev, NULL, 0, NULL, vm,
+ mapping->start, mapping->last,
+ 0, mapping->offset, &f);
Jerry
> amdgpu_vm_free_mapping(adev, vm, mapping, f);
> if (r) {
> fence_put(f);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: fix amdgpu_vm_clear_freed
[not found] ` <58F84BD5.5020208-5C7GfCeVMHo@public.gmane.org>
@ 2017-04-20 6:12 ` Zhang, Jerry (Junwei)
0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Jerry (Junwei) @ 2017-04-20 6:12 UTC (permalink / raw)
To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 04/20/2017 01:49 PM, Zhang, Jerry (Junwei) wrote:
> On 04/19/2017 10:07 PM, Christian König wrote:
>> From: Christian König <christian.koenig@amd.com>
>>
>> Use amdgpu_vm_bo_update_mapping() instead of amdgpu_vm_bo_split_mapping() here.
>>
>> We don't want any flags set in the cleared areas and splitting
>> should be unnecessary.
>
> Yeah, the mappings in the freed list are split already, I think.
>
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index 9017b51..27af436 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -1631,8 +1631,9 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
>> struct amdgpu_bo_va_mapping, list);
>> list_del(&mapping->list);
>>
>> - r = amdgpu_vm_bo_split_mapping(adev, NULL, 0, NULL, vm, mapping,
>> - 0, 0, &f);
>> + r = amdgpu_vm_bo_update_mapping(adev, NULL, 0, NULL, vm,
>> + mapping->start, mapping->last,
>> + 0, 0, &f);
>
> We may also pass the offset for updating.
> + r = amdgpu_vm_bo_update_mapping(adev, NULL, 0, NULL, vm,
> + mapping->start, mapping->last,
> + 0, mapping->offset, &f);
Checking it more, the offset is not key value for clear op, as it's invalid
then regardless of the address bit inside the PTE.
So,
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
>
> Jerry
>
>> amdgpu_vm_free_mapping(adev, vm, mapping, f);
>> if (r) {
>> fence_put(f);
>>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-20 6:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 14:07 [PATCH] drm/amdgpu: fix amdgpu_vm_clear_freed Christian König
[not found] ` <1492610826-1874-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-19 16:21 ` Deucher, Alexander
2017-04-20 5:49 ` Zhang, Jerry (Junwei)
[not found] ` <58F84BD5.5020208-5C7GfCeVMHo@public.gmane.org>
2017-04-20 6:12 ` Zhang, Jerry (Junwei)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.