Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:add_timer_on - start a timer on a particular CPU*@timer: the timer to be added*@cpu: the CPU to start it on* This is not very scalable on SMP. Double adds are not possible.

Proto:void add_timer_on(struct timer_list *timer, int cpu)

Type:void

Parameter:

TypeParameterName
struct timer_list *timer
intcpu
1152  BUG_ON(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 || !function)
1154  new_base = get_timer_cpu_base(flags, cpu)
1161  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
1162  If base != new_base Then
1163  flags |= TIMER_MIGRATING
1165  raw_spin_unlock( & lock)
1166  base = new_base
1167  raw_spin_lock( & lock)
1168  WRITE_ONCE(flags, (flags & ~TIMER_BASEMASK) | cpu)
1171  forward_timer_base(base)
1173  debug_timer_activate(timer)
1174  internal_add_timer(base, timer)
1175  raw_spin_unlock_irqrestore( & lock, flags)