xref: /openbmc/linux/Documentation/trace/rv/monitor_wwnr.rst (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
1ccc319dcSDaniel Bristot de OliveiraMonitor wwnr
2ccc319dcSDaniel Bristot de Oliveira============
3ccc319dcSDaniel Bristot de Oliveira
4ccc319dcSDaniel Bristot de Oliveira- Name: wwrn - wakeup while not running
5ccc319dcSDaniel Bristot de Oliveira- Type: per-task deterministic automaton
6ccc319dcSDaniel Bristot de Oliveira- Author: Daniel Bristot de Oliveira <bristot@kernel.org>
7ccc319dcSDaniel Bristot de Oliveira
8ccc319dcSDaniel Bristot de OliveiraDescription
9ccc319dcSDaniel Bristot de Oliveira-----------
10ccc319dcSDaniel Bristot de Oliveira
11ccc319dcSDaniel Bristot de OliveiraThis is a per-task sample monitor, with the following
12ccc319dcSDaniel Bristot de Oliveiradefinition::
13ccc319dcSDaniel Bristot de Oliveira
14ccc319dcSDaniel Bristot de Oliveira               |
15ccc319dcSDaniel Bristot de Oliveira               |
16ccc319dcSDaniel Bristot de Oliveira               v
17ccc319dcSDaniel Bristot de Oliveira    wakeup   +-------------+
18ccc319dcSDaniel Bristot de Oliveira  +--------- |             |
19ccc319dcSDaniel Bristot de Oliveira  |          | not_running |
20ccc319dcSDaniel Bristot de Oliveira  +--------> |             | <+
21ccc319dcSDaniel Bristot de Oliveira             +-------------+  |
22ccc319dcSDaniel Bristot de Oliveira               |              |
23ccc319dcSDaniel Bristot de Oliveira               | switch_in    | switch_out
24ccc319dcSDaniel Bristot de Oliveira               v              |
25ccc319dcSDaniel Bristot de Oliveira             +-------------+  |
26ccc319dcSDaniel Bristot de Oliveira             |   running   | -+
27ccc319dcSDaniel Bristot de Oliveira             +-------------+
28ccc319dcSDaniel Bristot de Oliveira
29*d56b699dSBjorn HelgaasThis model is broken, the reason is that a task can be running
30ccc319dcSDaniel Bristot de Oliveirain the processor without being set as RUNNABLE. Think about a
31ccc319dcSDaniel Bristot de Oliveiratask about to sleep::
32ccc319dcSDaniel Bristot de Oliveira
33ccc319dcSDaniel Bristot de Oliveira  1:      set_current_state(TASK_UNINTERRUPTIBLE);
34ccc319dcSDaniel Bristot de Oliveira  2:      schedule();
35ccc319dcSDaniel Bristot de Oliveira
36ccc319dcSDaniel Bristot de OliveiraAnd then imagine an IRQ happening in between the lines one and two,
37ccc319dcSDaniel Bristot de Oliveirawaking the task up. BOOM, the wakeup will happen while the task is
38ccc319dcSDaniel Bristot de Oliveirarunning.
39ccc319dcSDaniel Bristot de Oliveira
40ccc319dcSDaniel Bristot de Oliveira- Why do we need this model, so?
41ccc319dcSDaniel Bristot de Oliveira- To test the reactors.
42ccc319dcSDaniel Bristot de Oliveira
43ccc319dcSDaniel Bristot de OliveiraSpecification
44ccc319dcSDaniel Bristot de Oliveira-------------
45ccc319dcSDaniel Bristot de OliveiraGrapviz Dot file in tools/verification/models/wwnr.dot
46