Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'trace-rv-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull runtime verifier and osnoise fixes from Steven Rostedt:

- Reset idle tasks on reset for runtime verifier

When the runtime verifier is reset, it resets the task's data that is
being monitored. But it only iterates for_each_process() which does
not include the idle tasks. As the idle tasks can be monitored, they
need to be reset as well.

- Fix the enabling and disabling of tracepoints in osnoise

If timerlat is enabled and the WORKLOAD flag is not set, then the
osnoise tracer will enable the migrate task tracepoint to monitor it
for its own workload. The test to enable the tracepoint is done
against user space modifiable parameters. On disabling of the tracer,
those same parameters are used to determine if the tracepoint should
be disabled. The problem is if user space were to modify the
parameters after it enables the tracer then it may not disable the
tracepoint.

Instead, a static variable is used to keep track if the tracepoint
was enabled or not. Then when the tracer shuts down, it will use this
variable to decide to disable the tracepoint or not, instead of
looking at the user space parameters.

* tag 'trace-rv-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tracing/osnoise: Fix resetting of tracepoints
rv: Reset per-task monitors also for idle tasks

+18 -3
+4
include/rv/da_monitor.h
··· 14 14 #include <rv/automata.h> 15 15 #include <linux/rv.h> 16 16 #include <linux/bug.h> 17 + #include <linux/sched.h> 17 18 18 19 #ifdef CONFIG_RV_REACTORS 19 20 ··· 325 324 static void da_monitor_reset_all_##name(void) \ 326 325 { \ 327 326 struct task_struct *g, *p; \ 327 + int cpu; \ 328 328 \ 329 329 read_lock(&tasklist_lock); \ 330 330 for_each_process_thread(g, p) \ 331 331 da_monitor_reset_##name(da_get_monitor_##name(p)); \ 332 + for_each_present_cpu(cpu) \ 333 + da_monitor_reset_##name(da_get_monitor_##name(idle_task(cpu))); \ 332 334 read_unlock(&tasklist_lock); \ 333 335 } \ 334 336 \
+14 -3
kernel/trace/trace_osnoise.c
··· 1229 1229 } 1230 1230 } 1231 1231 1232 + static bool monitor_enabled; 1233 + 1232 1234 static int register_migration_monitor(void) 1233 1235 { 1234 1236 int ret = 0; ··· 1239 1237 * Timerlat thread migration check is only required when running timerlat in user-space. 1240 1238 * Thus, enable callback only if timerlat is set with no workload. 1241 1239 */ 1242 - if (timerlat_enabled() && !test_bit(OSN_WORKLOAD, &osnoise_options)) 1240 + if (timerlat_enabled() && !test_bit(OSN_WORKLOAD, &osnoise_options)) { 1241 + if (WARN_ON_ONCE(monitor_enabled)) 1242 + return 0; 1243 + 1243 1244 ret = register_trace_sched_migrate_task(trace_sched_migrate_callback, NULL); 1245 + if (!ret) 1246 + monitor_enabled = true; 1247 + } 1244 1248 1245 1249 return ret; 1246 1250 } 1247 1251 1248 1252 static void unregister_migration_monitor(void) 1249 1253 { 1250 - if (timerlat_enabled() && !test_bit(OSN_WORKLOAD, &osnoise_options)) 1251 - unregister_trace_sched_migrate_task(trace_sched_migrate_callback, NULL); 1254 + if (!monitor_enabled) 1255 + return; 1256 + 1257 + unregister_trace_sched_migrate_task(trace_sched_migrate_callback, NULL); 1258 + monitor_enabled = false; 1252 1259 } 1253 1260 #else 1254 1261 static int register_migration_monitor(void)