Re: [PATCH] tick/nohz: Remove redundant IRQ save/restore

From: Frederic Weisbecker

Date: Wed Sep 16 2026 - 10:58:48 EST


Le Wed, Sep 16, 2026 at 07:15:30AM -0700, Usama Arif a écrit :
> tick_nohz_update_jiffies() is only reached through tick_irq_enter() from
> hard interrupt entry, where local interrupts are already disabled.
>
> tick_do_update_jiffies64() requires interrupts to be disabled. The
> local_irq_save()/local_irq_restore() pair around it therefore provides no
> additional interrupt exclusion.
>
> Remove it and assert the caller invariant instead.
>
> On x86-64, this avoids the redundant RFLAGS save, CLI, saved-IF test and
> conditional branch on the tick-stopped path.
>
> On a 252-CPU host running a Thrift RPC service, tick_irq_enter() ran
> 165,116 times/s out of 212-244k interrupts/s. Only calls with
> TS_FLAG_STOPPED reach the optimized path, so this is an upper bound on
> its execution rate.
>
> Signed-off-by: Usama Arif <usama.arif@xxxxxxxxx>

Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>

--
Frederic Weisbecker
SUSE Labs