[PATCH 1/4] drm/amdgpu: Optimization of critical section

Alex Xie AlexBin.Xie at amd.com
Mon Jun 12 20:31:22 UTC 2017


This patch is to move a loop of unref BOs and
several memory free function calls out of
critical sections.

Signed-off-by: Alex Xie <AlexBin.Xie at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
index a664987..02c138f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
@@ -75,9 +75,12 @@ static void amdgpu_bo_list_destroy(struct amdgpu_fpriv *fpriv, int id)
 		/* Another user may have a reference to this list still */
 		mutex_lock(&list->lock);
 		mutex_unlock(&list->lock);
+		mutex_unlock(&fpriv->bo_list_lock);
 		amdgpu_bo_list_free(list);
 	}
-	mutex_unlock(&fpriv->bo_list_lock);
+	else {
+		mutex_unlock(&fpriv->bo_list_lock);
+	}
 }
 
 static int amdgpu_bo_list_set(struct amdgpu_device *adev,
-- 
2.7.4



More information about the amd-gfx mailing list