about watchdogs in kernel

Sometimes we are puzzled by different watchdog in kernel.

a)      CONFIG_MSM_WATCHDOG_V2, in qualcomm code it is enabled by default.
Source: drivers/soc/qcom/watchdog_v2.c
This is the hardware watchdog on qcom platform (non-secure wdog). 
It is only happened on core0 and use ipi to ping other cores.

It is defined in dtsi file, for example,

qcom,bark-time = <11000>;
qcom,pet-time = <10000>;
qcom,ipi-ping;

 

b)      sometime we also found kernel thread like following:
0       ISleep  f6052800        RT99    0       0       8011280155      0       watchdog/0     
2       ISleep  f6056400        RT99    0       0       8011293540      0       watchdog/2     
3       ISleep  f60a0500        RT99    0       0       8011294165      0       watchdog/3     
1       ISleep  f6054600        RT99    0       0       8019225571      0       watchdog/1     

Source: kernel/kernel/watchdog.c

They are per-cpu threads if you open CONFIG_LOCKUP_DETECTOR. It is pure software dog that can detect soft lockup, hard lockup, depends on different kernel config.
 __touch_watchdog is their petting function.

CONFIG_LOCKUP_DETECTOR is by default enabled in qualcomm builds.
 
c)       If you open CONFIG_WATCHDOG, will create /dev/watchdog node,
Source:
/drivers/watchdog/watchdog_core.c
/drivers/watchdog/watchdog_dev.c

       By default it is disabled in qualcomm builds.

你可能感兴趣的:(about watchdogs in kernel)