Re: [PATCH 2/3] drm/ttm: always keep BOs on the LRU

2019-10-21 Thread VMware

On 10/18/19 3:49 PM, Thomas Hellström (VMware) wrote:

Hi, Christian,


On 10/16/19 11:30 AM, Christian König wrote:

Am 25.09.19 um 14:10 schrieb Christian König:

Am 25.09.19 um 14:06 schrieb Thomas Hellström (VMware):

On 9/25/19 12:55 PM, Christian König wrote:

This allows blocking for BOs to become available
in the memory management.

Amdgpu is doing this for quite a while now during CS. Now
apply the new behavior to all drivers using TTM.

Signed-off-by: Christian König 


Got to test this to see that there are no regressions.


Did you got time to test this or did I just missed your response?

Thanks in advance,
Christian.


Sorry for the delay. A  lot on my plate currently. I'll get around to 
this later today or on monday.


Thanks,

Thomas



Hi, Christian!

This patch is

Acked-by: Thomas Hellstrom 

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 2/3] drm/ttm: always keep BOs on the LRU

2019-10-18 Thread VMware

Hi, Christian,


On 10/16/19 11:30 AM, Christian König wrote:

Am 25.09.19 um 14:10 schrieb Christian König:

Am 25.09.19 um 14:06 schrieb Thomas Hellström (VMware):

On 9/25/19 12:55 PM, Christian König wrote:

This allows blocking for BOs to become available
in the memory management.

Amdgpu is doing this for quite a while now during CS. Now
apply the new behavior to all drivers using TTM.

Signed-off-by: Christian König 


Got to test this to see that there are no regressions.


Did you got time to test this or did I just missed your response?

Thanks in advance,
Christian.


Sorry for the delay. A  lot on my plate currently. I'll get around to 
this later today or on monday.


Thanks,

Thomas


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 2/3] drm/ttm: always keep BOs on the LRU

2019-10-16 Thread Christian König

Am 25.09.19 um 14:10 schrieb Christian König:

Am 25.09.19 um 14:06 schrieb Thomas Hellström (VMware):

On 9/25/19 12:55 PM, Christian König wrote:

This allows blocking for BOs to become available
in the memory management.

Amdgpu is doing this for quite a while now during CS. Now
apply the new behavior to all drivers using TTM.

Signed-off-by: Christian König 


Got to test this to see that there are no regressions.


Did you got time to test this or did I just missed your response?

Thanks in advance,
Christian.



There are some ugly cases in the vmwgfx driver (coded before we could 
create bos in the reserved state) that relies on creating a bo as 
NO_EVICT to make sure a following tryreserve will always succeed. So 
how are NO_EVICT bos handled after the below changes? Taken off the 
lru or just avoided when walking the lru?


They are never added to the LRU in the first place, the NO_EVICT flag 
is still checked during BO init.




Also, does this mean we can in theory start using the drm_mm_scan() 
interface for VRAM evictions, relying on the ww_mutexes to resolve 
contention?


It's the first step towards this, we still need some rather funky 
ww_mutex dance to completely get this working.


Christian.



/Thomas



---
  .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  9 ++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c    |  2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c   |  2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c   |  4 +-
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
  drivers/gpu/drm/qxl/qxl_release.c |  4 +-
  drivers/gpu/drm/radeon/radeon_gem.c   |  2 +-
  drivers/gpu/drm/radeon/radeon_object.c    |  2 +-
  drivers/gpu/drm/ttm/ttm_bo.c  | 48 
+--

  drivers/gpu/drm/ttm/ttm_execbuf_util.c    | 25 ++
  drivers/gpu/drm/vmwgfx/vmwgfx_resource.c  |  3 +-
  drivers/gpu/drm/vmwgfx/vmwgfx_validation.h    |  2 +-
  include/drm/ttm/ttm_bo_api.h  | 24 --
  include/drm/ttm/ttm_bo_driver.h   | 20 ++--
  include/drm/ttm/ttm_execbuf_util.h    |  2 +-
  15 files changed, 33 insertions(+), 118 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

