<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/rv/ha_monitor.h, branch v7.1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-06-03T10:33:25+00:00</updated>
<entry>
<title>rv: Ensure synchronous cleanup for HA monitors</title>
<updated>2026-06-03T10:33:25+00:00</updated>
<author>
<name>Gabriele Monaco</name>
<email>gmonaco@redhat.com</email>
</author>
<published>2026-06-01T15:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=74e17bd6fc8ed7e30363bb78d4c50b38cfd71efe'/>
<id>urn:sha1:74e17bd6fc8ed7e30363bb78d4c50b38cfd71efe</id>
<content type='text'>
HA monitors may start timers, all cleanup functions currently stop the
timers asynchronously to avoid sleeping in the wrong context.
Nothing makes sure running callbacks terminate on cleanup.

Run the entire HA timer callback in an RCU read-side critical section,
this way we can simply synchronize_rcu() with any pending timer and are
sure any cleanup using kfree_rcu() runs after callbacks terminated.
Additionally make sure any unlikely callback running late won't run any
code if the monitor is marked as disabled or if destruction started.
Use memory barriers to serialise with racing resets.

Fixes: f5587d1b6ec9 ("rv: Add Hybrid Automata monitor type")
Fixes: 4a24127bd6cb ("rv: Add support for per-object monitors in DA/HA")
Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://lore.kernel.org/r/20260601153840.124372-9-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco &lt;gmonaco@redhat.com&gt;
</content>
</entry>
<entry>
<title>rv: Add automatic cleanup handlers for per-task HA monitors</title>
<updated>2026-06-03T10:33:24+00:00</updated>
<author>
<name>Gabriele Monaco</name>
<email>gmonaco@redhat.com</email>
</author>
<published>2026-06-01T15:38:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=700782ec8f6589c5792b323efd6e004dd183328b'/>
<id>urn:sha1:700782ec8f6589c5792b323efd6e004dd183328b</id>
<content type='text'>
Hybrid automata monitors may start timers, depending on the model, these
may remain active on an exiting task and cause false positives or even
access freed memory.

Add an enable/disable hook in the HA code, currently only populated by
the per-task handler for registration and deregistration.
This hooks to the sched_process_exit event and ensures the timer is
stopped for every exiting task. The handler is enabled automatically but
may be disabled, for instance if the monitor uses the event for another
purpose (but should still manually ensure timers are stopped).

Fixes: f5587d1b6ec9 ("rv: Add Hybrid Automata monitor type")
Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://lore.kernel.org/r/20260601153840.124372-8-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco &lt;gmonaco@redhat.com&gt;
</content>
</entry>
<entry>
<title>rv: Do not rely on clean monitor when initialising HA</title>
<updated>2026-06-03T10:33:24+00:00</updated>
<author>
<name>Gabriele Monaco</name>
<email>gmonaco@redhat.com</email>
</author>
<published>2026-06-01T15:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=713c9e1ea7623846f8e0bb657f1b9d211d1a61e6'/>
<id>urn:sha1:713c9e1ea7623846f8e0bb657f1b9d211d1a61e6</id>
<content type='text'>
Hybrid Automata monitors hook into the DA implementation when doing
da_monitor_reset(). This function is called both on initialisation and
teardown, HA monitors try to cancel a timer only when it's initialised
relying on the da_mon-&gt;monitoring flag. This flag could however be
corrupted during initialisation. This happens for instance on per-task
monitors that share the same storage with different type of monitors
like LTL or in case of races during a previous teardown.

Stop relying on the monitoring flag during initialisation, assume that
can have any value, so use a separate da_reset_state() skiping timer
cancellation.
New monitors (e.g. new tasks) are always zero-initialised so it is safe
to rely on the monitoring flag for those.

Reported-by: Wen Yang &lt;wen.yang@linux.dev&gt;
Closes: https://lore.kernel.org/lkml/d02c656aada7d071f083460a5c9a454363669b61.1778522945.git.wen.yang@linux.dev
Suggested-by: Nam Cao &lt;namcao@linutronix.de&gt;
Fixes: f5587d1b6ec9 ("rv: Add Hybrid Automata monitor type")
Reviewed-by: Wen Yang &lt;wen.yang@linux.dev&gt;
Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://lore.kernel.org/r/20260601153840.124372-7-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco &lt;gmonaco@redhat.com&gt;
</content>
</entry>
<entry>
<title>rv: Add support for per-object monitors in DA/HA</title>
<updated>2026-03-31T14:47:17+00:00</updated>
<author>
<name>Gabriele Monaco</name>
<email>gmonaco@redhat.com</email>
</author>
<published>2026-03-30T11:10:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a24127bd6cbf03fb17de8b43f2d8db3f55ca333'/>
<id>urn:sha1:4a24127bd6cbf03fb17de8b43f2d8db3f55ca333</id>
<content type='text'>
RV deterministic and hybrid automata currently only support global,
per-cpu and per-task monitors. It isn't possible to write a model that
would follow some different type of object, like a deadline entity or a
lock.

Define the generic per-object monitor implementation which shares part
of the implementation with the per-task monitors.
The user needs to provide an id for the object (e.g. pid for tasks) and
define the data type for the monitor_target (e.g. struct task_struct *
for tasks). Both are supplied to the event handlers, as the id may not
be easily available in the target.

The monitor storage (e.g. the rv monitor, pointer to the target, etc.)
is stored in a hash table indexed by id. Monitor storage objects are
automatically allocated unless specified otherwise (e.g. if the creation
context is unsafe for allocation).

Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://lore.kernel.org/r/20260330111010.153663-9-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco &lt;gmonaco@redhat.com&gt;
</content>
</entry>
<entry>
<title>rv: Add Hybrid Automata monitor type</title>
<updated>2026-03-31T14:47:16+00:00</updated>
<author>
<name>Gabriele Monaco</name>
<email>gmonaco@redhat.com</email>
</author>
<published>2026-03-30T11:10:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f5587d1b6ec938afb2f74fe399a68020d66923e4'/>
<id>urn:sha1:f5587d1b6ec938afb2f74fe399a68020d66923e4</id>
<content type='text'>
Deterministic automata define which events are allowed in every state,
but cannot define more sophisticated constraint taking into account the
system's environment (e.g. time or other states not producing events).

Add the Hybrid Automata monitor type as an extension of Deterministic
automata where each state transition is validating a constraint on a
finite number of environment variables.
Hybrid automata can be used to implement timed automata, where the
environment variables are clocks.

Also implement the necessary functionality to handle clock constraints
(ns or jiffy granularity) on state and events.

Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://lore.kernel.org/r/20260330111010.153663-3-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco &lt;gmonaco@redhat.com&gt;
</content>
</entry>
</feed>
