All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Reserve fence slots for command submission
@ 2018-07-04  3:02 ` Junwei Zhang
  0 siblings, 0 replies; 12+ messages in thread
From: Junwei Zhang @ 2018-07-04  3:02 UTC (permalink / raw)
  To: amd-gfx; +Cc: michel.daenzer, christian.koenig, stable, Junwei Zhang

From: Michel Dänzer <michel.daenzer@amd.com>

Without this, there could not be enough slots, which could trigger the
BUG_ON in reservation_object_add_shared_fence.

v2:
* Jump to the error label instead of returning directly (Jerry Zhang)
v3:
* Reserve slots for command submission after VM updates (Christian König)

Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/106418
Reported-by: mikhail.v.gavrilov@gmail.com
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 7a625f3..1bc0281 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -928,6 +928,10 @@ static int amdgpu_cs_ib_vm_chunk(struct amdgpu_device *adev,
 		r = amdgpu_bo_vm_update_pte(p);
 		if (r)
 			return r;
+
+		r = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv);
+		if (r)
+			return r;
 	}
 
 	return amdgpu_cs_sync_rings(p);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] drm/amdgpu: Reserve fence slots for command submission
@ 2018-07-04  3:02 ` Junwei Zhang
  0 siblings, 0 replies; 12+ messages in thread
From: Junwei Zhang @ 2018-07-04  3:02 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Junwei Zhang, michel.daenzer-5C7GfCeVMHo,
	christian.koenig-5C7GfCeVMHo, stable-u79uwXL29TY76Z2rM5mHXA

From: Michel Dänzer <michel.daenzer@amd.com>

Without this, there could not be enough slots, which could trigger the
BUG_ON in reservation_object_add_shared_fence.

v2:
* Jump to the error label instead of returning directly (Jerry Zhang)
v3:
* Reserve slots for command submission after VM updates (Christian König)

Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/106418
Reported-by: mikhail.v.gavrilov@gmail.com
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 7a625f3..1bc0281 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -928,6 +928,10 @@ static int amdgpu_cs_ib_vm_chunk(struct amdgpu_device *adev,
 		r = amdgpu_bo_vm_update_pte(p);
 		if (r)
 			return r;
+
+		r = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv);
+		if (r)
+			return r;
 	}
 
 	return amdgpu_cs_sync_rings(p);
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
  2018-07-04  3:02 ` Junwei Zhang
  (?)
@ 2018-07-04  6:34 ` Christian König
  2018-07-04  6:55     ` Zhang, Jerry (Junwei)
  -1 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2018-07-04  6:34 UTC (permalink / raw)
  To: Junwei Zhang, amd-gfx; +Cc: michel.daenzer, christian.koenig, stable

Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> Without this, there could not be enough slots, which could trigger the
> BUG_ON in reservation_object_add_shared_fence.
>
> v2:
> * Jump to the error label instead of returning directly (Jerry Zhang)
> v3:
> * Reserve slots for command submission after VM updates (Christian König)
>
> Cc: stable@vger.kernel.org
> Bugzilla: https://bugs.freedesktop.org/106418
> Reported-by: mikhail.v.gavrilov@gmail.com
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>

I would put that at the end of amdgpu_bo_vm_update_pte(), but that is 
only a minor nit pick.

Patch is Reviewed-by: Christian König <christian.koenig@amd.com> anyway.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 7a625f3..1bc0281 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -928,6 +928,10 @@ static int amdgpu_cs_ib_vm_chunk(struct amdgpu_device *adev,
>   		r = amdgpu_bo_vm_update_pte(p);
>   		if (r)
>   			return r;
> +
> +		r = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv);
> +		if (r)
> +			return r;
>   	}
>   
>   	return amdgpu_cs_sync_rings(p);

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
  2018-07-04  6:34 ` Christian König
