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