Let me answer my question after searching and reading the code.
do_timer()supposed to be called on the processor with the id stored in tick_do_timer_cpu.
kernel/time/tick-common.c
/*
* tick_do_timer_cpu - , NR
*, do_timer(), .. .
* :
*
* 1) , * . CPU, * .
*
* 2) NOHZ, * TICK_DO_TIMER_NONE, CPU. , , * . * cpu hotplug.
*/
tick_do_timer_cpu tick_periodic() tick_sched_do_timer(). CPU , do_timer(), .
static void tick_periodic(int cpu)
{
if (tick_do_timer_cpu == cpu) {
write_seqlock(&jiffies_lock);
tick_next_period = ktime_add(tick_next_period, tick_period);
do_timer(1);
write_sequnlock(&jiffies_lock);
update_wall_time();
}
update_process_times(user_mode(get_irq_regs()));
profile_tick(CPU_PROFILING);
}`
, jiffies SMP-.