index b9bb35d1699e..ad01c741caaf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -586,7 +586,7 @@ static int reserve_bo_and_vm(struct kgd_mem *mem,
  amdgpu_vm_get_pd_bo(vm, &ctx->list, &ctx->vm_pd[0]);
    ret = ttm_eu_reserve_buffers(&ctx->ticket, &ctx->list,
- false, &ctx->duplicates, true);
+ false, &ctx->duplicates);
  if (!ret)
  ctx->reserved = true;
  else {
@@ -659,7 +659,7 @@ static int reserve_bo_and_cond_vms(struct 
kgd_mem *mem,

  }
    ret = ttm_eu_reserve_buffers(&ctx->ticket, &ctx->list,
- false, &ctx->duplicates, true);
+ false, &ctx->duplicates);
  if (!ret)
  ctx->reserved = true;
  else
@@ -1796,8 +1796,7 @@ static int validate_invalid_user_pages(struct 
amdkfd_process_info *process_info)

  }
    /* Reserve all BOs and page tables for validation */
-    ret = ttm_eu_reserve_buffers(&ticket, &resv_list, false, 
&duplicates,

- true);
+    ret = ttm_eu_reserve_buffers(&ticket, &resv_list, false, 
&duplicates);

  WARN(!list_empty(&duplicates), "Duplicates should be empty");
  if (ret)
  goto out_free;
