From: Steven Rostedt <rostedt@goodmis.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>,
LKML <linux-kernel@vger.kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
Thorsten Leemhuis <regressions@leemhuis.info>,
Ulf Hansson <ulf.hansson@linaro.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org
Subject: Re: [BUG RESEND] [BISECTED]: selftest: ftracetest: memleak in vfs_write()
Date: Tue, 4 Apr 2023 19:36:16 -0400 [thread overview]
Message-ID: <20230404193616.378357f1@gandalf.local.home> (raw)
In-Reply-To: <20230404182428.4ccd3f96@gandalf.local.home>
On Tue, 4 Apr 2023 18:24:28 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Tue, 4 Apr 2023 15:07:44 -0700
> Eric Biggers <ebiggers@kernel.org> wrote:
>
> > This looks like an issue with the tracing subsystem. I appreciate that you've
> > now added the tracing maintainers to Cc. I don't think your bisection to commit
> > 71946a25f357 ("Merge tag 'mmc-v6.2' ...") is correct; that looks unrelated.
>
> No that is not the correct commit. I think I see the issue. The error log
> of a tracing instance doesn't seem to be freed if the instance is removed.
>
> I'm guessing this can cause the bug:
>
> # cd /sys/kernel/tracincg
> # mkdir instances/foo
> # echo 'p:nothing no_function_here' > instances/foo/dynamic_events
OK, it required me to touch a trigger as dynamic_events only exists in the
top level (and the bug report shows a filter):
# echo 'hist:keys=x' > instances/foo/events/sched/sched_switch/trigger
> # rmdir instances/foo
>
Anyway, I was able to reproduce the leak. Can you test this patch?
-- Steve
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8ae51f1dea8e..352a804b016d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9516,6 +9516,7 @@ static int __remove_instance(struct trace_array *tr)
tracefs_remove(tr->dir);
free_percpu(tr->last_func_repeats);
free_trace_buffers(tr);
+ clear_tracing_err_log(tr);
for (i = 0; i < tr->nr_topts; i++) {
kfree(tr->topts[i].topts);
next prev parent reply other threads:[~2023-04-04 23:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 18:36 BUG: BISECTED: " Mirsad Goran Todorovac
2023-04-04 19:52 ` [BUG RESEND] [BISECTED]: selftest: ftracetest: " Mirsad Goran Todorovac
2023-04-04 22:07 ` Eric Biggers
2023-04-04 22:24 ` Steven Rostedt
2023-04-04 23:36 ` Steven Rostedt [this message]
2023-04-05 4:01 ` Mirsad Goran Todorovac
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=20230404193616.378357f1@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=ebiggers@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mirsad.todorovac@alu.unizg.hr \
--cc=regressions@leemhuis.info \
--cc=shuah@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®