mod_timer_pending(9)
π mod_timer_pending(9) π
okay bestie, welcome to the Kernel API Manual β this one's mod_timer_pending(9) and it's literally the timer-nerd's bestie. buckle up π
β¨ NAME β¨
mod_timer_pending β tweak a pending timer's timeout, no cap β°
πΈ SYNOPSIS πΈ
int mod_timer_pending (struct timer_list *timer , unsigned long expires );
π¦ ARGUMENTS π¦
timerβ the pending timer you're about to mess with, iykyk π«Άexpiresβ the new absolute timeout, measured in jiffies β±οΈ
π DESCRIPTION π
so like, mod_timer_pending is the exact same energy as mod_timer for pending timers β but it will not activate timers that are currently inactive. it's giving "respect the vibe of a sleeping timer" π΄β¨
and here's the little detail that matters: if timer->function == NULL, then the start operation is silently discarded. no error, no drama, just... gone π
π₯ RETURN π₯
0β the timer was inactive and not modified, or it was in a shutdown state and the whole operation was discarded π1β the timer was active and got requeued to expire atexpiresβ slay, it worked π
π SEE ALSO π
go peek at the kernel file ./kernel/time/timer.c and the struct timer_base(9), plus this whole iconic friend group of timer functions:
__round_jiffies_relative(9)round_jiffies(9)round_jiffies_relative(9)__round_jiffies_up_relative(9)round_jiffies_up(9)round_jiffies_up_relative(9)timer_init_key(9)mod_timer(9)timer_reduce(9)add_timer(9)add_timer_local(9)add_timer_global(9)add_timer_on(9)__timer_delete(9)timer_delete(9)timer_shutdown(9)__try_to_del_timer_sync(9)timer_delete_sync_try(9)__timer_delete_sync(9)timer_delete_sync(9)timer_shutdown_sync(9)fetch_next_timer_interrupt_remote(9)timer_unlock_remote_bases(9)timer_lock_remote_bases(9)timer_base_is_idle(9)timer_expire_remote(9)get_next_timer_interrupt(9)timer_base_try_to_set_idle(9)timer_clear_idle(9)__run_timers(9)
π‘ reminder bestie: this only works its magic on pending timers. if your timer's inactive, this function is gonna hit it with the silent treatment fr fr.
and that's the whole page, periodt π
β¨ sourced straight from ./kernel/time, dated October 2026 β mwah, go forth and time your timers correctly π§π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms