Answers:
基本上,如果CPU调度程序在给定的时间内未切换到该进程,并且该进程不符合异常条件,则触发此日志记录。
例外情况是特殊情况,即尚未切换到进程但不应记录该进程。我不清楚这些例外的条件;FWIW对代码中的案例的评论是:
Also, skip vfork and any other user process that freezer should skip.
Also, when a freshly created task is scheduled once, changes
its state to TASK_UNINTERRUPTIBLE without having ever been
switched out once, it musn't be checked.
http://lxr.free-electrons.com/source/kernel/hung_task.c#L75
至于为什么可能长时间不安排任务,将其连续置于TASK_UNINTERRUPTABLE(“ D”状态)将是一种可能性,但我不知道还有什么可能。