* [GIT PULL] tracing: Two locking fixes
@ 2021-11-11 14:08 Steven Rostedt
2021-11-11 23:09 ` pr-tracker-bot
0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2021-11-11 14:08 UTC (permalink / raw)
To: Linus Torvalds; +Cc: LKML, Ingo Molnar, Andrew Morton, Jiri Olsa
Linus,
Two tracing fixes:
- Add mutex protection to ring_buffer_reset()
- Fix deadlock in modify_ftrace_direct_multi()
Please pull the latest trace-v5.16-3 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v5.16-3
Tag SHA1: 04b4f472203407d85d8ca937f8f2dbe265f87d84
Head SHA1: 2e6e9058d13a22a6fdd36a8c444ac71d9656003a
Jiri Olsa (1):
ftrace/direct: Fix lockup in modify_ftrace_direct_multi
Steven Rostedt (VMware) (1):
ring-buffer: Protect ring_buffer_reset() from reentrancy
----
kernel/trace/ftrace.c | 3 ++-
kernel/trace/ring_buffer.c | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
---------------------------
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b4ed1a301232..fc49e8809a56 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5602,10 +5602,11 @@ int modify_ftrace_direct_multi(struct ftrace_ops *ops, unsigned long addr)
}
}
+ mutex_unlock(&ftrace_lock);
+
/* Removing the tmp_ops will add the updated direct callers to the functions */
unregister_ftrace_function(&tmp_ops);
- mutex_unlock(&ftrace_lock);
out_direct:
mutex_unlock(&direct_mutex);
return err;
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index f6520d0a4c8c..2699e9e562b1 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -5228,6 +5228,9 @@ void ring_buffer_reset(struct trace_buffer *buffer)
struct ring_buffer_per_cpu *cpu_buffer;
int cpu;
+ /* prevent another thread from changing buffer sizes */
+ mutex_lock(&buffer->mutex);
+
for_each_buffer_cpu(buffer, cpu) {
cpu_buffer = buffer->buffers[cpu];
@@ -5246,6 +5249,8 @@ void ring_buffer_reset(struct trace_buffer *buffer)
atomic_dec(&cpu_buffer->record_disabled);
atomic_dec(&cpu_buffer->resize_disabled);
}
+
+ mutex_unlock(&buffer->mutex);
}
EXPORT_SYMBOL_GPL(ring_buffer_reset);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [GIT PULL] tracing: Two locking fixes
2021-11-11 14:08 [GIT PULL] tracing: Two locking fixes Steven Rostedt
@ 2021-11-11 23:09 ` pr-tracker-bot
0 siblings, 0 replies; 2+ messages in thread
From: pr-tracker-bot @ 2021-11-11 23:09 UTC (permalink / raw)
To: Steven Rostedt
Cc: Linus Torvalds, LKML, Ingo Molnar, Andrew Morton, Jiri Olsa
The pull request you sent on Thu, 11 Nov 2021 09:08:59 -0500:
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git trace-v5.16-3
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/600b18f88f2625ba48542dfeaa5fe8b23b3fd2c4
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-11 23:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 14:08 [GIT PULL] tracing: Two locking fixes Steven Rostedt
2021-11-11 23:09 ` pr-tracker-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).