* [PATCH] time: replace call_rcu by kfree_rcu for simple kmem_cache_free callback
@ 2024-10-30 3:15 Hongling Zeng
2024-10-30 9:13 ` Thomas Gleixner
0 siblings, 1 reply; 2+ messages in thread
From: Hongling Zeng @ 2024-10-30 3:15 UTC (permalink / raw)
To: linux-kernel; +Cc: anna-maria, frederic, tglx, zhongling0719, Hongling Zeng
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@kylinos.cn>
---
kernel/time/posix-timers.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 4576aae..6a74a6b 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -413,18 +413,12 @@ 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)
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] time: replace call_rcu by kfree_rcu for simple kmem_cache_free callback
2024-10-30 3:15 [PATCH] time: replace call_rcu by kfree_rcu for simple kmem_cache_free callback Hongling Zeng
@ 2024-10-30 9:13 ` Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2024-10-30 9:13 UTC (permalink / raw)
To: Hongling Zeng, linux-kernel
Cc: anna-maria, frederic, zhongling0719, Hongling Zeng
On Wed, Oct 30 2024 at 11:15, Hongling Zeng wrote:
Thanks for your patch. Some nitpicks:
Please read and follow:
https://www.kernel.org/doc/html/latest/process/maintainer-tip.html
especially the section 'Patch submission notes'
Thanks,
tglx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-30 9:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30 3:15 [PATCH] time: replace call_rcu by kfree_rcu for simple kmem_cache_free callback Hongling Zeng
2024-10-30 9:13 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox