From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Martin KaFai Lau <kafai@fb.com>,
linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: ftrace module init race/bug
Date: Mon, 7 Nov 2016 12:35:42 -0800 [thread overview]
Message-ID: <20161107203540.GA29563@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <20161107150841.04577223@gandalf.local.home>
On Mon, Nov 07, 2016 at 03:08:41PM -0500, Steven Rostedt wrote:
> On Mon, 7 Nov 2016 11:46:24 -0800
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>
> > Hi Steven,
> >
> > I'm debugging the following spew:
> >
> > [ 7139.111213] WARNING: CPU: 8 PID: 856649 at kernel/trace/ftrace.c:2747 ftrace_shutdown+0x263/0x270
>
> What kernel version is this, as that line number doesn't line up to
> nay warning on 4.9 on 4.9-rc1.
it's our 4.6 with backports. It's line 2766 in 4.9 and as far as I can tell
the ftrace logic is the same, so pretty sure it's applicable, but...
no reproducer available. Only this spew.
> > do you think the following diff is enough to silence the warning
> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index b1870fbd2b67..edb00bf70d84 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -2744,7 +2744,7 @@ static int ftrace_shutdown(struct ftrace_ops *ops, int command)
> > struct dyn_ftrace *rec;
> >
> > do_for_each_ftrace_rec(pg, rec) {
> > - if (FTRACE_WARN_ON_ONCE(rec->flags))
> > + if (FTRACE_WARN_ON_ONCE(rec->flags & ~FTRACE_FL_DISABLED))
> > pr_warn(" %pS flags:%lx\n",
> > (void *)rec->ip, rec->flags);
> > } while_for_each_ftrace_rec();
> >
> > or it's a tip of an iceberg and less hacky fix is needed?
>
> Actually, this may be correct. I need to audit the other
> do_for_each_ftrace_rec() loops.
yep, the __ftrace_hash_rec_update() has !FTRACE_FL_DISABLED check,
so I thought ftrace_shutdown() may need it too.
Should I send the above patch with proper sob?
next prev parent reply other threads:[~2016-11-07 21:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 19:46 Alexei Starovoitov
2016-11-07 20:08 ` Steven Rostedt
2016-11-07 20:35 ` Alexei Starovoitov [this message]
2016-11-07 20:50 ` Steven Rostedt
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=20161107203540.GA29563@ast-mbp.thefacebook.com \
--to=alexei.starovoitov@gmail.com \
--cc=kafai@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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
Powered by JetHome