All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ttm: wait mem space if user allow while gpu busy
@ 2019-04-22 10:38 Chunming Zhou
  2019-04-23  1:45 ` Liang, Prike
  0 siblings, 1 reply; 17+ messages in thread
From: Chunming Zhou @ 2019-04-22 10:38 UTC (permalink / raw)
  To: dri-devel; +Cc: prike.liang

heavy gpu job could occupy memory long time, which could lead to other
user fail to get memory.

Change-Id: I0b322d98cd76e5ac32b00462bbae8008d76c5e11
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 7c484729f9b2..6c596cc24bec 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -830,8 +830,10 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
 		if (mem->mm_node)
 			break;
 		ret = ttm_mem_evict_first(bdev, mem_type, place, ctx);
-		if (unlikely(ret != 0))
-			return ret;
+		if (unlikely(ret != 0)) {
+			if (!ctx || ctx->no_wait_gpu || ret != -EBUSY)
+				return ret;
+		}
 	} while (1);
 	mem->mem_type = mem_type;
 	return ttm_bo_add_move_fence(bo, man, mem);
-- 
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] 17+ messages in thread

end of thread, other threads:[~2019-04-24 10:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-22 10:38 [PATCH] ttm: wait mem space if user allow while gpu busy Chunming Zhou
2019-04-23  1:45 ` Liang, Prike
2019-04-23 13:05   ` Christian König
2019-04-23 13:19     ` Zhou, David(ChunMing)
2019-04-23 14:42       ` [PATCH] " Christian König
2019-04-23 15:09         ` Zhou, David(ChunMing)
2019-04-24  7:12           ` [PATCH] " Christian König
2019-04-24  7:17             ` zhoucm1
2019-04-24  7:30               ` Christian König
2019-04-24  7:59                 ` zhoucm1
2019-04-24  8:07                   ` Christian König
2019-04-24  8:11                     ` zhoucm1
2019-04-24  8:59                       ` Koenig, Christian
2019-04-24  9:03                         ` zhoucm1
2019-04-24 10:03                           ` Christian König
2019-04-24  8:01         ` Daniel Vetter
2019-04-24  8:06           ` Koenig, Christian

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.