dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/ttm: fix adding foreign BOs to the LRU during init v2
@ 2016-01-11 14:35 Christian König
  2016-01-11 14:35 ` [PATCH 2/5] drm/ttm: fix adding foreign BOs to the swap LRU Christian König
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Christian König @ 2016-01-11 14:35 UTC (permalink / raw)
  To: alexdeucher; +Cc: dri-devel

From: Christian König <christian.koenig@amd.com>

If we import a BO with an external reservation object we don't
reserve/unreserve it. So we never add it to the LRU causing a possible
deny of service.

v2: fix typo in commit message

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

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 745e996..a98a5d5 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1170,9 +1170,15 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
 	if (likely(!ret))
 		ret = ttm_bo_validate(bo, placement, interruptible, false);
 
-	if (!resv)
+	if (!resv) {
 		ttm_bo_unreserve(bo);
 
+	} else if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
+		spin_lock(&bo->glob->lru_lock);
+		ttm_bo_add_to_lru(bo);
+		spin_unlock(&bo->glob->lru_lock);
+	}
+
 	if (unlikely(ret))
 		ttm_bo_unref(&bo);
 
-- 
2.5.0

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

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

end of thread, other threads:[~2016-01-13 17:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-11 14:35 [PATCH 1/5] drm/ttm: fix adding foreign BOs to the LRU during init v2 Christian König
2016-01-11 14:35 ` [PATCH 2/5] drm/ttm: fix adding foreign BOs to the swap LRU Christian König
2016-01-11 15:14   ` Thomas Hellstrom
2016-01-11 14:35 ` [PATCH 3/5] drm/ttm: add ttm_bo_move_to_lru_tail function v2 Christian König
2016-01-11 15:29   ` Thomas Hellstrom
2016-01-11 14:35 ` [PATCH 4/5] drm/amdgpu: move VM page tables to the LRU end on CS v2 Christian König
2016-01-11 14:35 ` [PATCH 5/5] drm/amdgpu: validate duplicates first Christian König
2016-01-13 17:23   ` Alex Deucher
2016-01-11 15:06 ` [PATCH 1/5] drm/ttm: fix adding foreign BOs to the LRU during init v2 Thomas Hellstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox