Merge tag 'timers-urgent-2024-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fix from Thomas Gleixner:
"A single fix for posix CPU timers.

When a thread is cloned, the posix CPU timers are not inherited.

If the parent has a CPU timer armed the corresponding tick dependency
in the tasks tick_dep_mask is set and copied to the new thread, which
means the new thread and all decendants will prevent the system to go
into full NOHZ operation.

Clear the tick dependency mask in copy_process() to fix this"

* tag 'timers-urgent-2024-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
posix-cpu-timers: Clear TICK_DEP_BIT_POSIX_TIMER on clone

+10
+8
include/linux/tick.h
··· 251 251 if (tick_nohz_full_enabled()) 252 252 tick_nohz_dep_set_task(tsk, bit); 253 253 } 254 + 254 255 static inline void tick_dep_clear_task(struct task_struct *tsk, 255 256 enum tick_dep_bits bit) 256 257 { 257 258 if (tick_nohz_full_enabled()) 258 259 tick_nohz_dep_clear_task(tsk, bit); 259 260 } 261 + 262 + static inline void tick_dep_init_task(struct task_struct *tsk) 263 + { 264 + atomic_set(&tsk->tick_dep_mask, 0); 265 + } 266 + 260 267 static inline void tick_dep_set_signal(struct task_struct *tsk, 261 268 enum tick_dep_bits bit) 262 269 { ··· 297 290 enum tick_dep_bits bit) { } 298 291 static inline void tick_dep_clear_task(struct task_struct *tsk, 299 292 enum tick_dep_bits bit) { } 293 + static inline void tick_dep_init_task(struct task_struct *tsk) { } 300 294 static inline void tick_dep_set_signal(struct task_struct *tsk, 301 295 enum tick_dep_bits bit) { } 302 296 static inline void tick_dep_clear_signal(struct signal_struct *signal,
+2
kernel/fork.c
··· 105 105 #include <linux/rseq.h> 106 106 #include <uapi/linux/pidfd.h> 107 107 #include <linux/pidfs.h> 108 + #include <linux/tick.h> 108 109 109 110 #include <asm/pgalloc.h> 110 111 #include <linux/uaccess.h> ··· 2293 2292 acct_clear_integrals(p); 2294 2293 2295 2294 posix_cputimers_init(&p->posix_cputimers); 2295 + tick_dep_init_task(p); 2296 2296 2297 2297 p->io_context = NULL; 2298 2298 audit_set_context(p, NULL);