免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1878 | 回复: 1
打印 上一主题 下一主题

[中断] timer_interrupt 在ppc上面的疑惑 请指教 [复制链接]

论坛徽章:
16
CU十二周年纪念徽章
日期:2013-10-24 15:41:3415-16赛季CBA联赛之广东
日期:2015-12-23 21:21:55青铜圣斗士
日期:2015-12-05 10:35:30黄金圣斗士
日期:2015-11-26 20:42:16神斗士
日期:2015-11-19 12:47:50每日论坛发贴之星
日期:2015-11-18 06:20:00程序设计版块每日发帖之星
日期:2015-11-18 06:20:002015亚冠之城南
日期:2015-11-10 19:10:492015亚冠之萨济拖拉机
日期:2015-10-28 18:47:282015亚冠之柏太阳神
日期:2015-08-30 17:21:492015亚冠之山东鲁能
日期:2015-07-07 18:48:39摩羯座
日期:2014-08-29 23:01:42
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-07-24 17:59 |只看该作者 |倒序浏览
本帖最后由 tc1989tc 于 2015-07-24 17:59 编辑

2.6.22 timer_interrupt如下:
  1. void timer_interrupt(struct pt_regs * regs)
  2. {
  3.         struct pt_regs *old_regs;
  4.         int next_dec;
  5.         unsigned long cpu = smp_processor_id();
  6.         unsigned jiffy_stamp = last_jiffy_stamp(cpu);
  7.         extern void do_IRQ(struct pt_regs *);

  8.         if (atomic_read(&ppc_n_lost_interrupts) != 0)
  9.                 do_IRQ(regs);

  10.         old_regs = set_irq_regs(regs);
  11.         irq_enter();

  12.         while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) {
  13.                 jiffy_stamp += tb_ticks_per_jiffy;
  14.                
  15.                 profile_tick(CPU_PROFILING);
  16.                 update_process_times(user_mode(regs));

  17.                   if (smp_processor_id())
  18.                         continue;

  19.                 /* We are in an interrupt, no need to save/restore flags */
  20.                 write_seqlock(&xtime_lock);
  21.                 tb_last_stamp = jiffy_stamp;
  22.                 do_timer(1);

  23.                 /*
  24.                  * update the rtc when needed, this should be performed on the
  25.                  * right fraction of a second. Half or full second ?
  26.                  * Full second works on mk48t59 clocks, others need testing.
  27.                  * Note that this update is basically only used through
  28.                  * the adjtimex system calls. Setting the HW clock in
  29.                  * any other way is a /dev/rtc and userland business.
  30.                  * This is still wrong by -0.5/+1.5 jiffies because of the
  31.                  * timer interrupt resolution and possible delay, but here we
  32.                  * hit a quantization limit which can only be solved by higher
  33.                  * resolution timers and decoupling time management from timer
  34.                  * interrupts. This is also wrong on the clocks
  35.                  * which require being written at the half second boundary.
  36.                  * We should have an rtc call that only sets the minutes and
  37.                  * seconds like on Intel to avoid problems with non UTC clocks.
  38.                  */
  39.                 if ( ppc_md.set_rtc_time && ntp_synced() &&
  40.                      xtime.tv_sec - last_rtc_update >= 659 &&
  41.                      abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ) {
  42.                           if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
  43.                                 last_rtc_update = xtime.tv_sec+1;
  44.                         else
  45.                                 /* Try again one minute later */
  46.                                 last_rtc_update += 60;
  47.                 }
  48.                 write_sequnlock(&xtime_lock);
  49.         }
  50.         if ( !disarm_decr[smp_processor_id()] )
  51.                 set_dec(next_dec);
  52.         last_jiffy_stamp(cpu) = jiffy_stamp;

  53.         if (ppc_md.heartbeat && !ppc_md.heartbeat_count--)
  54.                 ppc_md.heartbeat();

  55.         irq_exit();
  56.         set_irq_regs(old_regs);
  57. }
复制代码
遇到内核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 的调用


论坛徽章:
0
2 [报告]
发表于 2015-07-29 09:49 |只看该作者
hrtimer_interrupt 不是在软中断中被激活的吗?

   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP