lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241025035110.10854-1-zenghongling@kylinos.cn>
Date: Fri, 25 Oct 2024 11:51:10 +0800
From: Hongling Zeng <zenghongling@...inos.cn>
To: linux-kernel@...r.kernel.org,
	dri-devel@...ts.freedesktop.org,
	amd-gfx@...ts.freedesktop.org
Cc: alexander.deucher@....com,
	christian.koenig@....com,
	Xinhui.Pan@....com,
	airlied@...il.com,
	simona@...ll.ch,
	zhongling0719@....com,
	Hongling Zeng <zenghongling@...inos.cn>
Subject: [PATCH] amdgpu/fence: replace call_rcu by kfree_rcu for simple kmem_cache_free callback

Since SLOB was removed and since
commit 6c6c47b063b5 ("mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()"),
it is not necessary to use call_rcu when the callback only performs
kmem_cache_free. Use kfree_rcu() directly.

Signed-off-by: Hongling Zeng <zenghongling@...inos.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index 2f24a6a..d047afe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -818,20 +818,6 @@ static bool amdgpu_job_fence_enable_signaling(struct dma_fence *f)
 	return true;
 }
 
-/**
- * amdgpu_fence_free - free up the fence memory
- *
- * @rcu: RCU callback head
- *
- * Free up the fence memory after the RCU grace period.
- */
-static void amdgpu_fence_free(struct rcu_head *rcu)
-{
-	struct dma_fence *f = container_of(rcu, struct dma_fence, rcu);
-
-	/* free fence_slab if it's separated fence*/
-	kmem_cache_free(amdgpu_fence_slab, to_amdgpu_fence(f));
-}
 
 /**
  * amdgpu_job_fence_free - free up the job with embedded fence
@@ -858,7 +844,7 @@ static void amdgpu_job_fence_free(struct rcu_head *rcu)
  */
 static void amdgpu_fence_release(struct dma_fence *f)
 {
-	call_rcu(&f->rcu, amdgpu_fence_free);
+	kfree_rcu(f, rcu);
 }
 
 /**
-- 
2.1.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