timer_delete(9)
π timer_delete β deactivate a timer, bestie
okay so you found a page in the Kernel API Manual, section 9, and honestly? iconic of you. this one's all about timer_delete, and it's lowkey one of the most "know what you're doing" functions in the timer family. let's get into it π«Ά
πΈ NAME πΈ
timer_delete β Deactivate a timer
like, just turn it off. that's the whole vibe. β¨
π SYNOPSIS π
int timer_delete (struct timer_list *timer );
one function, one arg, one int coming back at you. short and slay. π
π¦ ARGUMENTS π¦
timerβ The timer to be deactivated. yeah, that's the one you're putting to sleep. π΄
β¨ DESCRIPTION β¨
okay so here's the tea, bestie, and you need to hear it. π΅
this function only deactivates a pending timer. that's its one job. not me exaggerating β that's literally all it does.
but β and this is the important part β contrary to timer_delete_sync, it does not take into account whether the timer's callback function is concurrently executed on a different CPU or not. like, it's just not checking. not its business. π
it also neither prevents rearming of the timer. nope. no protection there either.
so here's the warning that's giving main character energy: if timer can be rearmed concurrently, then the return value of this function is meaningless. π like fr fr, don't trust it. it's giving "i answered but the question changed while i was answering."
β οΈ so if there's any chance of concurrent rearming, treat that return value like a text from an ex β do not build your logic on it. π
π₯ RETURN π₯
0β The timer was not pending. nothing to do, nothing was there. π«₯1β The timer was pending and deactivated. caught it, shut it down, slay. β¨
π SEE ALSO π
okay bestie, buckle up, this list is long and it absolutely ate. π
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_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)
π one last thing π
this absolute baddie of a page lives in the ./kernel/time corner of the Kernel API Manual, dated October 2026. that's the whole footer, bestie β no cap, we got there. now go forth and deactivate responsibly. π§β
π¦ 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