Skip to content

Commit 451898e

Browse files
committed
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 <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 5fa75a4 commit 451898e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/time/posix-timers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ static int do_timer_create(clockid_t which_clock, struct sigevent *event,
518518
* Store the unmodified signal pointer to make it valid.
519519
*/
520520
WRITE_ONCE(new_timer->it_signal, current->signal);
521-
hlist_add_head(&new_timer->list, &current->signal->posix_timers);
521+
hlist_add_head_rcu(&new_timer->list, &current->signal->posix_timers);
522522
}
523523
/*
524524
* After unlocking @new_timer is subject to concurrent removal and
@@ -1004,7 +1004,7 @@ static void posix_timer_delete(struct k_itimer *timer)
10041004
unsigned long sig = (unsigned long)timer->it_signal | 1UL;
10051005

10061006
WRITE_ONCE(timer->it_signal, (struct signal_struct *)sig);
1007-
hlist_del(&timer->list);
1007+
hlist_del_rcu(&timer->list);
10081008
posix_timer_cleanup_ignored(timer);
10091009
}
10101010

0 commit comments

Comments
 (0)