diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2025-03-08 17:48:43 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2025-03-13 12:07:18 +0100 |
commit | 451898ea422b5861d95089d8d9c2a0ab8383775e (patch) | |
tree | bdbcccef7de218397c37b81022f151b82df1f772 | |
parent | 5fa75a432f1a6b1402edd8802ecc14f8bbb90e49 (diff) | |
download | linux-451898ea422b5861d95089d8d9c2a0ab8383775e.tar.gz linux-451898ea422b5861d95089d8d9c2a0ab8383775e.tar.bz2 linux-451898ea422b5861d95089d8d9c2a0ab8383775e.zip |
posix-timers: Make per process list RCU safe
Preparatory change to remove the sighand locking from the /proc/$PID/timers
iterator.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/all/20250308155624.403223080@linutronix.de
-rw-r--r-- | kernel/time/posix-timers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index e4c92f42fa57..b917a162d84a 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -518,7 +518,7 @@ static int do_timer_create(clockid_t which_clock, struct sigevent *event, * Store the 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 @new_timer is subject to concurrent removal and @@ -1004,7 +1004,7 @@ static void posix_timer_delete(struct k_itimer *timer) 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); } |