timer_delete_sync_try(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… timer_delete_sync_try β€” the Kernel API Manual tea 🫢

okay so bestie, welcome to the kernel API manual for timer_delete_sync_try(9) β€” yes the whole page, sit down, it's not that long, and it's kind of iconic ngl ✨


🌸 NAME 🌸

timer_delete_sync_try β€” try to deactivate a timer, like, attempt it, no promises πŸ’…

✨ SYNOPSIS ✨

int timer_delete_sync_try (struct timer_list *timer );

literally one argument, we love a low-effort king πŸ‘‘

πŸŽ€ ARGUMENTS πŸŽ€

  • timer β€” the Timer to deactivate. that's it. that's the whole vibe. it's the timer you're trying to shut down 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's what it does: this function tries to deactivate a timer. emphasis on tries, bestie, it's in the name, read the room 😭

on success the timer is not queued, and the timer callback function is not running on any CPU. so like, timer's gone, callback's not vibing on any core, we're clean ✨

but like, lowkey important caveat: this function does not guarantee that the timer cannot be rearmed right after dropping the base lock. so if that's a problem for you, that's a you problem β€” it needs to be prevented by the calling code if necessary πŸ’€ no cap.

πŸ”₯ RETURN πŸ”₯

here's the vibe check, three possible outcomes:

  • 0 β€” The timer was not pending. nothing was happening, nothing to do, we move on πŸ™ˆ
  • 1 β€” The timer was pending and deactivated. slay, we got it, it's done πŸ’…
  • -1 β€” The timer callback function is running on a different CPU. not me, not my core, someone else is holding it, go ask them 😭

πŸ’– SEE ALSO πŸ’–

the whole friend group, gather round 🫢 β€” Kernel file ./kernel/time/timer.c struct timer_base(9), __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_pending(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(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)


okay that's the whole page, you ate that πŸ“ and now for the cute sign-off: this little masterpiece lives in ./kernel/time, dated October 2026, and it's filed under timer_delete_sync_try(9) β€” go forth and deactivate responsibly, mwah πŸ’œπŸ§š

πŸ“¦ where this page comes from