All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: fix pipelined gutting for evictions v2
@ 2020-07-24 11:56 Christian König
  2020-07-24 15:01 ` Felix Kuehling
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2020-07-24 11:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex.Sierra, Philip.Yang, Felix.Kuehling

We can't pipeline that during eviction because the memory needs
to be available immediately.

v2: fix how we cleanup the BOs resources

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 0768a054a916..469aa93ea317 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -652,8 +652,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
 	placement.num_busy_placement = 0;
 	bdev->driver->evict_flags(bo, &placement);
 
-	if (!placement.num_placement && !placement.num_busy_placement)
-		return ttm_bo_pipeline_gutting(bo);
+	if (!placement.num_placement && !placement.num_busy_placement) {
+		ttm_bo_wait(bo, false, false);
+
+		ttm_bo_cleanup_memtype_use(bo);
+		return 0;
+	}
 
 	evict_mem = bo->mem;
 	evict_mem.mm_node = NULL;
-- 
2.17.1

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

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

* Re: [PATCH] drm/ttm: fix pipelined gutting for evictions v2
  2020-07-24 11:56 [PATCH] drm/ttm: fix pipelined gutting for evictions v2 Christian König
@ 2020-07-24 15:01 ` Felix Kuehling
  2020-07-26 16:50   ` Sierra Guiza, Alejandro (Alex)
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Kuehling @ 2020-07-24 15:01 UTC (permalink / raw)
  To: Christian König, dri-devel; +Cc: Alex.Sierra, Philip.Yang

Am 2020-07-24 um 7:56 a.m. schrieb Christian König:
> We can't pipeline that during eviction because the memory needs
> to be available immediately.
>
> v2: fix how we cleanup the BOs resources
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>

It would be good to get a Tested-by from Alex as well.

Thanks,
  Felix


> ---
>  drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 0768a054a916..469aa93ea317 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -652,8 +652,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
>  	placement.num_busy_placement = 0;
>  	bdev->driver->evict_flags(bo, &placement);
>  
> -	if (!placement.num_placement && !placement.num_busy_placement)
> -		return ttm_bo_pipeline_gutting(bo);
> +	if (!placement.num_placement && !placement.num_busy_placement) {
> +		ttm_bo_wait(bo, false, false);
> +
> +		ttm_bo_cleanup_memtype_use(bo);
> +		return 0;
> +	}
>  
>  	evict_mem = bo->mem;
>  	evict_mem.mm_node = NULL;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/ttm: fix pipelined gutting for evictions v2
  2020-07-24 15:01 ` Felix Kuehling
@ 2020-07-26 16:50   ` Sierra Guiza, Alejandro (Alex)
  0 siblings, 0 replies; 3+ messages in thread
From: Sierra Guiza, Alejandro (Alex) @ 2020-07-26 16:50 UTC (permalink / raw)
  To: Felix Kuehling, Christian König, dri-devel; +Cc: Philip.Yang


On 7/24/2020 10:01 AM, Felix Kuehling wrote:
> Am 2020-07-24 um 7:56 a.m. schrieb Christian König:
>> We can't pipeline that during eviction because the memory needs
>> to be available immediately.
>>
>> v2: fix how we cleanup the BOs resources
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
>
> It would be good to get a Tested-by from Alex as well.
>
> Thanks,
>    Felix

Tested-by: Alex Sierra <alex.sierra@amd.com>

Regards,

Alex Sierra

>
>> ---
>>   drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
>> index 0768a054a916..469aa93ea317 100644
>> --- a/drivers/gpu/drm/ttm/ttm_bo.c
>> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
>> @@ -652,8 +652,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
>>   	placement.num_busy_placement = 0;
>>   	bdev->driver->evict_flags(bo, &placement);
>>   
>> -	if (!placement.num_placement && !placement.num_busy_placement)
>> -		return ttm_bo_pipeline_gutting(bo);
>> +	if (!placement.num_placement && !placement.num_busy_placement) {
>> +		ttm_bo_wait(bo, false, false);
>> +
>> +		ttm_bo_cleanup_memtype_use(bo);
>> +		return 0;
>> +	}
>>   
>>   	evict_mem = bo->mem;
>>   	evict_mem.mm_node = NULL;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2020-07-26 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 11:56 [PATCH] drm/ttm: fix pipelined gutting for evictions v2 Christian König
2020-07-24 15:01 ` Felix Kuehling
2020-07-26 16:50   ` Sierra Guiza, Alejandro (Alex)

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.