From: Steven Rostedt <rostedt@goodmis.org>
To: sashiko-bot@kernel.org
Cc: sashiko-reviews@lists.linux.dev,
"Crystal Wood" <crwood@redhat.com>,
linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] tracing/osnoise: Per-cpu mutex and fd detachment
Date: Wed, 26 Aug 2026 15:31:32 -0400 [thread overview]
Message-ID: <20260826153132.1333fac6@gandalf.local.home> (raw)
In-Reply-To: <20260824213037.F41B11F000E9@smtp.kernel.org>
On Mon, 24 Aug 2026 21:30:37 +0000
sashiko-bot@kernel.org wrote:
> [Severity: High]
> Can holding osn_var->lock while calling kthread_stop() cause a deadlock?
>
> kthread_stop() blocks waiting for the target kthread to exit. However, if
> the kthread is currently handling a migration request in
> osnoise_migration_pending() (shown slightly earlier in the diff), it will
> attempt to acquire this same osn_var->lock before it can clear its state and
> exit:
This code has a lot of nastiness in the locking with regard to the thread.
I haven't looked deeply at your patch, but the fact that Sashiko pointed
out a possible deadlock I think you may be hitting the mess I was hitting.
Have you looked at this thread: https://lore.kernel.org/all/20240820130001.124768-1-tglozar@redhat.com/
It has some tests I ran along with tracing that detected issues. Of course,
everything needs to be run with lockdep enabled too.
-- Steve
next prev parent reply other threads:[~2026-08-26 19:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 21:15 [PATCH 0/4] tracing/osnoise: Synchronization fixes Crystal Wood
2026-08-24 21:15 ` [PATCH 1/4] tracing/osnoise: Per-cpu mutex and fd detachment Crystal Wood
2026-08-24 21:30 ` sashiko-bot
2026-08-26 19:31 ` Steven Rostedt [this message]
2026-08-26 21:19 ` Crystal Wood
2026-08-27 0:41 ` Steven Rostedt
2026-08-27 9:04 ` Tomas Glozar
2026-08-26 22:34 ` Crystal Wood
2026-08-24 21:15 ` [PATCH 2/4] tracing/osnoise: timerlat_main: Disable migration before per-cpu access Crystal Wood
2026-08-24 21:29 ` sashiko-bot
2026-08-24 21:15 ` [PATCH 3/4] tracing/osnoise: start_kthread: Always check OSN_WORKLOAD Crystal Wood
2026-08-24 21:15 ` [PATCH 4/4] tracing/osnoise: Take trace_types_lock in timerlat_fd_open Crystal Wood
2026-08-24 21:24 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260826153132.1333fac6@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=crwood@redhat.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox