时间子系统16_soft lockup机制(二)
断上下文中被唤醒,
// 当中断退出时,kthread会抢占cpu上的当前进程。如果
// 抢占被关闭的话,则不会发生抢占,watchdog便无法更新时
// 间戳,当抢占关闭的时间超过阈值时,核心认为发生了soft
// lock up。
// 注:soft lockup阈值 watchdog_thresh * 2 (20s)
3.2 static int is_softlockup(unsigned long touch_ts)
{
//当前时间戳
unsigned long now = get_timestamp(smp_processor_id());
//watchdog在 watchdog_thresh * 2 时间内未被调度过
if (time_after(now, touch_ts + get_softlockup_thresh()))
return now - touch_ts;
return 0;
}