- 论坛徽章:
- 16
|
本帖最后由 tc1989tc 于 2015-07-24 17:59 编辑
2.6.22 timer_interrupt如下:- void timer_interrupt(struct pt_regs * regs)
- {
- struct pt_regs *old_regs;
- int next_dec;
- unsigned long cpu = smp_processor_id();
- unsigned jiffy_stamp = last_jiffy_stamp(cpu);
- extern void do_IRQ(struct pt_regs *);
- if (atomic_read(&ppc_n_lost_interrupts) != 0)
- do_IRQ(regs);
- old_regs = set_irq_regs(regs);
- irq_enter();
- while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) {
- jiffy_stamp += tb_ticks_per_jiffy;
-
- profile_tick(CPU_PROFILING);
- update_process_times(user_mode(regs));
- if (smp_processor_id())
- continue;
- /* We are in an interrupt, no need to save/restore flags */
- write_seqlock(&xtime_lock);
- tb_last_stamp = jiffy_stamp;
- do_timer(1);
- /*
- * update the rtc when needed, this should be performed on the
- * right fraction of a second. Half or full second ?
- * Full second works on mk48t59 clocks, others need testing.
- * Note that this update is basically only used through
- * the adjtimex system calls. Setting the HW clock in
- * any other way is a /dev/rtc and userland business.
- * This is still wrong by -0.5/+1.5 jiffies because of the
- * timer interrupt resolution and possible delay, but here we
- * hit a quantization limit which can only be solved by higher
- * resolution timers and decoupling time management from timer
- * interrupts. This is also wrong on the clocks
- * which require being written at the half second boundary.
- * We should have an rtc call that only sets the minutes and
- * seconds like on Intel to avoid problems with non UTC clocks.
- */
- if ( ppc_md.set_rtc_time && ntp_synced() &&
- xtime.tv_sec - last_rtc_update >= 659 &&
- abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ) {
- if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
- last_rtc_update = xtime.tv_sec+1;
- else
- /* Try again one minute later */
- last_rtc_update += 60;
- }
- write_sequnlock(&xtime_lock);
- }
- if ( !disarm_decr[smp_processor_id()] )
- set_dec(next_dec);
- last_jiffy_stamp(cpu) = jiffy_stamp;
- if (ppc_md.heartbeat && !ppc_md.heartbeat_count--)
- ppc_md.heartbeat();
- irq_exit();
- set_irq_regs(old_regs);
- }
复制代码 遇到内核panic信息如下:
Call Trace:
[C035B9E0] [C0006888] show_stack+0x34/0x194 (unreliable)
[C035BA10] [C005C2D4] softlockup_tick+0xa4/0xf4
[C035BA30] [C00388E4] run_local_timers+0x18/0x28
[C035BA40] [C0038924] update_process_times+0x30/0x7c
[C035BA50] [C004F344] tick_sched_timer+0xf4/0x304
[C035BAB0] [C004B4E0] hrtimer_interrupt+0x25c/0x2b4
[C035BB20] [C000A524] timer_interrupt+0x74/0x330
。。。。。。。
linux版本为2.6.22 在ppc上面,按照上面的打印消息
去查看timer_interrupt 函数,但是并没有看到调用hrtimer_interrupt啊? 请问上面的打印堆栈不准确?
但是在3.18.1版本能追溯到timer_interrupt -->__timer_interrupt -->hrtimer_interrupt 的调用
|
|