liveBook · Manning

Watchdog

As explained in The Coder Cafe

A kernel watchdog is a kernel monitoring mechanism that detects prolonged processor or kernel non-responsiveness.

A Linux kernel watchdog detects prolonged processor or kernel non-responsiveness. Its failure mode provides an important first clue during low-level production incident triage. section 8.2.7

Distinguish the two principal lockup signals:

  • A soft lockup occurs when kernel-mode code loops for more than 20 seconds without allowing other tasks to run. section 8.2.7
  • A hard lockup occurs when the CPU loops in kernel mode for more than 10 seconds without allowing other interrupts to run. section 8.2.7
  • These distinctions depend on tasks, context switching, kernel mode, and interrupts rather than ordinary user-space application behavior. section 8.2.7

Reading watchdog evidence

A message such as “BUG: soft lockup - CPU#13 stuck for 21s!” identifies a soft lockup. Related /proc settings show whether soft or hard lockups trigger a panic and which watchdog threshold is configured.

How The Coder Cafe covers it

How deep it goes
Defines soft and hard lockups with timing and scheduling consequences, then connects them to logging, panicking, and configuration.
Examples
Uses a soft-lockup log and /proc settings for panic behavior and watchdog thresholds.
What you can do after
Diagnose/debug incidents by interpreting soft-versus-hard lockup messages and inspecting watchdog configuration.
How it connects
Connects kernel mode to tasks, context switching, interrupts, user space, and kernel space.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Coder Cafe. The section links point to the parts of the book it draws on.