@ 2018-07-04  6:55     ` Zhang, Jerry (Junwei)
  0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-07-04  6:55 UTC (permalink / raw)
  To: christian.koenig, amd-gfx; +Cc: michel.daenzer, stable

On 07/04/2018 02:34 PM, Christian König wrote:
> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>> From: Michel Dänzer <michel.daenzer@amd.com>
>>
>> Without this, there could not be enough slots, which could trigger the
>> BUG_ON in reservation_object_add_shared_fence.
>>
>> v2:
>> * Jump to the error label instead of returning directly (Jerry Zhang)
>> v3:
>> * Reserve slots for command submission after VM updates (Christian König)
>>
>> Cc: stable@vger.kernel.org
>> Bugzilla: https://bugs.freedesktop.org/106418
>> Reported-by: mikhail.v.gavrilov@gmail.com
>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>
> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is only a minor nit pick.

At first, I really put it at the end of amdgpu_bo_vm_update_pte().
On the 2nd thought, that func may be called by others(although it's not for now),
so I move it out of there to the caller.

Jerry

>
> Patch is Reviewed-by: Christian König <christian.koenig@amd.com> anyway.
>
> Regards,
> Christian.
>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> index 7a625f3..1bc0281 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> @@ -928,6 +928,10 @@ static int amdgpu_cs_ib_vm_chunk(struct amdgpu_device *adev,
>>           r = amdgpu_bo_vm_update_pte(p);
>>           if (r)
>>               return r;
>> +
>> +        r = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv);
>> +        if (r)
>> +            return r;
>>       }
>>       return amdgpu_cs_sync_rings(p);
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
@ 2018-07-04  6:55     ` Zhang, Jerry (Junwei)
  0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-07-04  6:55 UTC (permalink / raw)
  To: christian.koenig, amd-gfx; +Cc: michel.daenzer, stable

On 07/04/2018 02:34 PM, Christian König wrote:
> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>> From: Michel Dänzer <michel.daenzer@amd.com>
>>
>> Without this, there could not be enough slots, which could trigger the
>> BUG_ON in reservation_object_add_shared_fence.
>>
>> v2:
>> * Jump to the error label instead of returning directly (Jerry Zhang)
>> v3:
>> * Reserve slots for command submission after VM updates (Christian König)
>>
>> Cc: stable@vger.kernel.org
>> Bugzilla: https://bugs.freedesktop.org/106418
>> Reported-by: mikhail.v.gavrilov@gmail.com
>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>
> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is only a minor nit pick.

