__timer_delete_sync(9)
π
__timer_delete_sync β the kernel API manual, but make it make sense β¨
okay so bestie, you've stumbled into the kernel's guts and found __timer_delete_sync β that's the internal function, the one behind the curtain, the main character of "please stop, timer, I need you gone and I need you to actually be gone." It deactivates a timer and waits for the handler to finish π
The manual name is __timer_delete_sync(9), by the way β section 9, kernel API manual, iykyk π¦
πΈ SYNOPSIS πΈ
int __timer_delete_sync (struct timer_list *timer , bool shutdown );
like, that's the whole vibe. two args, one int return, zero chill π
β¨ ARGUMENTS β¨
timerβ the timer you're deactivating. that's the target, the one getting the β¨cancel treatmentβ¨shutdownβ if it'strue, thentimer->functiongets set toNULLunder the timer base lock, which is what stops the timer from being rearmed, no cap π«Ά
π¦ DESCRIPTION π¦
so here's the tea, and it's actually important tea β
If shutdown is not set, the timer can be rearmed later. cute, flexible, whatever. BUT β and this is the part where you gotta pay attention β if the timer can be rearmed concurrently, like after the base lock has been dropped, then the return value is meaningless π like fr fr meaningless. it's giving "don't @ me, i warned you."
If shutdown is set, then timer->function is set to NULL under the timer base lock, and that's what prevents the timer from being rearmed. any attempt to rearm a shutdown timer is silently ignored β like not even a little error, not even a peep, just π nothing. ghosted. periodt.
And if you wanna reuse that timer after shutdown? bestie, you have to initialize it again. no shortcuts, no "it'll probably be fine", it will not probably be fine π
lowkey the whole point: shutdown = permanent, no take-backs, you gotta re-init to bring it back π
π RETURN π
0β the timer was not pending π1β the timer was pending and got deactivated, slay β¨
π₯ SEE ALSO π₯
oh we're doing the whole friend group, okay, gather round π«Ά
The kernel file lives at ./kernel/time/timer.c, and it's hanging out with struct timer_base(9), plus literally everyone else:
__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_try(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)
like okay that's the entire timers extended universe, we love a comprehensive cast π
and that's the whole page, bestie π§ this one comes from ./kernel/time, dated October 2026, and it's still filed under __timer_delete_sync(9) β so go forth, delete your timers synchronously, and remember: shutdown means shutdown π
β¨π
π¦ 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