函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\hung_task.c Create Date:2022-07-27 12:49:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:check_hung_task

函数原型:static void check_hung_task(struct task_struct *t, unsigned long timeout)

返回类型:void

参数:

类型参数名称
struct task_struct *t
unsigned longtimeout
90  switch_count等于切换计数上下文切换计数
96  如果此条件成立可能性小(为编译器优化)(任务标志 & (Frozen for system suspend | Freezer should not count it as freezable ))则返回
104  如果此条件成立可能性小(为编译器优化)(!switch_count)则返回
107  如果switch_count不等于last_switch_count
108  last_switch_count等于switch_count
109  last_switch_time等于jiffies
110  返回
112  如果ime_is_after_jiffies(a) return true if a is after jiffies (last_switch_time + timeout * HZ)则返回
115  trace_sched_process_hang(t)
117  如果Should we panic (and reboot, if panic_timeout= is set) when a* hung task is detected:
118  console_verbose()
119  hung_task_show_lock = true
120  hung_task_call_panic = true
127  如果sysctl_hung_task_warnings
128  如果sysctl_hung_task_warnings大于0则sysctl_hung_task_warnings自减
130  打印错误信息("INFO: task %s:%d blocked for more than %ld seconds.\n", 是否使用FPU, 进程ID, (jiffies - last_switch_time) / HZ)
132  打印错误信息(" %s %s %.*s\n", print_tainted - return a string to represent the kernel taint state.* For individual taint flag meanings, see Documentation/admin-guide/sysctl/kernel.rst* The string is overwritten by the next call to print_tainted(),* but is always NULL terminated., release, (int)strcspn - Calculate the length of the initial substring of @s which does not contain letters in @reject*@s: The string to be searched*@reject: The string to avoid, version)
136  打印错误信息("\"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\" disables this message.\n")
138  sched_show_task(t)
139  hung_task_show_lock = true
142  h_nmi_watchdog - restart NMI watchdog timeout.* If the architecture supports the NMI watchdog, touch_nmi_watchdog()* may be used to reset the timeout - for code which intentionally* disables interrupts for a long time. This call is stateless.
调用者
名称描述
check_hung_uninterruptible_tasksCheck whether a TASK_UNINTERRUPTIBLE does not get woken up for* a really long time (120 seconds). If that happens, print out* a warning.