At first, I really put it at the end of amdgpu_bo_vm_update_pte().
On the 2nd thought, that func may be called by others(although it's not for now),
so I move it out of there to the caller.

Jerry

>
> Patch is Reviewed-by: Christian König <christian.koenig@amd.com> anyway.
>
> Regards,
> Christian.
>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> index 7a625f3..1bc0281 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> @@ -928,6 +928,10 @@ static int amdgpu_cs_ib_vm_chunk(struct amdgpu_device *adev,
>>           r = amdgpu_bo_vm_update_pte(p);
>>           if (r)
>>               return r;
>> +
>> +        r = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv);
>> +        if (r)
>> +            return r;
>>       }
>>       return amdgpu_cs_sync_rings(p);
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
       [not found]     ` <5B3C6F7B.80901-5C7GfCeVMHo@public.gmane.org>
@ 2018-07-04  7:21       ` Michel Dänzer
       [not found]         ` <9fd5d981-3725-289b-94ff-73da521e3061-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Michel Dänzer @ 2018-07-04  7:21 UTC (permalink / raw)
  To: Zhang, Jerry (Junwei), christian.koenig-5C7GfCeVMHo
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-07-04 08:55 AM, Zhang, Jerry (Junwei) wrote:
> On 07/04/2018 02:34 PM, Christian König wrote:
>> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>>> From: Michel Dänzer <michel.daenzer@amd.com>
>>>
>>> Without this, there could not be enough slots, which could trigger the
>>> BUG_ON in reservation_object_add_shared_fence.
>>>
>>> v2:
>>> * Jump to the error label instead of returning directly (Jerry Zhang)
>>> v3:
>>> * Reserve slots for command submission after VM updates (Christian
>>> König)
>>>
>>> Cc: stable@vger.kernel.org
>>> Bugzilla: https://bugs.freedesktop.org/106418
>>> Reported-by: mikhail.v.gavrilov@gmail.com
>>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>
>> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is
>> only a minor nit pick.
> 
> At first, I really put it at the end of amdgpu_bo_vm_update_pte().
> On the 2nd thought, that func may be called by others(although it's not
> for now), so I move it out of there to the caller.

Makes sense to me, FWIW. Thanks Junwei and Christian!


P.S. Christian, any feedback on
https://patchwork.freedesktop.org/patch/232204/ ?

-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
       [not found]         ` <9fd5d981-3725-289b-94ff-73da521e3061-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-07-04  7:57           ` Zhang, Jerry (Junwei)
       [not found]             ` <5B3C7DE6.3020405-5C7GfCeVMHo@public.gmane.org>
  2018-07-04  9:02           ` Christian König
  1 sibling, 1 reply; 12+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-07-04  7:57 UTC (permalink / raw)
  To: Michel Dänzer, christian.koenig-5C7GfCeVMHo
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 07/04/2018 03:21 PM, Michel Dänzer wrote:
> On 2018-07-04 08:55 AM, Zhang, Jerry (Junwei) wrote:
>> On 07/04/2018 02:34 PM, Christian König wrote:
>>> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>>>> From: Michel Dänzer <michel.daenzer@amd.com>
>>>>
>>>> Without this, there could not be enough slots, which could trigger the
>>>> BUG_ON in reservation_object_add_shared_fence.
>>>>
>>>> v2:
>>>> * Jump to the error label instead of returning directly (Jerry Zhang)
>>>> v3:
>>>> * Reserve slots for command submission after VM updates (Christian
>>>> König)
>>>>
>>>> Cc: stable@vger.kernel.org
>>>> Bugzilla: https://bugs.freedesktop.org/106418
>>>> Reported-by: mikhail.v.gavrilov@gmail.com
>>>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>>
>>> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is
>>> only a minor nit pick.
>>
>> At first, I really put it at the end of amdgpu_bo_vm_update_pte().
>> On the 2nd thought, that func may be called by others(although it's not
>> for now), so I move it out of there to the caller.
>
> Makes sense to me, FWIW. Thanks Junwei and Christian!

Please confirm if that works in your side.
If yes, I would push that to drm-next then.

Thanks.

Jerry

>
>
> P.S. Christian, any feedback on
> https://patchwork.freedesktop.org/patch/232204/ ?
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
       [not found]             ` <5B3C7DE6.3020405-5C7GfCeVMHo@public.gmane.org>