@@ -1995,7 +1994,7 @@ int 
amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence 
**ef)

  }
    ret = ttm_eu_reserve_buffers(&ctx.ticket, &ctx.list,
- false, &duplicate_save, true);
+ false, &duplicate_save);
  if (ret) {
  pr_debug("Memory eviction: TTM Reserve Failed. Try again\n");
  goto ttm_reserve_fail;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

index 95ec965fcc2d..82f239ac4050 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -650,7 +650,7 @@ static int amdgpu_cs_parser_bos(struct 
amdgpu_cs_parser *p,

  }
    r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true,
-   &duplicates, false);
+   &duplicates);
  if (unlikely(r != 0)) {
  if (r != -ERESTARTSYS)
  DRM_ERROR("ttm_eu_reserve_buffers failed.\n");
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c

index 605f83046039..b1608d47508f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
@@ -80,7 +80,7 @@ int amdgpu_map_static_csa(struct amdgpu_device 
*adev, struct amdgpu_vm *vm,

  list_add(&csa_tv.head, &list);
  amdgpu_vm_get_pd_bo(vm, &list, &pd);
  -    r = ttm_eu_reserve_buffer

Re: [PATCH 2/3] drm/ttm: always keep BOs on the LRU

2019-09-25 Thread Christian König

Am 25.09.19 um 14:06 schrieb Thomas Hellström (VMware):

On 9/25/19 12:55 PM, Christian König wrote:

This allows blocking for BOs to become available
in the memory management.

Amdgpu is doing this for quite a while now during CS. Now
apply the new behavior to all drivers using TTM.

Signed-off-by: Christian König 


Got to test this to see that there are no regressions.

There are some ugly cases in the vmwgfx driver (coded before we could 
create bos in the reserved state) that relies on creating a bo as 
NO_EVICT to make sure a following tryreserve will always succeed. So 
how are NO_EVICT bos handled after the below changes? Taken off the 
lru or just avoided when walking the lru?


They are never added to the LRU in the first place, the NO_EVICT flag is 
still checked during BO init.




Also, does this mean we can in theory start using the drm_mm_scan() 
interface for VRAM evictions, relying on the ww_mutexes to resolve 
contention?


It's the first step towards this, we still need some rather funky 
ww_mutex dance to completely get this working.


Christian.



/Thomas



---
  .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  9 ++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c    |  2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c   |  2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c   |  4 +-
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
  drivers/gpu/drm/qxl/qxl_release.c |  4 +-
  drivers/gpu/drm/radeon/radeon_gem.c   |  2 +-
  drivers/gpu/drm/radeon/radeon_object.c    |  2 +-
  drivers/gpu/drm/ttm/ttm_bo.c  | 48 +--
  drivers/gpu/drm/ttm/ttm_execbuf_util.c    | 25 ++
  drivers/gpu/drm/vmwgfx/vmwgfx_resource.c  |  3 +-
  drivers/gpu/drm/vmwgfx/vmwgfx_validation.h    |  2 +-
  include/drm/ttm/ttm_bo_api.h  | 24 --
  include/drm/ttm/ttm_bo_driver.h   | 20 ++--
  include/drm/ttm/ttm_execbuf_util.h    |  2 +-
  15 files changed, 33 insertions(+), 118 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

index b9bb35d1699e..ad01c741caaf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -586,7 +586,7 @@ static int reserve_bo_and_vm(struct kgd_mem *mem,
  amdgpu_vm_get_pd_bo(vm, &ctx->list, &ctx->vm_pd[0]);
    ret = ttm_eu_reserve_buffers(&ctx->ticket, &ctx->list,
- false, &ctx->duplicates, true);
+ false, &ctx->duplicates);
  if (!ret)
  ctx->reserved = true;
  else {
@@ -659,7 +659,7 @@ static int reserve_bo_and_cond_vms(struct kgd_mem 
*mem,

  }
    ret = ttm_eu_reserve_buffers(&ctx->ticket, &ctx->list,
- false, &ctx->duplicates, true);
+ false, &ctx->duplicates);
  if (!ret)
  ctx->reserved = true;
  else
@@ -1796,8 +1796,7 @@ static int validate_invalid_user_pages(struct 
amdkfd_process_info *process_info)

  }
    /* Reserve all BOs and page tables for validation */
-    ret = ttm_eu_reserve_buffers(&ticket, &resv_list, false, 
&duplicates,

- true);
+    ret = ttm_eu_reserve_buffers(&ticket, &resv_list, false, 
&duplicates);

  WARN(!list_empty(&duplicates), "Duplicates should be empty");
  if (ret)
  goto out_free;
@@ -1995,7 +1994,7 @@ int 
amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence 
**ef)

  }
    ret = ttm_eu_reserve_buffers(&ctx.ticket, &ctx.list,
- false, &duplicate_save, true);
+ false, &duplicate_save);
  if (ret) {
  pr_debug("Memory eviction: TTM Reserve Failed. Try again\n");
  goto ttm_reserve_fail;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

index 95ec965fcc2d..82f239ac4050 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -650,7 +650,7 @@ static int amdgpu_cs_parser_bos(struct 
amdgpu_cs_parser *p,

  }
    r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true,
-   &duplicates, false);
+   &duplicates);
  if (unlikely(r != 0)) {
  if (r != -ERESTARTSYS)
  DRM_ERROR("ttm_eu_reserve_buffers failed.\n");
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c

index 605f83046039..b1608d47508f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
@@ -80,7 +80,7 @@ int amdgpu_map_static_csa(struct amdgpu_device 
*adev, struct amdgpu_vm *vm,

  list_add(&csa_tv.head, &list);
  amdgpu_vm_get_pd_bo(vm, &list, &pd);
  -    r = ttm_eu_reserve_buffers(&ticket, &list, true, NULL, false);
+    r = ttm_eu_reserve_buffers(&ticket, &list, true, NULL);
  if (r) {
  DRM_ERROR("failed to reser

Re: [PATCH 2/3] drm/ttm: always keep BOs on the LRU

2019-09-25 Thread VMware

On 9/25/19 12:55 PM, Christian König wrote:

This allows blocking for BOs to become available
in the memory management.

Amdgpu is doing this for quite a while now during CS. Now
apply the new behavior to all drivers using TTM.

Signed-off-by: Christian König 


Got to test this to see that there are no regressions.

There are some ugly cases in the vmwgfx driver (coded before we could 
create bos in the reserved state) that relies on creating a bo as 
NO_EVICT to make sure a following tryreserve will always succeed. So how 
are NO_EVICT bos handled after the below changes? Taken off the lru or 
just avoided when walking the lru?


Also, does this mean we can in theory start using the drm_mm_scan() 
interface for VRAM evictions, relying on the ww_mutexes to resolve 
contention?


/Thomas



---
  .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  9 ++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c|  2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c   |  2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c   |  4 +-
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
  drivers/gpu/drm/qxl/qxl_release.c |  4 +-
  drivers/gpu/drm/radeon/radeon_gem.c   |  2 +-
  drivers/gpu/drm/radeon/radeon_object.c|  2 +-
  drivers/gpu/drm/ttm/ttm_bo.c  | 48 +--
  drivers/gpu/drm/ttm/ttm_execbuf_util.c| 25 ++
  drivers/gpu/drm/vmwgfx/vmwgfx_resource.c  |  3 +-
  drivers/gpu/drm/vmwgfx/vmwgfx_validation.h|  2 +-
  include/drm/ttm/ttm_bo_api.h  | 24 --
  include/drm/ttm/ttm_bo_driver.h   | 20 ++--
  include/drm/ttm/ttm_execbuf_util.h|  2 +-
  15 files changed, 33 insertions(+), 118 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index b9bb35d1699e..ad01c741caaf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -586,7 +586,7 @@ static int reserve_bo_and_vm(struct kgd_mem *mem,
amdgpu_vm_get_pd_bo(vm, &ctx->list, &ctx->vm_pd[0]);
  
  	ret = ttm_eu_reserve_buffers(&ctx->ticket, &ctx->list,

-false, &ctx->duplicates, true);
+false, &ctx->duplicates);
if (!ret)
ctx->reserved = true;
else {
@@ -659,7 +659,7 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem,
}
  
  	ret = ttm_eu_reserve_buffers(&ctx->ticket, &ctx->list,

-false, &ctx->duplicates, true);
+false, &ctx->duplicates);
if (!ret)
ctx->reserved = true;
else
@@ -1796,8 +1796,7 @@ static int validate_invalid_user_pages(struct 
amdkfd_process_info *process_info)
}
  
  	/* Reserve all BOs and page tables for validation */

-   ret = ttm_eu_reserve_buffers(&ticket, &resv_list, false, &duplicates,
-true);
+   ret = ttm_eu_reserve_buffers(&ticket, &resv_list, false, &duplicates);
WARN(!list_empty(&duplicates), "Duplicates should be empty");
if (ret)
goto out_free;
@@ -1995,7 +1994,7 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, 
struct dma_fence **ef)
}
  
  	ret = ttm_eu_reserve_buffers(&ctx.ticket, &ctx.list,

-false, &duplicate_save, true);
+false, &duplicate_save);
if (ret) {
pr_debug("Memory eviction: TTM Reserve Failed. Try again\n");
goto ttm_reserve_fail;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 95ec965fcc2d..82f239ac4050 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -650,7 +650,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
}
  
  	r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true,

