Skip to content

Commit d117d7f

Browse files
committed
timers: Do not IPI for deferrable timers
JIRA: https://issues.redhat.com/browse/RHEL-33787 commit d124c33 Author: Anna-Maria Behnsen <anna-maria@linutronix.de> Date: Fri Dec 1 10:26:28 2023 +0100 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 Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent cfe4cc3 commit d117d7f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

kernel/time/timer.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -548,18 +548,15 @@ static int calc_wheel_index(unsigned long expires, unsigned long clk,
548548
static void
549549
trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer)
550550
{
551-
if (!is_timers_nohz_active())
552-
return;
553-
554551
/*
555-
* TODO: This wants some optimizing similar to the code below, but we
556-
* will do that when we switch from push to pull for deferrable timers.
552+
* Deferrable timers do not prevent the CPU from entering dynticks and
553+
* are not taken into account on the idle/nohz_full path. An IPI when a
554+
* new deferrable timer is enqueued will wake up the remote CPU but
555+
* nothing will be done with the deferrable timer base. Therefore skip
556+
* the remote IPI for deferrable timers completely.
557557
*/
558-
if (timer->flags & TIMER_DEFERRABLE) {
559-
if (tick_nohz_full_cpu(base->cpu))
560-
wake_up_nohz_cpu(base->cpu);
558+
if (!is_timers_nohz_active() || timer->flags & TIMER_DEFERRABLE)
561559
return;
562-
}
563560

564561
/*
565562
* We might have to IPI the remote CPU if the base is idle and the

0 commit comments

Comments
 (0)