@ 2018-07-04  9:01               ` Christian König
       [not found]                 ` <9211988c-b543-e0b1-7598-59cad147fb28-5C7GfCeVMHo@public.gmane.org>
  2018-07-04 14:00               ` Michel Dänzer
  1 sibling, 1 reply; 12+ messages in thread
From: Christian König @ 2018-07-04  9:01 UTC (permalink / raw)
  To: Zhang, Jerry (Junwei), Michel Dänzer
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 04.07.2018 um 09:57 schrieb Zhang, Jerry (Junwei):
> On 07/04/2018 03:21 PM, Michel Dänzer wrote:
>> On 2018-07-04 08:55 AM, Zhang, Jerry (Junwei) wrote:
>>> On 07/04/2018 02:34 PM, Christian König wrote:
>>>> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>>>>> From: Michel Dänzer <michel.daenzer@amd.com>
>>>>>
>>>>> Without this, there could not be enough slots, which could trigger 
>>>>> the
>>>>> BUG_ON in reservation_object_add_shared_fence.
>>>>>
>>>>> v2:
>>>>> * Jump to the error label instead of returning directly (Jerry Zhang)
>>>>> v3:
>>>>> * Reserve slots for command submission after VM updates (Christian
>>>>> König)
>>>>>
>>>>> Cc: stable@vger.kernel.org
>>>>> Bugzilla: https://bugs.freedesktop.org/106418
>>>>> Reported-by: mikhail.v.gavrilov@gmail.com
>>>>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>>>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>>>
>>>> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is
>>>> only a minor nit pick.
>>>
>>> At first, I really put it at the end of amdgpu_bo_vm_update_pte().
>>> On the 2nd thought, that func may be called by others(although it's not
>>> for now), so I move it out of there to the caller.

Well that is exactly the reason I wanted to have it in 
amdgpu_bo_vm_update_pte() :)

But you are right, there are good arguments for both approach and as 
long as we don't have a second user it doesn't matter.

Christian.

>>
>> Makes sense to me, FWIW. Thanks Junwei and Christian!
>
> Please confirm if that works in your side.
> If yes, I would push that to drm-next then.
>
> Thanks.
>
> Jerry
>
>>
>>
>> P.S. Christian, any feedback on
>> https://patchwork.freedesktop.org/patch/232204/ ?
>>

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
       [not found]         ` <9fd5d981-3725-289b-94ff-73da521e3061-otUistvHUpPR7s880joybQ@public.gmane.org>
  2018-07-04  7:57           ` Zhang, Jerry (Junwei)
@ 2018-07-04  9:02           ` Christian König
  1 sibling, 0 replies; 12+ messages in thread
From: Christian König @ 2018-07-04  9:02 UTC (permalink / raw)
  To: Michel Dänzer, Zhang, Jerry (Junwei)
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 04.07.2018 um 09:21 schrieb Michel Dänzer:
> On 2018-07-04 08:55 AM, Zhang, Jerry (Junwei) wrote:
>> On 07/04/2018 02:34 PM, Christian König wrote:
>>> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>>>> From: Michel Dänzer <michel.daenzer@amd.com>
>>>>
>>>> Without this, there could not be enough slots, which could trigger the
>>>> BUG_ON in reservation_object_add_shared_fence.
>>>>
>>>> v2:
>>>> * Jump to the error label instead of returning directly (Jerry Zhang)
>>>> v3:
>>>> * Reserve slots for command submission after VM updates (Christian
>>>> König)
>>>>
>>>> Cc: stable@vger.kernel.org
>>>> Bugzilla: https://bugs.freedesktop.org/106418
>>>> Reported-by: mikhail.v.gavrilov@gmail.com
>>>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is
>>> only a minor nit pick.
>> At first, I really put it at the end of amdgpu_bo_vm_update_pte().
>> On the 2nd thought, that func may be called by others(although it's not
>> for now), so I move it out of there to the caller.
> Makes sense to me, FWIW. Thanks Junwei and Christian!
>
>
> P.S. Christian, any feedback on
> https://patchwork.freedesktop.org/patch/232204/ ?

Just did, thanks for pointing that out once more.

