[patch V2 14/17] posix-timers: Make per process list RCU safe
From: Thomas Gleixner
Date: Sun Mar 02 2025 - 14:39:18 EST
Preparatory change to remove the sighand locking from the /proc/$PID/timers
iterator.
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
kernel/time/posix-timers.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -510,7 +510,7 @@ static int do_timer_create(clockid_t whi
* unmodified signal pointer to make it valid.
*/
WRITE_ONCE(new_timer->it_signal, current->signal);
- hlist_add_head(&new_timer->list, ¤t->signal->posix_timers);
+ hlist_add_head_rcu(&new_timer->list, ¤t->signal->posix_timers);
}
/*
* After unlocking sighand::siglock @new_timer is subject to
@@ -996,7 +996,7 @@ static void posix_timer_delete(struct k_
unsigned long sig = (unsigned long)timer->it_signal | 1UL;
WRITE_ONCE(timer->it_signal, (struct signal_struct *)sig);
- hlist_del(&timer->list);
+ hlist_del_rcu(&timer->list);
posix_timer_cleanup_ignored(timer);
}