softlockup/hardlockup原理详细介绍
转载自 https://blog.csdn.net/hzj_001/article/details/100054659 主体涉及到了3个机制:kernel watchodog线程,高精度定时器(时钟中断),基于PMU硬件perf event的NMI(不可屏蔽中断)。 基本思想: 1.)(soft lockup):抢占被长时间关闭而导致其余进程无法调度 2.)(hard lockup):中断被长时间关闭而导致 softlockup基本原理: 1)SoftLockup 检测首先需要对每一个CPU core注册叫做watchdog的kernel线程。即[watchdog/0],[watchdog/1],[watchdog/2]… 2)同时,系统会有一个高精度的计时器hrtimer,该计时器能定期产生时钟中断,该中断对应的中断回调函数是watchdog_timer_fn();此中断回调函数主要做3件事: a.watchdog_interrupt_count函数更新hrtimer_interrupts变量(判断hardlockup会用) b.wake_up_process唤醒watchdog线程(更新时间戳) c.is_softlockup判断是否出现了soft_lockup soft lock detector会检查时间戳,如果超过soft lockup threshold一直未更新,说明