Read the mail during my vacation, but forgot to answer it on Monday.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
       [not found]                 ` <9211988c-b543-e0b1-7598-59cad147fb28-5C7GfCeVMHo@public.gmane.org>
@ 2018-07-04  9:15                   ` Michel Dänzer
       [not found]                     ` <6a23190d-dafe-956d-793e-c0100f3d405c-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Michel Dänzer @ 2018-07-04  9:15 UTC (permalink / raw)
  To: Christian König, Zhang, Jerry (Junwei)
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-07-04 11:01 AM, Christian König wrote:
> Am 04.07.2018 um 09:57 schrieb Zhang, Jerry (Junwei):
>> On 07/04/2018 03:21 PM, Michel Dänzer wrote:
>>> On 2018-07-04 08:55 AM, Zhang, Jerry (Junwei) wrote:
>>>> On 07/04/2018 02:34 PM, Christian König wrote:
>>>>> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>>>>>> From: Michel Dänzer <michel.daenzer@amd.com>
>>>>>>
>>>>>> Without this, there could not be enough slots, which could trigger
>>>>>> the
>>>>>> BUG_ON in reservation_object_add_shared_fence.
>>>>>>
>>>>>> v2:
>>>>>> * Jump to the error label instead of returning directly (Jerry Zhang)
>>>>>> v3:
>>>>>> * Reserve slots for command submission after VM updates (Christian
>>>>>> König)
>>>>>>
>>>>>> Cc: stable@vger.kernel.org
>>>>>> Bugzilla: https://bugs.freedesktop.org/106418
>>>>>> Reported-by: mikhail.v.gavrilov@gmail.com
>>>>>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>>>>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>>>>
>>>>> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is
>>>>> only a minor nit pick.
>>>>
>>>> At first, I really put it at the end of amdgpu_bo_vm_update_pte().
>>>> On the 2nd thought, that func may be called by others(although it's not
>>>> for now), so I move it out of there to the caller.
> 
> Well that is exactly the reason I wanted to have it in
> amdgpu_bo_vm_update_pte() :)
> 
> But you are right, there are good arguments for both approach and as
> long as we don't have a second user it doesn't matter.

In general, I think it's better to keep the
reservation_object_reserve_shared calls as close as possible to the
corresponding reservation_object_add_shared_fence calls, otherwise it's
hard to keep track of whether or not a slot is reserved at any given point.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
       [not found]                     ` <6a23190d-dafe-956d-793e-c0100f3d405c-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-07-04  9:23                       ` Zhang, Jerry (Junwei)
  0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-07-04  9:23 UTC (permalink / raw)
  To: Michel Dänzer, Christian König
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 07/04/2018 05:15 PM, Michel Dänzer wrote:
> On 2018-07-04 11:01 AM, Christian König wrote:
>> Am 04.07.2018 um 09:57 schrieb Zhang, Jerry (Junwei):
>>> On 07/04/2018 03:21 PM, Michel Dänzer wrote:
>>>> On 2018-07-04 08:55 AM, Zhang, Jerry (Junwei) wrote:
>>>>> On 07/04/2018 02:34 PM, Christian König wrote:
>>>>>> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>>>>>>> From: Michel Dänzer <michel.daenzer@amd.com>
>>>>>>>
>>>>>>> Without this, there could not be enough slots, which could trigger
>>>>>>> the
>>>>>>> BUG_ON in reservation_object_add_shared_fence.
>>>>>>>
>>>>>>> v2:
>>>>>>> * Jump to the error label instead of returning directly (Jerry Zhang)
>>>>>>> v3:
>>>>>>> * Reserve slots for command submission after VM updates (Christian
>>>>>>> König)
>>>>>>>
>>>>>>> Cc: stable@vger.kernel.org
>>>>>>> Bugzilla: https://bugs.freedesktop.org/106418
>>>>>>> Reported-by: mikhail.v.gavrilov@gmail.com
>>>>>>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>>>>>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>>>>>
>>>>>> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is
>>>>>> only a minor nit pick.
>>>>>
>>>>> At first, I really put it at the end of amdgpu_bo_vm_update_pte().
>>>>> On the 2nd thought, that func may be called by others(although it's not
>>>>> for now), so I move it out of there to the caller.
>>
>> Well that is exactly the reason I wanted to have it in
>> amdgpu_bo_vm_update_pte() :)
>>
>> But you are right, there are good arguments for both approach and as
>> long as we don't have a second user it doesn't matter.
>
> In general, I think it's better to keep the
> reservation_object_reserve_shared calls as close as possible to the
> corresponding reservation_object_add_shared_fence calls, otherwise it's
> hard to keep track of whether or not a slot is reserved at any given point.

Agree, I also consider that previously, just before the command submission.
while I think 2 more things then:

1) amdgpu_cs_ib_vm_chunk() is unique func during cs ioctl,
in another word, it's a MUST part of that, so it will not impact others.
Additionally it also checks if vm used, otherwise, the reserve is not needed either.

2) adding the reserve with vm checking in amdgpu_cs_submit() looks not so good as well.
IMO. so I decide to insert that in amdgpu_cs_ib_vm_chunk() vm existing case.

BTW, we may add some comments in code as well to better reference in the future.

Jerry

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
       [not found]             ` <5B3C7DE6.3020405-5C7GfCeVMHo@public.gmane.org>
  2018-07-04  9:01               ` Christian König
@ 2018-07-04 14:00               ` Michel Dänzer
  1 sibling, 0 replies; 12+ messages in thread
