public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wei Li <liwei391@huawei.com>
To: <linux-trace-kernel@vger.kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	<xiexiuqi@huawei.com>
Subject: [PATCH v2 0/2] tracing: Fix deadlock in hwlat tracer
Date: Thu, 21 Nov 2024 10:18:21 +0800	[thread overview]
Message-ID: <20241121021823.1237741-1-liwei391@huawei.com> (raw)

This patchset fixes a deadlock issue found in concurrent CPU-hotplug and
tracer-toggling testing:

Background: *test_hotplug.sh*
```
#!/bin/sh

while true
do
	echo 0 > /sys/devices/system/cpu/cpu1/online
	echo 1 > /sys/devices/system/cpu/cpu1/online
done
```

Test: *test_hwlat.sh*
```
#!/bin/sh

echo per-cpu > /sys/kernel/debug/tracing/hwlat_detector/mode
while true
do
	echo hwlat > /sys/kernel/debug/tracing/current_tracer
	echo nop > /sys/kernel/debug/tracing/current_tracer
done
```

v1 -> v2:
 - The previous solution try to make the mutex obtaining in kthread_fn()
 interruptible to fix this issue. To make the logic clearer, change to
 remove the mutex_lock in this version. 

Links:
 v1: https://lore.kernel.org/linux-trace-kernel/20240924094515.3561410-6-liwei391@huawei.com/

Wei Li (2):
  tracing: Allow custom read/write processing in
    trace_min_max_{write,read}()
  tracing/hwlat: Fix deadlock in cpuhp processing

 kernel/trace/trace.c       | 13 ++++++++++---
 kernel/trace/trace.h       |  2 ++
 kernel/trace/trace_hwlat.c | 15 +++++++++++----
 3 files changed, 23 insertions(+), 7 deletions(-)

-- 
2.25.1


             reply	other threads:[~2024-11-21  2:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21  2:18 Wei Li [this message]
2024-11-21  2:18 ` [PATCH v2 1/2] tracing: Allow custom read/write processing in trace_min_max_{write,read}() Wei Li
2024-12-11  3:56   ` Steven Rostedt
2024-11-21  2:18 ` [PATCH v2 2/2] tracing/hwlat: Fix deadlock in cpuhp processing Wei Li

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=20241121021823.1237741-1-liwei391@huawei.com \
    --to=liwei391@huawei.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=xiexiuqi@huawei.com \
    /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