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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user