Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\timer.c Create Date:2022-07-28 10:39:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__mod_timer

Proto:static inline int __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int options)

Type:int

Parameter:

TypeParameterName
struct timer_list *timer
unsigned longexpires
unsigned intoptions
952  idx = UINT_MAX
953  clk = 0
954  ret = 0
956  BUG_ON(!function)
963  If mer_pending - is a timer pending?*@timer: the timer in question* timer_pending will tell whether a given timer is currently pending,* or not. Callers must ensure serialization wrt. other operations done* to this timer, eg Then
969  diff = expires - expires
971  If Not diff Then Return 1
973  If options & MOD_TIMER_REDUCE && diff <= 0 Then Return 1
982  base = We are using hashed locking: Holding per_cpu(timer_bases[x]).lock means* that all timers which are tied to this base are locked, and the base itself* is locked too.* So __run_timers/migrate_timers can safely modify all timers which could
983  forward_timer_base(base)
987  ret = 1
988  Go to out_unlock
991  clk = clk
992  idx = calc_wheel_index(expires, clk)
999  If idx == timer_get_idx(timer) Then
1000  If Not (options & MOD_TIMER_REDUCE) Then expires = expires
1004  ret = 1
1005  Go to out_unlock
1007  Else
1008  base = We are using hashed locking: Holding per_cpu(timer_bases[x]).lock means* that all timers which are tied to this base are locked, and the base itself* is locked too.* So __run_timers/migrate_timers can safely modify all timers which could
1009  forward_timer_base(base)
1012  ret = detach_if_pending(timer, base, false)
1013  If Not ret && options & MOD_TIMER_PENDING_ONLY Then Go to out_unlock
1016  new_base = get_target_base(base, flags)
1018  If base != new_base Then
1030  raw_spin_unlock( & lock)
1031  base = new_base
1032  raw_spin_lock( & lock)
1039  debug_timer_activate(timer)
1041  expires = expires
1049  If idx != UINT_MAX && clk == clk Then
1050  Enqueue the timer into the hash bucket, mark it pending in* the bitmap and store the index in the timer flags.
1051  trigger_dyntick_cpu(base, timer)
1052  Else
1053  internal_add_timer(base, timer)
1056  out_unlock :
1057  raw_spin_unlock_irqrestore( & lock, flags)
1059  Return ret
Caller
NameDescribe
mod_timer_pendingmod_timer_pending - modify a pending timer's timeout*@timer: the pending timer to be modified*@expires: new timeout in jiffies* mod_timer_pending() is the same for pending timers as mod_timer(),* but will not re-activate and modify already deleted timers.
mod_timermod_timer - modify a timer's timeout*@timer: the timer to be modified*@expires: new timeout in jiffies* mod_timer() is a more efficient way to update the expire field of an* active timer (if the timer is inactive it will be activated)* mod_timer(timer,
timer_reducemer_reduce - Modify a timer's timeout if it would reduce the timeout*@timer: The timer to be modified*@expires: New timeout in jiffies* timer_reduce() is very similar to mod_timer(), except that it will only* modify a running timer if that would reduce
schedule_timeoutschedule_timeout - sleep until timeout*@timeout: timeout value in jiffies* Make the current task sleep until @timeout jiffies have* elapsed