timer_reduce(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… timer_reduce(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual page for timer_reduce. It’s giving β€œtiny timeout edit, but make it conditional” ✨. Let’s get into it.


🌸 NAME 🌸

timer_reduce β€” modify a timer’s timeout if it would reduce the timeout. Periodt.

πŸŽ€ SYNOPSIS πŸŽ€

int timer_reduce (struct timer_list *timer , unsigned long expires );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • timer β€” the timer to be modified.
  • expires β€” new absolute timeout in jiffies. Yes, absolute, not vibes πŸ’….

✨ DESCRIPTION ✨

timer_reduce is very similar to mod_timer, except that it will only modify an enqueued timer if that would reduce the expiration time. If timer is not enqueued it starts the timer.

If timer->function == NULL then the start operation is silently discarded. Silently, bestie β€” no dramatic error, no group-chat notification, it’s just discarded πŸ™ˆ.

πŸ’– RETURN πŸ’–

  • 0 β€” the timer was inactive and started, or was in shutdown state and the operation was discarded.
  • 1 β€” the timer was active and requeued to expire at expires, or the timer was active and not modified because expires did not change the effective expiry time such that the timer would expire earlier than already scheduled.
lowkey important: return 1 is doing double duty here β€” read the whole bullet, don’t just vibe check the number πŸ’€.

🌈 SEE ALSO 🌈

Kernel file: ./kernel/time/timer.c. Also in the squad: 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), 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).


Source/version: ./kernel/time Β· Date: October 2026. That’s the whole page, bestie β€” now go reduce those timeouts responsibly πŸ’…πŸ’–

πŸ“¦ where this page comes from