From: Michel Dänzer @ 2018-07-04 14:00 UTC (permalink / raw)
  To: Zhang, Jerry (Junwei); +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-07-04 09:57 AM, Zhang, Jerry (Junwei) wrote:
> On 07/04/2018 03:21 PM, Michel Dänzer wrote:
>> On 2018-07-04 08:55 AM, Zhang, Jerry (Junwei) wrote:
>>> On 07/04/2018 02:34 PM, Christian König wrote:
>>>> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>>>>> From: Michel Dänzer <michel.daenzer@amd.com>
>>>>>
>>>>> Without this, there could not be enough slots, which could trigger the
>>>>> BUG_ON in reservation_object_add_shared_fence.
>>>>>
>>>>> v2:
>>>>> * Jump to the error label instead of returning directly (Jerry Zhang)
>>>>> v3:
>>>>> * Reserve slots for command submission after VM updates (Christian
>>>>> König)
>>>>>
>>>>> Cc: stable@vger.kernel.org
>>>>> Bugzilla: https://bugs.freedesktop.org/106418
>>>>> Reported-by: mikhail.v.gavrilov@gmail.com
>>>>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>>>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>>>
>>>> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is
>>>> only a minor nit pick.
>>>
>>> At first, I really put it at the end of amdgpu_bo_vm_update_pte().
>>> On the 2nd thought, that func may be called by others(although it's not
>>> for now), so I move it out of there to the caller.
>>
>> Makes sense to me, FWIW. Thanks Junwei and Christian!
> 
> Please confirm if that works in your side.
> If yes, I would push that to drm-next then.

Go ahead, seems fine.


P.S. Maybe the shortlog could be more specific, e.g.

drm/amdgpu: Reserve VM root shared fence slot for command submission

-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-07-04 14:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04  3:02 [PATCH] drm/amdgpu: Reserve fence slots for command submission Junwei Zhang
2018-07-04  3:02 ` Junwei Zhang
2018-07-04  6:34 ` Christian König
2018-07-04  6:55   ` Zhang, Jerry (Junwei)
2018-07-04  6:55     ` Zhang, Jerry (Junwei)
     [not found]     ` <5B3C6F7B.80901-5C7GfCeVMHo@public.gmane.org>
2018-07-04  7:21       ` Michel Dänzer
     [not found]         ` <9fd5d981-3725-289b-94ff-73da521e3061-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-04  7:57           ` Zhang, Jerry (Junwei)
     [not found]             ` <5B3C7DE6.3020405-5C7GfCeVMHo@public.gmane.org>
2018-07-04  9:01               ` Christian König
     [not found]                 ` <9211988c-b543-e0b1-7598-59cad147fb28-5C7GfCeVMHo@public.gmane.org>
2018-07-04  9:15                   ` Michel Dänzer
     [not found]                     ` <6a23190d-dafe-956d-793e-c0100f3d405c-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-04  9:23                       ` Zhang, Jerry (Junwei)
2018-07-04 14:00               ` Michel Dänzer
2018-07-04  9:02           ` Christian König

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.