Re: [PATCH v7 05/10] tracing/osnoise: Per-cpu mutexes and fd detachment

From
Crystal Wood <hidden>
Date
2026-11-13 20:23:20
Also in
sashiko-reviews
Reply to
sashiko-bot@kernel.org, 2026-11-13
On Fri, 2026-11-13 at 07:14 +0000, sashiko-bot@kernel.org wrote:
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] tracing/osnoise: missing migration detection in
  timerlat_fd_read()
--

commit d34bc9208d90b4be9c903307f53e72248c2ac3b7
Author: Crystal Wood [off-list ref]

tracing/osnoise: Per-cpu mutexes and fd detachment

This commit introduces per-cpu mutexes to protect kthread and timerlat file
descriptor state, replacing the SIGKILL mechanism for user-space timerlat
threads with a mutex-protected detachment mechanism.

[Severity: Medium]
In kernel/trace/trace_osnoise.c, timerlat_fd_read() removes the
cpu != smp_processor_id() migration handling (which set
cpu_tmr_var(cpu)->uthread_migrate = 1, tainted osnoise, and stopped
tracing) and instead locks this_cpu_tmr_var()->detach_lock before checking
fdd != osn_var->fdd or tlat->uthread_migrate.

Can this miss user-space thread migrations when NO_OSNOISE_WORKLOAD is
enabled after the timerlat tracer has already been started?

By default, OSN_WORKLOAD is set in osnoise_options. If the user enables
timerlat first and then writes NO_OSNOISE_WORKLOAD to osnoise/options (as
shown in Documentation/trace/timerlat-tracer.rst), osnoise_options_write()
does not call register_migration_monitor(), which only runs during initial
tracer startup in osnoise_workload_start() -> osnoise_hook_events() ->
hook_thread_events() -> register_migration_monitor() and skips registering
trace_sched_migrate_callback() when OSN_WORKLOAD is set.
That's a minor pre-existing bug that shouldn't block this patchset.

-Crystal
Thread (17 messages) 17 messages, 2 authors, last reply 3d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help