mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-29 01:04:14 -04:00
Add a sample monitor to showcase hybrid/timed automata. The stall monitor identifies tasks stalled for longer than a threshold and reacts when that happens. Reviewed-by: Nam Cao <namcao@linutronix.de> Link: https://lore.kernel.org/r/20260330111010.153663-7-gmonaco@redhat.com Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
44 lines
1.6 KiB
ReStructuredText
44 lines
1.6 KiB
ReStructuredText
Monitor stall
|
|
=============
|
|
|
|
- Name: stall - stalled task monitor
|
|
- Type: per-task hybrid automaton
|
|
- Author: Gabriele Monaco <gmonaco@redhat.com>
|
|
|
|
Description
|
|
-----------
|
|
|
|
The stalled task (stall) monitor is a sample per-task timed monitor that checks
|
|
if tasks are scheduled within a defined threshold after they are ready::
|
|
|
|
|
|
|
|
|
|
v
|
|
#==========================#
|
|
+-----------------> H dequeued H
|
|
| #==========================#
|
|
| |
|
|
sched_switch_wait | sched_wakeup;reset(clk)
|
|
| v
|
|
| +--------------------------+ <+
|
|
| | enqueued | | sched_wakeup
|
|
| | clk < threshold_jiffies | -+
|
|
| +--------------------------+
|
|
| | ^
|
|
| sched_switch_in sched_switch_preempt;reset(clk)
|
|
| v |
|
|
| +--------------------------+
|
|
+------------------ | running |
|
|
+--------------------------+
|
|
^ sched_switch_in |
|
|
| sched_wakeup |
|
|
+----------------------+
|
|
|
|
The threshold can be configured as a parameter by either booting with the
|
|
``stall.threshold_jiffies=<new value>`` argument or writing a new value to
|
|
``/sys/module/stall/parameters/threshold_jiffies``.
|
|
|
|
Specification
|
|
-------------
|
|
Graphviz Dot file in tools/verification/models/stall.dot
|