Re: [PATCH 02/11] drm/amdgpu: validate the VM root PD from the VM code

2018-08-23 Thread Christian König

Am 23.08.2018 um 09:28 schrieb Huang Rui:

On Wed, Aug 22, 2018 at 05:05:08PM +0200, Christian König wrote:

Preparation for following changes. This validates the root PD twice,
but the overhead of that should be minimal.

Signed-off-by: Christian König 
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 73b8dcaf66e6..53ce9982a5ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -291,11 +291,11 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, 
struct amdgpu_vm *vm,
list_for_each_entry_safe(bo_base, tmp, >evicted, vm_status) {
struct amdgpu_bo *bo = bo_base->bo;
  
-		if (bo->parent) {

-   r = validate(param, bo);
-   if (r)
-   break;
+   r = validate(param, bo);
+   if (r)
+   break;

In orignal case, we skip the root PD. But now, it is validated one time.
May I know where is another time?


That is in the CS code, we add the root PD to the list of BOs which are 
validated there.


Christian.



Thanks,
Ray

  
+		if (bo->parent) {

spin_lock(>lru_lock);
ttm_bo_move_to_lru_tail(>tbo);
if (bo->shadow)
--
2.17.1

___
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


Re: [PATCH 02/11] drm/amdgpu: validate the VM root PD from the VM code

2018-08-23 Thread Huang Rui
On Wed, Aug 22, 2018 at 05:05:08PM +0200, Christian König wrote:
> Preparation for following changes. This validates the root PD twice,
> but the overhead of that should be minimal.
> 
> Signed-off-by: Christian König 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 73b8dcaf66e6..53ce9982a5ee 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -291,11 +291,11 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device 
> *adev, struct amdgpu_vm *vm,
>   list_for_each_entry_safe(bo_base, tmp, >evicted, vm_status) {
>   struct amdgpu_bo *bo = bo_base->bo;
>  
> - if (bo->parent) {
> - r = validate(param, bo);
> - if (r)
> - break;
> + r = validate(param, bo);
> + if (r)
> + break;

In orignal case, we skip the root PD. But now, it is validated one time.
May I know where is another time?

Thanks,
Ray

>  
> + if (bo->parent) {
>   spin_lock(>lru_lock);
>   ttm_bo_move_to_lru_tail(>tbo);
>   if (bo->shadow)
> -- 
> 2.17.1
> 
> ___
> 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


Re: [PATCH 02/11] drm/amdgpu: validate the VM root PD from the VM code

2018-08-22 Thread Zhang, Jerry (Junwei)

Patch 2 ~ 6 are

Reviewed-by: Junwei Zhang 

Jerry

On 08/22/2018 11:05 PM, Christian König wrote:

Preparation for following changes. This validates the root PD twice,
but the overhead of that should be minimal.

Signed-off-by: Christian König 
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 73b8dcaf66e6..53ce9982a5ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -291,11 +291,11 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, 
struct amdgpu_vm *vm,
list_for_each_entry_safe(bo_base, tmp, >evicted, vm_status) {
struct amdgpu_bo *bo = bo_base->bo;

-   if (bo->parent) {
-   r = validate(param, bo);
-   if (r)
-   break;
+   r = validate(param, bo);
+   if (r)
+   break;

+   if (bo->parent) {
spin_lock(>lru_lock);
ttm_bo_move_to_lru_tail(>tbo);
if (bo->shadow)


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


[PATCH 02/11] drm/amdgpu: validate the VM root PD from the VM code

2018-08-22 Thread Christian König
Preparation for following changes. This validates the root PD twice,
but the overhead of that should be minimal.

Signed-off-by: Christian König 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 73b8dcaf66e6..53ce9982a5ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -291,11 +291,11 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, 
struct amdgpu_vm *vm,
list_for_each_entry_safe(bo_base, tmp, >evicted, vm_status) {
struct amdgpu_bo *bo = bo_base->bo;
 
-   if (bo->parent) {
-   r = validate(param, bo);
-   if (r)
-   break;
+   r = validate(param, bo);
+   if (r)
+   break;
 
+   if (bo->parent) {
spin_lock(>lru_lock);
ttm_bo_move_to_lru_tail(>tbo);
if (bo->shadow)
-- 
2.17.1

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