Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

timers: Do not IPI for deferrable timers

Deferrable timers do not prevent CPU from going idle and are not taken into
account on idle path. Sending an IPI to a remote CPU when a new first
deferrable timer was enqueued will wake up the remote CPU but nothing will
be done regarding the deferrable timers.

Drop IPI completely when a new first deferrable timer was enqueued.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20231201092654.34614-7-anna-maria@linutronix.de

authored by

Anna-Maria Behnsen and committed by
Thomas Gleixner
d124c339 b573c731

+6 -9
+6 -9
kernel/time/timer.c
··· 571 571 static void 572 572 trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer) 573 573 { 574 - if (!is_timers_nohz_active()) 575 - return; 576 - 577 574 /* 578 - * TODO: This wants some optimizing similar to the code below, but we 579 - * will do that when we switch from push to pull for deferrable timers. 575 + * Deferrable timers do not prevent the CPU from entering dynticks and 576 + * are not taken into account on the idle/nohz_full path. An IPI when a 577 + * new deferrable timer is enqueued will wake up the remote CPU but 578 + * nothing will be done with the deferrable timer base. Therefore skip 579 + * the remote IPI for deferrable timers completely. 580 580 */ 581 - if (timer->flags & TIMER_DEFERRABLE) { 582 - if (tick_nohz_full_cpu(base->cpu)) 583 - wake_up_nohz_cpu(base->cpu); 581 + if (!is_timers_nohz_active() || timer->flags & TIMER_DEFERRABLE) 584 582 return; 585 - } 586 583 587 584 /* 588 585 * We might have to IPI the remote CPU if the base is idle and the