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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <172976214021.1442.3589271792962891221.tip-bot2@tip-bot2>
Date: Thu, 24 Oct 2024 09:29:00 -0000
From: "tip-bot2 for Julia Lawall" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Julia Lawall <Julia.Lawall@...ia.fr>, Thomas Gleixner <tglx@...utronix.de>,
 "Uladzislau Rezki (Sony)" <urezki@...il.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: timers/core] posix-timers: Replace call_rcu() by kfree_rcu()
 for simple kmem_cache_free() callback

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     2e529e637cef39057d9cf199a1ecb915d97ffcd9
Gitweb:        https://git.kernel.org/tip/2e529e637cef39057d9cf199a1ecb915d97ffcd9
Author:        Julia Lawall <Julia.Lawall@...ia.fr>
AuthorDate:    Sun, 13 Oct 2024 22:16:58 +02:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Thu, 24 Oct 2024 11:22:54 +02:00

posix-timers: 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 longer
necessary to use call_rcu() when the callback only performs
kmem_cache_free(). Use kfree_rcu() directly.

The changes were made using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@...ia.fr>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@...il.com>
Link: https://lore.kernel.org/all/20241013201704.49576-12-Julia.Lawall@inria.fr
---
 kernel/time/posix-timers.c |  9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 4576aae..fc40dac 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -413,18 +413,11 @@ static struct k_itimer * alloc_posix_timer(void)
 	return tmr;
 }
 
-static void k_itimer_rcu_free(struct rcu_head *head)
-{
-	struct k_itimer *tmr = container_of(head, struct k_itimer, rcu);
-
-	kmem_cache_free(posix_timers_cache, tmr);
-}
-
 static void posix_timer_free(struct k_itimer *tmr)
 {
 	put_pid(tmr->it_pid);
 	sigqueue_free(tmr->sigq);
-	call_rcu(&tmr->rcu, k_itimer_rcu_free);
+	kfree_rcu(tmr, rcu);
 }
 
 static void posix_timer_unhash_and_free(struct k_itimer *tmr)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