| From 863ac6f38375f6dfbd52c37d551350892b3b477c Mon Sep 17 00:00:00 2001 |
| From: xinhui pan <xinhui.pan@amd.com> |
| Date: Wed, 15 Jan 2020 14:07:45 +0800 |
| Subject: [PATCH] drm/ttm: flush the fence on the bo after we individualize the |
| reservation object |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| commit 1bbcf69e42fe7fd49b6f4339c970729d0e343753 upstream. |
| |
| As we move the ttm_bo_individualize_resv() upwards, we need flush the |
| copied fence too. Otherwise the driver keeps waiting for fence. |
| |
| run&Kill kfdtest, then perf top. |
| |
| 25.53% [ttm] [k] ttm_bo_delayed_delete |
| 24.29% [kernel] [k] dma_resv_test_signaled_rcu |
| 19.72% [kernel] [k] ww_mutex_lock |
| |
| Fix: 378e2d5b("drm/ttm: fix ttm_bo_cleanup_refs_or_queue once more") |
| Signed-off-by: xinhui pan <xinhui.pan@amd.com> |
| Reviewed-by: Christian König <christian.koenig@amd.com> |
| Link: https://patchwork.freedesktop.org/series/72339/ |
| Signed-off-by: Christian König <christian.koenig@amd.com> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c |
| index 2845fceb2fbd..720cc129369e 100644 |
| --- a/drivers/gpu/drm/ttm/ttm_bo.c |
| +++ b/drivers/gpu/drm/ttm/ttm_bo.c |
| @@ -508,8 +508,10 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) |
| |
| reservation_object_unlock(bo->resv); |
| } |
| - if (bo->resv != &bo->ttm_resv) |
| + if (bo->resv != &bo->ttm_resv) { |
| + ttm_bo_flush_all_fences(bo); |
| reservation_object_unlock(&bo->ttm_resv); |
| + } |
| |
| error: |
| kref_get(&bo->list_kref); |
| -- |
| 2.7.4 |
| |