aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_resource.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2020-10-06 15:26:42 +0000
committerChristian König <[email protected]>2021-03-24 16:05:25 +0000
commita1f091f8ef2b680a5184db065527612247cb4cae (patch)
tree656a35294d816b5334ca4b4bfdca4c1a87a2aa3d /drivers/gpu/drm/ttm/ttm_resource.c
parentdrm/ttm: remove swap LRU v3 (diff)
downloadkernel-a1f091f8ef2b680a5184db065527612247cb4cae.tar.gz
kernel-a1f091f8ef2b680a5184db065527612247cb4cae.zip
drm/ttm: switch to per device LRU lock
Instead of having a global lock for potentially less contention. Signed-off-by: Christian König <[email protected]> Tested-by: Nirmoy Das <[email protected]> Reviewed-by: Huang Rui <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/424010/
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_resource.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_resource.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c
index ed1672a9f332..04f2eef653ab 100644
--- a/drivers/gpu/drm/ttm/ttm_resource.c
+++ b/drivers/gpu/drm/ttm/ttm_resource.c
@@ -91,7 +91,6 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev,
.no_wait_gpu = false,
.force_alloc = true
};
- struct ttm_global *glob = &ttm_glob;
struct dma_fence *fence;
int ret;
unsigned i;
@@ -100,18 +99,18 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev,
* Can't use standard list traversal since we're unlocking.
*/
- spin_lock(&glob->lru_lock);
+ spin_lock(&bdev->lru_lock);
for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
while (!list_empty(&man->lru[i])) {
- spin_unlock(&glob->lru_lock);
+ spin_unlock(&bdev->lru_lock);
ret = ttm_mem_evict_first(bdev, man, NULL, &ctx,
NULL);
if (ret)
return ret;
- spin_lock(&glob->lru_lock);
+ spin_lock(&bdev->lru_lock);
}
}
- spin_unlock(&glob->lru_lock);
+ spin_unlock(&bdev->lru_lock);
spin_lock(&man->move_lock);
fence = dma_fence_get(man->move);