mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 01:29:02 +02:00
Add 2 per-task monitors as part of the sched model:
* nrp: need-resched preempts
Monitor to ensure preemption requires need resched.
* sssw: set state sleep and wakeup
Monitor to ensure sched_set_state to sleepable leads to sleeping and
sleeping tasks require wakeup.
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Tomas Glozar <tglozar@redhat.com>
Cc: Juri Lelli <jlelli@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/20250728135022.255578-9-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Acked-by: Nam Cao <namcao@linutronix.de>
Tested-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
75 lines
1.5 KiB
C
75 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Automatically generated C representation of nrp automaton
|
|
* For further information about this format, see kernel documentation:
|
|
* Documentation/trace/rv/deterministic_automata.rst
|
|
*/
|
|
|
|
enum states_nrp {
|
|
preempt_irq_nrp = 0,
|
|
any_thread_running_nrp,
|
|
nested_preempt_nrp,
|
|
rescheduling_nrp,
|
|
state_max_nrp
|
|
};
|
|
|
|
#define INVALID_STATE state_max_nrp
|
|
|
|
enum events_nrp {
|
|
irq_entry_nrp = 0,
|
|
sched_need_resched_nrp,
|
|
schedule_entry_nrp,
|
|
schedule_entry_preempt_nrp,
|
|
event_max_nrp
|
|
};
|
|
|
|
struct automaton_nrp {
|
|
char *state_names[state_max_nrp];
|
|
char *event_names[event_max_nrp];
|
|
unsigned char function[state_max_nrp][event_max_nrp];
|
|
unsigned char initial_state;
|
|
bool final_states[state_max_nrp];
|
|
};
|
|
|
|
static const struct automaton_nrp automaton_nrp = {
|
|
.state_names = {
|
|
"preempt_irq",
|
|
"any_thread_running",
|
|
"nested_preempt",
|
|
"rescheduling"
|
|
},
|
|
.event_names = {
|
|
"irq_entry",
|
|
"sched_need_resched",
|
|
"schedule_entry",
|
|
"schedule_entry_preempt"
|
|
},
|
|
.function = {
|
|
{
|
|
preempt_irq_nrp,
|
|
preempt_irq_nrp,
|
|
nested_preempt_nrp,
|
|
nested_preempt_nrp
|
|
},
|
|
{
|
|
any_thread_running_nrp,
|
|
rescheduling_nrp,
|
|
any_thread_running_nrp,
|
|
INVALID_STATE
|
|
},
|
|
{
|
|
nested_preempt_nrp,
|
|
preempt_irq_nrp,
|
|
any_thread_running_nrp,
|
|
any_thread_running_nrp
|
|
},
|
|
{
|
|
preempt_irq_nrp,
|
|
rescheduling_nrp,
|
|
any_thread_running_nrp,
|
|
any_thread_running_nrp
|
|
},
|
|
},
|
|
.initial_state = preempt_irq_nrp,
|
|
.final_states = { 0, 1, 0, 0 },
|
|
};
|