-  &duplicates, false);
+  &duplicates);
if (unlikely(r != 0)) {
if (r != -ERESTARTSYS)
DRM_ERROR("ttm_eu_reserve_buffers failed.\n");
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
index 605f83046039..b1608d47508f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
@@ -80,7 +80,7 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct 
amdgpu_vm *vm,
list_add(&csa_tv.head, &list);
amdgpu_vm_get_pd_bo(vm, &list, &pd);
  
-	r = ttm_eu_reserve_buffers(&ticket, &list, true, NULL, false);

+   r = ttm_eu_reserve_buffers(&ticket, &list, true, NULL);
if (r) {
DRM_ERROR("failed to reserve CSA,PD BOs: err=%d\n", r);
return r;
diff --git a/drivers/gpu/drm/amd

[PATCH 2/3] drm/ttm: always keep BOs on the LRU

2019-09-25 Thread Christian König
This allows blocking for BOs to become available
in the memory management.

Amdgpu is doing this for quite a while now during CS. Now
apply the new behavior to all drivers using TTM.

Signed-off-by: Christian König 
---
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  9 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c|  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c   |  4 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
 drivers/gpu/drm/qxl/qxl_release.c |  4 +-
 drivers/gpu/drm/radeon/radeon_gem.c   |  2 +-
 drivers/gpu/drm/radeon/radeon_object.c|  2 +-
 drivers/gpu/drm/ttm/ttm_bo.c  | 48 +--
 drivers/gpu/drm/ttm/ttm_execbuf_util.c| 25 ++
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c  |  3 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_validation.h|  2 +-
 include/drm/ttm/ttm_bo_api.h  | 24 --
 include/drm/ttm/ttm_bo_driver.h   | 20 ++--
 include/drm/ttm/ttm_execbuf_util.h|  2 +-
 15 files changed, 33 insertions(+), 118 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index b9bb35d1699e..ad01c741caaf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -586,7 +586,7 @@ static int reserve_bo_and_vm(struct kgd_mem *mem,
amdgpu_vm_get_pd_bo(vm, &ctx->list, &ctx->vm_pd[0]);
 
ret = ttm_eu_reserve_buffers(&ctx->ticket, &ctx->list,
-false, &ctx->duplicates, true);
+false, &ctx->duplicates);
if (!ret)
ctx->reserved = true;
else {
@@ -659,7 +659,7 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem,
}
 
ret = ttm_eu_reserve_buffers(&ctx->ticket, &ctx->list,
-false, &ctx->duplicates, true);
+false, &ctx->duplicates);
if (!ret)
ctx->reserved = true;
else
@@ -1796,8 +1796,7 @@ static int validate_invalid_user_pages(struct 
amdkfd_process_info *process_info)
}
 
/* Reserve all BOs and page tables for validation */
-   ret = ttm_eu_reserve_buffers(&ticket, &resv_list, false, &duplicates,
-true);
+   ret = ttm_eu_reserve_buffers(&ticket, &resv_list, false, &duplicates);
WARN(!list_empty(&duplicates), "Duplicates should be empty");
if (ret)
goto out_free;
@@ -1995,7 +1994,7 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, 
struct dma_fence **ef)
}
 
ret = ttm_eu_reserve_buffers(&ctx.ticket, &ctx.list,
-false, &duplicate_save, true);
+false, &duplicate_save);
if (ret) {
pr_debug("Memory eviction: TTM Reserve Failed. Try again\n");
goto ttm_reserve_fail;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 95ec965fcc2d..82f239ac4050 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -650,7 +650,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
}
 
r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true,
-  &duplicates, false);
+  &duplicates);
if (unlikely(r != 0)) {
if (r != -ERESTARTSYS)
DRM_ERROR("ttm_eu_reserve_buffers failed.\n");
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
index 605f83046039..b1608d47508f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
@@ -80,7 +80,7 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct 
amdgpu_vm *vm,
list_add(&csa_tv.head, &list);
amdgpu_vm_get_pd_bo(vm, &list, &pd);
 
-   r = ttm_eu_reserve_buffers(&ticket, &list, true, NULL, false);
+   r = ttm_eu_reserve_buffers(&ticket, &list, true, NULL);
if (r) {
DRM_ERROR("failed to reserve CSA,PD BOs: err=%d\n", r);
return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index b25a59c4bec6..cbfb3e84f352 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -175,7 +175,7 @@ void amdgpu_gem_object_close(struct drm_gem_object *obj,
 
amdgpu_vm_get_pd_bo(vm, &list, &vm_pd);
 
-   r = ttm_eu_reserve_buffers(&ticket, &list, false, &duplicates, false);
+   r = ttm_eu_reserve_buffers(&ticket, &list, false, &duplicates);
if (r) {
dev_err(adev->dev, "leaking bo va because "
"we fai